summary refs log blame commit diff stats
path: root/po/bg.po
blob: bf3b7baacbc863c8c130432b590127be1f750784 (plain) (tree)
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
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078





















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                                                    
# Bulgarian translation of xchat2.
# This file is put in the public domain.
# Rostislav Raykov <zbrox@i-space.org>, 2005.
# Rostislav Raykov <zbrox@i-space.org>, 2005.
# Even though this file is set to correspond to 2.4.2
# version it is synced with xchat HEAD. We still have to
# work around the TP robot.
#
#
msgid ""
msgstr ""
"Project-Id-Version: xchat 2.4.2\n"
"Report-Msgid-Bugs-To: www.xchat.org\n"
"POT-Creation-Date: 2005-03-07 18:50+1100\n"
"PO-Revision-Date: 2005-05-20 17:51+0300\n"
"Last-Translator: Rostislav Raykov <zbrox@i-space.org>\n"
"Language-Team: Bulgarian <dict@fsa-bg.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"

#: src/common/cfgfiles.c:350
msgid "Cannot create ~/.xchat2"
msgstr "Не може да се създаде ~/.xchat2"

#: src/common/cfgfiles.c:672
msgid "I'm busy"
msgstr "Зает съм"

#: src/common/cfgfiles.c:673
msgid "Leaving"
msgstr "Напускам"

#: src/common/cfgfiles.c:719
msgid ""
"* Running IRC as root is stupid! You should\n"
"  create a User Account and use that to login.\n"
msgstr ""
"* Да влизате в IRC като root е ГЛУПАВО! Направете си\n"
"  потребител и използвайте него.\n"

#: src/common/dcc.c:61
msgid "Waiting"
msgstr "Чакам"

#: src/common/dcc.c:62
msgid "Active"
msgstr "Активна"

#: src/common/dcc.c:63
msgid "Failed"
msgstr "Пропадна"

#: src/common/dcc.c:64
msgid "Done"
msgstr "Готово"

#: src/common/dcc.c:65
msgid "Connect"
msgstr "Свързване"

#: src/common/dcc.c:66
msgid "Aborted"
msgstr "Прекъснато"

#: src/common/dcc.c:1299
#, c-format
msgid "Cannot access %s\n"
msgstr "Няма достъп до %s\n"

#: src/common/dcc.c:1919
msgid "No active DCCs\n"
msgstr "Няма активни DCC-та\n"

#: src/common/ignore.c:120 src/common/ignore.c:124 src/common/ignore.c:128
#: src/common/ignore.c:132 src/common/ignore.c:136 src/common/ignore.c:140
#: src/common/ignore.c:144
msgid "YES  "
msgstr "ДА"

#: src/common/ignore.c:122 src/common/ignore.c:126 src/common/ignore.c:130
#: src/common/ignore.c:134 src/common/ignore.c:138 src/common/ignore.c:142
#: src/common/ignore.c:146
msgid "NO   "
msgstr "НЕ"

#: src/common/ignore.c:373
#, c-format
msgid "You are being CTCP flooded from %s, ignoring %s\n"
msgstr "Вие сте CTCP flood-нати от %s, игнорира се %s\n"

#: src/common/ignore.c:398
#, c-format
msgid "You are being MSG flooded from %s, setting gui_auto_open_dialog OFF.\n"
msgstr "Вие сте заляти(flood) със съобщения от %s, настройва се автоматичния диалог на изключен.\n"

#: src/common/notify.c:400
#, c-format
msgid "  %-20s online\n"
msgstr "  %-20s онлайн\n"

#: src/common/notify.c:402
#, c-format
msgid "  %-20s offline\n"
msgstr "  %-20s офлайн\n"

#: src/common/outbound.c:70
msgid "No channel joined. Try /join #<channel>\n"
msgstr "Не сте влезли в стая. Опитайте с /join #<стая>\n"

#: src/common/outbound.c:76
msgid "Not connected. Try /server <host> [<port>]\n"
msgstr "Не сте свързани. Опитайте с /server <хост> [<порт>]\n"

#: src/common/outbound.c:1375
msgid "I need /bin/sh to run!\n"
msgstr "Нужен е /bin/sh, за да се изпълни!\n"

#: src/common/outbound.c:1618
msgid ""
"\n"
"Commands Available:\n"
"\n"
"  "
msgstr ""
"\n"
"Налични команди:\n"
"\n"
"  "

#: src/common/outbound.c:1653
msgid ""
"\n"
"\n"
"Type /HELP <command> for more information, or /HELP -l\n"
"\n"
msgstr ""
"\n"
"\n"
"Напишете /HELP <команда> за повече информация, или /HELP -l\n"
"\n"

#: src/common/outbound.c:1654
msgid ""
"User defined commands:\n"
"\n"
"  "
msgstr ""
"Потребителски команди:\n"
"\n"
"  "

#: src/common/outbound.c:1746
#, c-format
msgid "Unknown arg '%s' ignored."
msgstr "Непознатия аргумент '%s' се игнорира."

#: src/common/outbound.c:2524
msgid "No such plugin found.\n"
msgstr "Няма намерен такъв плъгин.\n"

#: src/common/outbound.c:2529 src/fe-gtk/plugingui.c:185
msgid "That plugin is refusing to unload.\n"
msgstr "Този плъгин не иска да се отзарежда.\n"

#: src/common/outbound.c:2686
msgid "ADDBUTTON <name> <action>, adds a button under the user-list"
msgstr "ADDBUTTON <име> <действие>, добавя бутон под списъка с потребители"

#: src/common/outbound.c:2688
msgid "ALLCHAN <cmd>, sends a command to all channels you're in"
msgstr "ALLCHAN <команда>, изпраща команда към всички присъединени стаи"

#: src/common/outbound.c:2690
msgid "ALLSERV <cmd>, sends a command to all servers you're in"
msgstr "ALLSERV <команда>, изпраща команда към всички сървъри, към които сте свързан"

#: src/common/outbound.c:2691
msgid "AWAY [<reason>], sets you away"
msgstr "AWAY [<причина>], включва режим \"Отсъствам\""

#: src/common/outbound.c:2693
msgid "BAN <mask> [<bantype>], bans everyone matching the mask from the current channel. If they are already on the channel this doesn't kick them (needs chanop)"
msgstr ""

#: src/common/outbound.c:2695
msgid "CLEAR, Clears the current text window"
msgstr "CLEAR, изчиства текущия текстов прозорец"

#: src/common/outbound.c:2696
msgid "CLOSE, Closes the current window/tab"
msgstr "CLOSE, затваря текущия прозорец/таб"

#: src/common/outbound.c:2699
msgid "COUNTRY [-s] <code|wildcard>, finds a country code, eg: au = australia"
msgstr "COUNTRY <код>, намира код на страна, пример: au = Австралия"

#: src/common/outbound.c:2701
msgid "CTCP <nick> <message>, send the CTCP message to nick, common messages are VERSION and USERINFO"
msgstr ""

#: src/common/outbound.c:2703
msgid "CYCLE, parts current channel and immediately rejoins"
msgstr "CYCLE, излиза се от текущата стая и после веднага пак се влиза в нея"

#: src/common/outbound.c:2705
msgid ""
"\n"
"DCC GET <nick>                     - accept an offered file\n"
"DCC SEND [-maxcps=#] <nick> [file] - send a file to someone\n"
"DCC LIST                           - show DCC list\n"
"DCC CHAT <nick>                    - offer DCC CHAT to someone\n"
"DCC CLOSE <type> <nick> <file>         example:\n"
"         /dcc close send johnsmith file.tar.gz"
msgstr ""

#: src/common/outbound.c:2715
msgid "DEHOP <nick>, removes chanhalf-op status from the nick on the current channel (needs chanop)"
msgstr ""

#: src/common/outbound.c:2717
msgid "DELBUTTON <name>, deletes a button from under the user-list"
msgstr "DELBUTTON <име>, изтрива бутон от тези, които са под списъка с потребителите"

#: src/common/outbound.c:2719
msgid "DEOP <nick>, removes chanop status from the nick on the current channel (needs chanop)"
msgstr ""

#: src/common/outbound.c:2721
msgid "DEVOICE <nick>, removes voice status from the nick on the current channel (needs chanop)"
msgstr ""

#: src/common/outbound.c:2722
msgid "DISCON, Disconnects from server"
msgstr "DISCON, прекъсва връзката към сървъра"

#: src/common/outbound.c:2723
msgid "DNS <nick|host|ip>, Finds a users IP number"
msgstr ""

#: src/common/outbound.c:2724
msgid "ECHO <text>, Prints text locally"
msgstr ""

#: src/common/outbound.c:2727
msgid "EXEC [-o] <command>, runs the command. If -o flag is used then output is sent to current channel, else is printed to current text box"
msgstr ""

#: src/common/outbound.c:2729
msgid "EXECCONT, sends the process SIGCONT"
msgstr ""

#: src/common/outbound.c:2732
msgid "EXECKILL [-9], kills a running exec in the current session. If -9 is given the process is SIGKILL'ed"
msgstr ""

#: src/common/outbound.c:2734
msgid "EXECSTOP, sends the process SIGSTOP"
msgstr ""

#: src/common/outbound.c:2735
msgid "EXECWRITE, sends data to the processes stdin"
msgstr ""

#: src/common/outbound.c:2739
msgid "FLUSHQ, flushes the current server's send queue"
msgstr ""

#: src/common/outbound.c:2741
msgid "GATE <host> [<port>], proxies through a host, port defaults to 23"
msgstr ""

#: src/common/outbound.c:2747
msgid "HOP <nick>, gives chanhalf-op status to the nick (needs chanop)"
msgstr ""

#: src/common/outbound.c:2749
msgid ""
"IGNORE <mask> <types..> <options..>\n"
"    mask - host mask to ignore, eg: *!*@*.aol.com\n"
"    types - types of data to ignore, one or all of:\n"
"            PRIV, CHAN, NOTI, CTCP, DCC, INVI, ALL\n"
"    options - NOSAVE, QUIET"
msgstr ""

#: src/common/outbound.c:2756
msgid "INVITE <nick> [<channel>], invites someone to a channel, by default the current channel (needs chanop)"
msgstr ""

#: src/common/outbound.c:2757
msgid "JOIN <channel>, joins the channel"
msgstr "JOIN <стая>, влизане в дадена стая"

#: src/common/outbound.c:2759
msgid "KICK <nick>, kicks the nick from the current channel (needs chanop)"
msgstr "KICK <прякор>, изхвърля упоменатия човек от текущата стая (изисква операторски статус)"

#: src/common/outbound.c:2761
msgid "KICKBAN <nick>, bans then kicks the nick from the current channel (needs chanop)"
msgstr ""

#: src/common/outbound.c:2764
msgid "LAGCHECK, forces a new lag check"
msgstr "LAGCHECK, пуска нова проверка на забавянето на репликите"

#: src/common/outbound.c:2766
msgid "LASTLOG <string>, searches for a string in the buffer"
msgstr "LASTLOG <низ>, търси за низ в буфера"

#: src/common/outbound.c:2768
msgid "LOAD <file>, loads a plugin or script"
msgstr "LOAD <файл>, зарежда плъгин или скрипт"

#: src/common/outbound.c:2771
msgid "MDEHOP, Mass deop's all chanhalf-ops in the current channel (needs chanop)"
msgstr ""

#: src/common/outbound.c:2773
msgid "MDEOP, Mass deop's all chanops in the current channel (needs chanop)"
msgstr ""

#: src/common/outbound.c:2775
msgid "ME <action>, sends the action to the current channel (actions are written in the 3rd person, like /me jumps)"
msgstr "ME <действие>, изпраща действието към текущата стая (действията трябва да са в трето лице. пример: /me скача)"

#: src/common/outbound.c:2777
msgid "MKICK, Mass kicks everyone except you in the current channel (needs chanop)"
msgstr ""

#: src/common/outbound.c:2780
msgid "MOP, Mass op's all users in the current channel (needs chanop)"
msgstr "MOP, масово дава операторски статус на всички потребители в дадената стая (изисква същия статус)"

#: src/common/outbound.c:2781
msgid "MSG <nick> <message>, sends a private message"
msgstr "MSG <прякор> <съобщение>, праща лично съобщение"

#: src/common/outbound.c:2784
msgid "NAMES, Lists the nicks on the current channel"
msgstr "NAMES, изписва прякорите в текущата стая"

#: src/common/outbound.c:2786
msgid "NCTCP <nick> <message>, Sends a CTCP notice"
msgstr ""

#: src/common/outbound.c:2787
msgid "NEWSERVER <hostname> [<port>]"
msgstr "NEWSERVER <име на хост> [<порт>]"

#: src/common/outbound.c:2788
msgid "NICK <nickname>, sets your nick"
msgstr "NICK <прякор>, настройва прякора ви"

#: src/common/outbound.c:2791
msgid "NOTICE <nick/channel> <message>, sends a notice. Notices are a type of message that should be auto reacted to"
msgstr "NOTICE <прякор/стая> <съобщение>, изпраща уведомение. Това са вид въобщения,към които трябва да се реагира автоматично"

#: src/common/outbound.c:2793
msgid "NOTIFY [<nick>], lists your notify list or adds someone to it"
msgstr "NOTIFY [<прякор>], изписва списъка с приятелчетата ти или добавя някой"

#: src/common/outbound.c:2795
msgid "OP <nick>, gives chanop status to the nick (needs chanop)"
msgstr "OP <прякор>, дава операторски статус на прякора (изисква същия статус)"

#: src/common/outbound.c:2797
msgid "PART [<channel>] [<reason>], leaves the channel, by default the current one"
msgstr "PART [<стая>] [<причина>], напуска стаята, по подразбиране текущата"

#: src/common/outbound.c:2799
msgid "PING <nick | channel>, CTCP pings nick or channel"
msgstr "PING <прякор | стая>, CTCP пинг към прякор или стая"

#: src/common/outbound.c:2801
msgid "QUERY <nick>, opens up a new privmsg window to someone"
msgstr "QUERY <прякор>, отваря нов диалогов прозорец с някой"

#: src/common/outbound.c:2803
msgid "QUIT [<reason>], disconnects from the current server"
msgstr "QUIT [<причина>], разкача се от текущия сървър"

#: src/common/outbound.c:2805
msgid "QUOTE <text>, sends the text in raw form to the server"
msgstr "QUOTE <текст>, праща текста в чиста форма към сървъра"

#: src/common/outbound.c:2808
msgid "RECONNECT [-ssl] [<host>] [<port>] [<password>], Can be called just as /RECONNECT to reconnect to the current server or with /RECONNECT ALL to reconnect to all the open servers"
msgstr ""

#: src/common/outbound.c:2811
msgid "RECONNECT [<host>] [<port>] [<password>], Can be called just as /RECONNECT to reconnect to the current server or with /RECONNECT ALL to reconnect to all the open servers"
msgstr ""

#: src/common/outbound.c:2813
msgid "RECV <text>, send raw data to xchat, as if it was received from the irc server"
msgstr "RECV <текст>, праща чиста информация към X-Chat, както ако е била получена от IRC сървър"

#: src/common/outbound.c:2816
msgid "SAY <text>, sends the text to the object in the current window"
msgstr "SAY <текст>, праща текста към обекта в текущия прозорец"

#: src/common/outbound.c:2819
msgid "SERVCHAN [-ssl] <host> <port> <channel>, connects and joins a channel"
msgstr "SERVCHAN [-ssl] <хост> <порт> <стая>, свързва се и влиза в стая"

#: src/common/outbound.c:2822
msgid "SERVCHAN <host> <port> <channel>, connects and joins a channel"
msgstr "SERVCHAN <хост> <порт> <стая>, свързва се и влиза в стая"

#: src/common/outbound.c:2826
msgid "SERVER [-ssl] <host> [<port>] [<password>], connects to a server, the default port is 6667 for normal connections, and 9999 for ssl connections"
msgstr "SERVER [-ssl] <хост> [<порт>] [<парола>], свързва се със сървър, стандартния порт е 6667 за нормални връзки и 9999 за SSL връзки"

#: src/common/outbound.c:2829
msgid "SERVER <host> [<port>] [<password>], connects to a server, the default port is 6667"
msgstr "SERVER <хост> [<порт>] [<парола>], свързва се със сървър, стандартния порт е 6667"

#: src/common/outbound.c:2831
msgid "SET [-quiet] <variable> [<value>]"
msgstr "SET [-quiet] <променлива> [<стойност>]"

#: src/common/outbound.c:2832
msgid "SETCURSOR [-|+]<position>"
msgstr "SETCURSOR [-|+]<позиция>, определя позицията на курсора"

#: src/common/outbound.c:2836
msgid "TOPIC [<topic>], sets the topic if one is given, else shows the current topic"
msgstr "TOPIC [<тема>], настройва темата ако е дадената такава, ако не-показва текущата"

#: src/common/outbound.c:2838
msgid "UNBAN <mask> [<mask>...], unbans the specified masks."
msgstr "UNBAN <маска> [<маска>...], маха забраната от избраните маски"

#: src/common/outbound.c:2839
msgid "UNIGNORE <mask> [QUIET]"
msgstr ""

#: src/common/outbound.c:2840
msgid "UNLOAD <name>, unloads a plugin or script"
msgstr "UNLOAD <име>, отзарежда плъгин или скрипт"

#: src/common/outbound.c:2841
msgid "URL <url>, opens a URL in your browser"
msgstr "URL <url>, отваря URL-то в браузъра ви"

#: src/common/outbound.c:2844
msgid "VOICE <nick>, gives voice status to someone (needs chanop)"
msgstr "VOICE <прякор>, дава статуса \"voice\" на някой (изисква операторски статус в стаята)"

#: src/common/outbound.c:2846
msgid "WALLCHAN <message>, writes the message to all channels"
msgstr "WALLCHAN <съобщение>, изпраща съобщението до всички канали"

#: src/common/outbound.c:2848
msgid "WALLCHOP <message>, sends the message to all chanops on the current channel"
msgstr "WALLCHOP <съобщение>, изпраща съобщение до всички оператори в текущата стая"

#: src/common/outbound.c:2881
#, c-format
msgid "Usage: %s\n"
msgstr "Употреба: %s\n"

#: src/common/outbound.c:2886
msgid ""
"\n"
"No help available on that command.\n"
msgstr ""
"\n"
"Няма налична помощ за тази команда.\n"

#: src/common/outbound.c:2892
msgid "No such command.\n"
msgstr "Няма такава команда.\n"

#: src/common/outbound.c:3216
msgid "Bad arguments for user command.\n"
msgstr "Грешни аргументи за потребителската команда.\n"

#: src/common/outbound.c:3380
msgid "Too many recursive usercommands, aborting."
msgstr "Прекалено много рекурсивни потребителски команди, прекъсва се..."

#: src/common/outbound.c:3453
msgid "Unknown Command. Try /help\n"
msgstr "Непозната команда. Опитайте /help\n"

#: src/common/plugin.c:359 src/common/plugin.c:400
msgid "No xchat_plugin_init symbol; is this really an xchat plugin?"
msgstr "Няма xchat_plugin_init символ; това наистина ли е X-Chat плъгин?"

#: src/common/server.c:586
msgid "Are you sure this is a SSL capable server and port?\n"
msgstr "Сигурни ли сте, че това е SSL сървър и правилния порт?\n"

#: src/common/server.c:937
#, c-format
msgid ""
"Cannot resolve hostname %s\n"
"Check your IP Settings!\n"
msgstr ""
"Не може да се разбере името на хоста %s\n"
"Проверете вашите IP настройки!\n"

#: src/common/server.c:942
msgid "Proxy traversal failed.\n"
msgstr "Пренасянето към проксито пропадна.\n"

#: src/common/servlist.c:644
#, c-format
msgid "Cycling to next server in %s...\n"
msgstr "Минава се към следващия сървър в %s...\n"

#: src/common/servlist.c:1056
#, c-format
msgid "Warning: \"%s\" character set is unknown. No conversion will be applied for network %s."
msgstr "Внимание: Кодовата таблица \"%s\" е непозната. Няма да има преобразуване за мрежата %s."

#: src/common/textevents.h:6
msgid "%C22*%O$t$1 added to notify list."
msgstr "-%C10-%C11-%O$t$1 е добавен/а към списъка с приятели."

#: src/common/textevents.h:9
msgid "%C22*%O$t$1 Banlist:%C19 $4%C20 $2%C21 $3"
msgstr "%C22*%O$t$1 Списък със забраните:%C19 $4%C20 $2%C21 $3"

#: src/common/textevents.h:12
msgid "%C22*%O$tCannot join%C26 %B$1 %O(You are banned)."
msgstr "%C22*%O$tНе можете да влезнете в%C26 %B$1 %O(Забранен ви е достъпа)."

#: src/common/textevents.h:18
msgid "%C22*%O$t$1 is now known as $2"
msgstr "%C22*%O$t$1 прякора му/й сега е $2"

#: src/common/textevents.h:21
msgid "%C18*$t$1%O $2"
msgstr "%C18*$t$1%O $2"

#: src/common/textevents.h:24
msgid "%C21*%O$t%C21%B$1%O%C21 $2"
msgstr "%C21*%O$t%C21%B$1%O%C21 $2"

#: src/common/textevents.h:27
msgid "%C22*%O$t$1 sets ban on $2"
msgstr "%C22*%O$t$1 поставя забрана на $2"

#: src/common/textevents.h:30
msgid "%C22*%O$tChannel $1 created on $2"
msgstr "%C22*%O$tСтаята $1 е създадена на $2"

#: src/common/textevents.h:33
msgid "%C22*%O$t%C26$1%O removes channel half-operator status from%C26 $2"
msgstr "%C22*%O$t%C26$1%O·маха·полу-операторския·статус·на%C26 $2"

#: src/common/textevents.h:36
msgid "%C22*%O$t%C26$1%O removes channel operator status from%C26 $2"
msgstr "%C22*%O$t%C26$1%O·маха·операторския·статус·от·%C26 $2"

#: src/common/textevents.h:39
msgid "%C22*%O$t%C26$1%O removes voice from%C26 $2"
msgstr "%C22*%O$t%C26$1%O премахва поканите от%C26 $2"

#: src/common/textevents.h:42
msgid "%C22*%O$t$1 sets exempt on $2"
msgstr "%C22*%O$t$1 слага покани за $2"

#: src/common/textevents.h:45
msgid "%C22*%O$t%C26$1%O gives channel half-operator status to%C26 $2"
msgstr "%C22*%O$t%C26$1%O дава полу-операторски статус на %C26 $2"

#: src/common/textevents.h:48
msgid "%C22*%O$t$1 sets invite on $2"
msgstr "%C22*%O$t$1 слага покани за $2"

#: src/common/textevents.h:51
msgid "%UChannel          Users   Topic"
msgstr "%UСтая     Потребители   Тема"

#: src/common/textevents.h:54
msgid "%C18%B%B$4$1%O%C18%O$t$2"
msgstr "%C18%B%B$4$1%O%C18%O$t$2"

#: src/common/textevents.h:57
msgid "%C22*%O$t$1 sets mode $2$3 $4"
msgstr "%C22*%O$t$1 поставя режим $2$3 $4"

#: src/common/textevents.h:60
msgid "%C22*%O$t%C22Channel $1 modes: $2"
msgstr "%C22*%O$t%C22Стая $1 режими: $2"

#: src/common/textevents.h:63
msgid "$4%C21%B$1%O$t%C21$2"
msgstr "$4%C21%B$1%O$t%C21$2"

#: src/common/textevents.h:66
msgid "%C28-%C29$1/$2%C28-%O$t$3"
msgstr "%C28-%C29$1/$2%C28-%O$t$3"

#: src/common/textevents.h:69
msgid "%C22*%O$t%C26$1%O gives channel operator status to%C26 $2"
msgstr "%C22*%O$t%C26$1%O дава статус на оператор за стаята на%C26 $"

#: src/common/textevents.h:72
msgid "%C22*%O$t$1 removes exempt on $2"
msgstr "%C22*%O$t$1 маха exempt от $2"

#: src/common/textevents.h:75
msgid "%C22*%O$t$1 removes invite on $2"
msgstr "%C22*%O$t$1 премахва поканите от $2"

#: src/common/textevents.h:78
msgid "%C22*%O$t$1 removes channel keyword"
msgstr "%C22*%O$t$1 маха ключовата дума на стаята"

#: src/common/textevents.h:81
msgid "%C22*%O$t$1 removes user limit"
msgstr "%C22*%O$t$1 маха потребителския лимит"

#: src/common/textevents.h:84
msgid "%C22*%O$t$1 sets channel keyword to $2"
msgstr "%C22*%O$t$1 настройва ключовата дума на стаята на $2"

#: src/common/textevents.h:87
msgid "%C22*%O$t$1 sets channel limit to $2"
msgstr "%C22*%O$t$1 настройва лимита на стаята на $2"

#: src/common/textevents.h:90
msgid "%C22*%O$t$1 removes ban on $2"
msgstr "%C22*%O$t$1 маха забраната за $2"

#: src/common/textevents.h:93
msgid "%C22*%O$t%C26$1%O gives voice to%C26 $2"
msgstr "%C22*%O$t%C26$1%O дава статус \"Voice\" на%C26 $2"

#: src/common/textevents.h:96
msgid "%C22*%O$t%C22Connected. Now logging in..."
msgstr "%C22*%O$t%C22Връзката е осъществена. Сега се влиза..."

#: src/common/textevents.h:99
msgid "%C22*%O$t%C22Connecting to $1 ($2) port $3%O..."
msgstr "%C22*%O$t%C22Свързване с $1 ($2) порт $3%O..."

#: src/common/textevents.h:102
msgid "%C21*%O$t%C21Connection failed. Error: $1"
msgstr "%C21*%O$t%C21Връзката пропадна. Грешка: $1"

#: src/common/textevents.h:105
msgid "%C22*%O$tReceived a CTCP $1 from $2"
msgstr "%C22*%O$tПолучен CTCP $1 от $2"

#: src/common/textevents.h:108
msgid "%C22*%O$tReceived a CTCP $1 from $2 (to $3)"
msgstr "%C22*%O$tПолучен CTCP $1 от $2 (до $3)"

#: src/common/textevents.h:111
msgid "%C19>%O$1%C19<%O$tCTCP $2"
msgstr "%C19>%O$1%C19<%O$tCTCP $2"

#: src/common/textevents.h:114
msgid "%C22*%O$tReceived a CTCP Sound $1 from $2"
msgstr "%C22*%O$tПолучен CTCP звук $1 от $2"

#: src/common/textevents.h:117
msgid "%C22*%O$tDCC CHAT to %C26$1%O aborted."
msgstr "%C22*%O$tDCC разговор с %C26$1%O прекъснат."

#: src/common/textevents.h:120
msgid "%C22*%O$tDCC CHAT connection established to %C26$1 %C30[%O$2%C30]"
msgstr "%C22*%O$tDCC разговор осъществи връзка с %C26$1 %C30[%O$2%C30]"

#: src/common/textevents.h:123
msgid "%C22*%O$tDCC CHAT to %C26$1%O lost ($4)."
msgstr "%C22*%O$tDCC разговор с %C26$1%O е изгубен ($4)."

#: src/common/textevents.h:126
msgid "%C22*%O$tReceived a DCC CHAT offer from $1"
msgstr "%C22*%O$tПолучено предложение за DCC разговор от $1"

#: src/common/textevents.h:129
msgid "%C22*%O$tOffering DCC CHAT to $1"
msgstr "%C22*%O$tПредлагане на DCC разговор на $1"

#: src/common/textevents.h:132
msgid "%C22*%O$tAlready offering CHAT to $1"
msgstr "%C22*%O$tВече се предлага разговор на $1"

#: src/common/textevents.h:135
msgid "%C22*%O$tDCC $1 connect attempt to%C26 $2%O failed (err=$3)."
msgstr "%C22*%O$tDCC $1 опит за връзка към %C26·$2%O·пропадна (err=$3)."

#: src/common/textevents.h:138
msgid "%C22*%O$tReceived '$1%O' from $2"
msgstr "%C22*%O$tПолучено '$1%O' от $2"

#: src/common/textevents.h:141
#, c-format
msgid "%C24,18 Type  To/From    Status  Size    Pos     File         "
msgstr "%C24,18 Вид  До/От    Статус  Размер    Позиция     Файл         "

#: src/common/textevents.h:144
msgid "%C22*%O$tReceived a malformed DCC request from %C26$1%O.%010%C22*%O$tContents of packet: $2"
msgstr "%C22*%O$tПолучи грешно DCC искане от %C26$1%O.%010%C22*%O$tСъдържание на пакета: $2"

#: src/common/textevents.h:147
msgid "%C22*%O$tOffering%C26 $1%O to%C26 $2"
msgstr "%C22*%O$tПредлага се%C26 $1%O на%C26 $2"

#: src/common/textevents.h:150
msgid "%C22*%O$tNo such DCC offer."
msgstr "%C22*%O$tНяма такова DCC предложение."

#: src/common/textevents.h:153
msgid "%C22*%O$tDCC RECV%C26 $2%O to%C26 $1%O aborted."
msgstr "%C22*%O$tDCC Получаване %C26·$2%O до %C26·$1%O е прекъснато."

#: src/common/textevents.h:156
msgid "%C22*%O$tDCC RECV%C26 $1%O from%C26 $3%O complete %C30[%C26$4%O cps%C30]%O."
msgstr "%C22*%O$tDCC получаване %C26·$1%O от %C26·$3%O завърши %C30[%C26$4%O·cps%C30]%O."

#: src/common/textevents.h:159
msgid "%C22*%O$tDCC RECV connection established to%C26 $1 %C30[%O$2%C30]"
msgstr "%C22*%O$tDCC получаване осъществи връзка с %C26 $1 %C30[%O$2%C30]"

#: src/common/textevents.h:162
msgid "%C22*%O$tDCC RECV%C26 $1%O from%C26 $3%O failed ($4)."
msgstr "%C22*%O$tDCC получаване %C26·$1%O от %C26·$3%O пропадна. ($4)."

#: src/common/textevents.h:165
msgid "%C22*%O$tDCC RECV: Cannot open $1 for writing ($2)."
msgstr "%C22*%O$tDCC Получаване: Не може да отвори $1 за запис ($2)."

#: src/common/textevents.h:168
msgid "%C22*%O$tThe file%C26 $1%C already exists, saving it as%C26 $2%O instead."
msgstr "%C22*%O$tФайлът %C26·$1%C вече съществува, вместо това се записва като %C26·$2%O."

#: src/common/textevents.h:171
msgid "%C22*%O$t%C26$1 %Ohas requested to resume%C26 $2 %Cfrom%C26 $3%C."
msgstr "%C22*%O$t%C26$1 %Oпоиска да продължи %C26·$2·%Cот %C26 $3%C."

#: src/common/textevents.h:174
msgid "%C22*%O$tDCC SEND%C26 $2%O to%C26 $1%O aborted."
msgstr "%C22*%O$tDCC изпращане %C26·$2%O·до %C26·$1%O е прекъснато."

#: src/common/textevents.h:177
msgid "%C22*%O$tDCC SEND%C26 $1%O to%C26 $2%O complete %C30[%C26$3%O cps%C30]%O."
msgstr "%C22*%O$tDCC изпращане %C26·$1%O до %C26 $2%O завърши %C30[%C26$3%O cps%C30]%O."

#: src/common/textevents.h:180
msgid "%C22*%O$tDCC SEND connection established to%C26 $1 %C30[%O$2%C30]"
msgstr "%C22*%O$tDCC изпращане осъществи връзка с %C26 $1 %C30[%O$2%C30]"

#: src/common/textevents.h:183
msgid "%C22*%O$tDCC SEND%C26 $1%O to%C26 $2%O failed. $3"
msgstr "%C22*%O$tDCC изпращане %C26·$1%O до %C26·$2%O пропадна. $3"

#: src/common/textevents.h:186
msgid "%C22*%O$t%C26$1 %Ohas offered%C26 $2 %O(%C26$3 %Obytes)"
msgstr "%C22*%O$t%C26$1·%Oе предложил %C26·$2·%O(%C26$3·%Oбайта)"

#: src/common/textevents.h:189
msgid "%C22*%O$tDCC $1%C26 $2 %Oto%C26 $3 %Cstalled - aborting."
msgstr "%C22*%O$tDCC $1%C26·$2·%Oдо %C26·$3·%Cе спряло - прекъсва."

#: src/common/textevents.h:192
msgid "%C22*%O$tDCC $1%C26 $2 %Oto%C26 $3 %Otimed out - aborting."
msgstr "%C22*%O$tDCC $1%C26·$2·%Oдо %C26·$3·%Oе спряло - прекъсва."

#: src/common/textevents.h:195
msgid "%C22*%O$t$1 deleted from notify list."
msgstr "%C22*%O$t$1 е изтрит/а от списъка с приятелчетата."

#: src/common/textevents.h:198
msgid "%C22*%O$tDisconnected ($1)."
msgstr "%C22*%O$t$1Връзката е прекъсната ($1)."

#: src/common/textevents.h:201
msgid "%C22*%O$tFound your IP: [$1]"
msgstr "%C22*%O$tВашето IP е намерено: [$1]"

#: src/common/textevents.h:204
msgid "$1$t$2"
msgstr "$1$t$2"

#: src/common/textevents.h:207
msgid "%O%C26$1%O added to ignore list."
msgstr "%O%C26$1%O е добавен/а в списъка с игнорираните"

#: src/common/textevents.h:210
msgid "Ignore on %C26$1%O changed."
msgstr "Игнорирането на %C26$1%O беше променено."

#: src/common/textevents.h:213
#, c-format
msgid "%C24,18                                                              "
msgstr "%C24,18                                                              "

#: src/common/textevents.h:216
#, c-format
msgid "%C24,18 Hostmask                  PRIV NOTI CHAN CTCP DCC  INVI UNIG "
msgstr ""

#: src/common/textevents.h:219
msgid "%O%C26$1%O removed from ignore list."
msgstr "%O%C26$1%O е махнат/а от списъка с игнорираните."

#: src/common/textevents.h:222
msgid "  Ignore list is empty."
msgstr "  Списъка с игнорираните е празен."

#: src/common/textevents.h:225
msgid "%C22*%O$tCannot join%C26 %B$1 %O(Channel is invite only)."
msgstr "%C22*%O$tНе може да се влезне в%C26·%B$1·%O(Стаята е само с покани)."

#: src/common/textevents.h:228
msgid "%C22*%O$tYou have been invited to%C26 $1%O by%C26 $2%C (%C26$3%C)"
msgstr "%C22*%O$tБяхте поканени в %C26·$1%O от %C26 $2%C (%C26$3%C)"

#: src/common/textevents.h:231
msgid "%C19*%O$t%C19%B$1 %B($3) has joined $2"
msgstr "%C19*%O$t%C19%B$1 %B($3) влезна в $2"

#: src/common/textevents.h:234
msgid "%C22*%O$tCannot join%C26 %B$1 %O(Requires keyword)."
msgstr "%C22*%O$tНе може да се влезне в%C26 %B$1 %O(Нужна е ключова дума)."

#: src/common/textevents.h:237
msgid "%C21*%O$t%C21$1 has kicked $2 from $3 ($4%O%C21)"
msgstr "%C21*%O$t%C21$1 изхвърли $2 от $3 ($4%O%C21)"

#: src/common/textevents.h:240
msgid "%C22*%O$tYou have been killed by $1 ($2%O%C22)"
msgstr "%C22*%O$tБяхте убит/а от $1 ($2%O%C22)"

#: src/common/textevents.h:243
msgid "%C19>%O$1%C19<%O$t$2%O"
msgstr "%C19>%O$1%C19<%O$t$2%O"

#: src/common/textevents.h:246
msgid "%C16*%O$t$1%O"
msgstr "%C16*%O$t$1%O"

#: src/common/textevents.h:249
msgid "%C22*%O$t%C22MOTD Skipped."
msgstr "%C22*%O$t%C22Съобщението за деня е пропуснато."

#: src/common/textevents.h:252
msgid "%C22*%O$t$1 already in use. Retrying with $2..."
msgstr "%C22*%O$t$1 вече е зает. Опитва се отново с $2..."

#: src/common/textevents.h:255
msgid "%C22*%O$tNickname already in use. Use /NICK to try another."
msgstr "%C22*%O$tПрякора е вече зает. Използвайте /NICK ,за да опитате с друг."

#: src/common/textevents.h:258
msgid "%C22*%O$tNo such DCC."
msgstr "%C22*%O$tНяма такова DCC"

#: src/common/textevents.h:261
msgid "%C22*%O$tNo process is currently running"
msgstr "%C22*%O$tНяма текущ вървящ процес"

#: src/common/textevents.h:264
msgid "%C28-%C29$1%C28-%O$t$2"
msgstr "%C28-%C29$1%C28-%O$t$2"

#: src/common/textevents.h:267
msgid "%C19>%O$1%C19<%O$t$2"
msgstr "%C19>%O$1%C19<%O$t$2"

#: src/common/textevents.h:270
msgid "$tNotify list is empty."
msgstr "$tСписъка с приятелчета е празен."

#: src/common/textevents.h:273
msgid "%C24,18 %B  Notify List                           "
msgstr "%C24,18 %B  Списък с приятелчета                           "

#: src/common/textevents.h:276
msgid "%C22*%O$t$1 users in notify list."
msgstr "%C22*%O$t$1 потребителя в списъка с приятелчета."

#: src/common/textevents.h:279
msgid "%C22*%O$tNotify: $1 is offline ($2)."
msgstr "%C22*%O$tУведомяване: $1 вече не е на линия ($2)."

#: src/common/textevents.h:282
msgid "%C22*%O$tNotify: $1 is online ($2)."
msgstr "%C22*%O$tУведомяване: $1 е на линия ($2)."

#: src/common/textevents.h:288
msgid "%C23*%O$t%C23$1 (%O%C23$2) has left $3"
msgstr "%C23*%O$t%C23$1 (%O%C23$2) излезна от $3"

#: src/common/textevents.h:291
msgid "%C23*%O$t%C23$1 (%O%C23$2) has left $3 (%O%C23$4)"
msgstr "%C23*%O$t%C23$1 (%O%C23$2) излезна от $3 (%O%C23$4)"

#: src/common/textevents.h:294
msgid "%C22*%O$tPing reply from $1: $2 second(s)"
msgstr "%C22*%O$tПинг отговор от $1 : $2 секунда/и"

#: src/common/textevents.h:297
msgid "%C22*%O$tNo ping reply for $1 seconds, disconnecting."
msgstr "%C22*%O$tНямаше отговор от пинга за $1 секунди, прекъсване на връзката"

#: src/common/textevents.h:300
msgid "%C28*%C29$3$1%C28*$t%O$2"
msgstr "%C28*%C29$3$1%C28*$t%O$2"

#: src/common/textevents.h:303
msgid "%C18%B%B$3$1%O$t$2"
msgstr "%C18%B%B$3$1%O$t$2"

#: src/common/textevents.h:306
msgid "%C22*%O$tA process is already running"
msgstr "%C22*%O$tA - процеса вече върви"

#: src/common/textevents.h:309
msgid "%C23*%O$t%C23$1 has quit (%O%C23$2)"
msgstr "%C23*%O$t%C23$1 излезна от IRC (%O%C23$2)"

#: src/common/textevents.h:312
msgid "%C22*%O$t$1 sets modes%B %C30[%O$2%B%C30]"
msgstr "%C22*%O$t$1 поставя режими%B %C30[%O$2%B%C30]"

#: src/common/textevents.h:315
msgid "%C28-%C29$1/Wallops%C28-%O$t$2"
msgstr "%C28-%C29$1/Wallop съобщения%C28-%O$t$2"

#: src/common/textevents.h:318
msgid "%C22*%O$tLooking up IP number for%C26 $1%O..."
msgstr "%C22*%O$tТърсене на IP номера заr%C26 $1%O..."

#: src/common/textevents.h:321
msgid "%C22*%O$t%C22Connected."
msgstr "%C22*%O$t%C22Връзката е осъществена."

#: src/common/textevents.h:324 src/common/textevents.h:330
#: src/common/textevents.h:333
msgid "%C22*%O$t$1"
msgstr "%C22*%O$t$1"

#: src/common/textevents.h:327
msgid "%C22*%O$t%C22Looking up $1"
msgstr "%C22*%O$t%C22Търсене... $1"

#: src/common/textevents.h:336
msgid "%C22*%O$tStopped previous connection attempt (pid=$1)"
msgstr "%C22*%O$tПредишния опит за връзка спрян (pid=$1)"

#: src/common/textevents.h:339
msgid "%C29*%O$t%C29Topic for $1%C %C29is: $2"
msgstr "%C29*%O$t%C29Темата на $1%C %C29е: $2"

#: src/common/textevents.h:342
msgid "%C22*%O$t$1 has changed the topic to: $2"
msgstr "%C22*%O$t$1 смени темата на: $2"

#: src/common/textevents.h:345
msgid "%C29*%O$t%C29Topic for $1%C %C29set by $2%C %C29at $3"
msgstr "%C29*%O$t%C29Темата на $1%C %C29е настроена от $2%C %C29на $3"

#: src/common/textevents.h:348
msgid "%C22*%O$tUnknown host. Maybe you misspelled it?"
msgstr "%C22*%O$tНепознат хост. Може би сте направили грешка при изписването?"

#: src/common/textevents.h:351
msgid "%C22*%O$tCannot join%C26 %B$1 %O(User limit reached)."
msgstr "%C22*%O$tНе може да се влезне в%C26 %B$1 %O(Достигнат е потребителският лимит)."

#: src/common/textevents.h:354
msgid "%C22*%O$t%C26Users on $1:%C $2"
msgstr "%C22*%O$t%C26Потребителя в $1:%C $2"

#: src/common/textevents.h:357
msgid "%C22*%O$t%C28[%O$1%C28] %O$2%C27 $3"
msgstr "%C22*%O$t%C28[%O$1%C28] %O$2%C27 $3"

#: src/common/textevents.h:360
msgid "%C22*%O$t%C28[%O$1%C28] %Cis away %C30(%O$2%O%C30)"
msgstr "%C22*%O$t%C28[%O$1%C28] %Cотсъства %C30(%O$2%O%C30)"

#: src/common/textevents.h:363 src/common/textevents.h:369
#: src/common/textevents.h:384 src/common/textevents.h:387
msgid "%C22*%O$t%C28[%O$1%C28]%O $2"
msgstr "%C22*%O$t%C28[%O$1%C28]%O $2"

#: src/common/textevents.h:366
msgid "%C22*%O$t%C28[%O$1%C28] %OEnd of WHOIS list."
msgstr "%C22*%O$t%C28[%O$1%C28] %OКрай на \"Кой е...?\" информацията."

#: src/common/textevents.h:372
msgid "%C22*%O$t%C28[%O$1%C28]%O idle%C26 $2"
msgstr "%C22*%O$t%C28[%O$1%C28]%O неактивност%C26 $2"

#: src/common/textevents.h:375
msgid "%C22*%O$t%C28[%O$1%C28]%O idle%C26 $2%O, signon:%C26 $3"
msgstr "%C22*%O$t%C28[%O$1%C28]%O неактивност%C26 $2%O, включил/а се на:%C26 $3"

#: src/common/textevents.h:378
msgid "%C22*%O$t%C28[%O$1%C28] %C30(%O$2@$3%C30)%O: $4"
msgstr "%C22*%O$t%C28[%O$1%C28] %C30(%O$2@$3%C30)%O: $4"

#: src/common/textevents.h:381
msgid "%C22*%O$t%C28[%O$1%C28] %Oreal user@host%C27 $2%O, real IP%C27 $3"
msgstr "%C22*%O$t%C28[%O$1%C28] %Oистински потребител@хост%C27 $2%O, реално IP%C27 $3"

#: src/common/textevents.h:390
msgid "%C19*%O$t%C19Now talking on $2"
msgstr "%C19*%O$t%C19Сега говорите в $2"

#: src/common/textevents.h:393
msgid "%C23*$tYou have been kicked from $2 by $3 ($4%O%C23)"
msgstr "%C23*$tБяхте изхвърлени от стаята $2 от $3 ($4%O%C23)"

#: src/common/textevents.h:396
#, c-format
msgid "%C23*$tYou have left channel $3"
msgstr "%C23*$tНапуснахте стаята $3"

#: src/common/textevents.h:399
msgid "%C23*$tYou have left channel $3 (%O%C23$4%O%C23)"
msgstr "%C23*$tНапуснахте стаята $3 (%O%C23$4%O%C23)"

#: src/common/textevents.h:402
msgid "%C22*%O$tYou've invited%C26 $1%O to%C26 $2%O (%C26$3%O)"
msgstr "%C22*%O$tПоканихте%C26 $1%O в%C26 $2%O (%C26$3%O)"

#: src/common/textevents.h:405
msgid "%C31%B%B$4$1%O$t%C30$2"
msgstr "%C31%B%B$4$1%O$t%C30$2"

#: src/common/textevents.h:408
msgid "%C22*%O$tYou are now known as $2"
msgstr "-%C10-%C11-%O$tНовият ви прякор е $2"

#: src/common/text.c:207
#, c-format
msgid "**** ENDING LOGGING AT %s\n"
msgstr "**** КРАЙ НА ЗАПИСВАНЕ НА РАЗГОВОРА В %s\n"

#: src/common/text.c:325
#, c-format
msgid "**** BEGIN LOGGING AT %s\n"
msgstr "**** НАЧАЛО НА ЗАПИСВАНЕ НА РАЗГОВОРА В %s\n"

#: src/common/text.c:344
#, c-format
msgid ""
"* Can't open log file(s) for writing. Check the\n"
"  permissions on %s/xchatlogs"
msgstr ""
"* Не може да се пише във файла за записване на разговорите.\n"
"  Проверете правата за %s/xchatlogs"

#: src/common/text.c:559
msgid "Left message"
msgstr "Ляво съобщение"

#: src/common/text.c:560
msgid "Right message"
msgstr "Дясно съобщение"

#: src/common/text.c:564
msgid "The nick of the joining person"
msgstr "Прякора на човека, който влиза"

#: src/common/text.c:565
msgid "The channel being joined"
msgstr "Стаята, в която се влиза"

#: src/common/text.c:566 src/common/text.c:611 src/common/text.c:668
msgid "The host of the person"
msgstr "Хоста на човека"

#: src/common/text.c:570 src/common/text.c:575 src/common/text.c:582
#: src/common/text.c:649 src/common/text.c:774 src/common/text.c:781
#: src/common/text.c:786 src/common/text.c:791 src/common/text.c:796
#: src/common/text.c:802 src/common/text.c:807 src/common/text.c:811
#: src/common/text.c:817 src/common/text.c:823 src/common/text.c:869
#: src/common/text.c:878 src/common/text.c:883 src/common/text.c:888
#: src/common/text.c:897 src/common/text.c:908 src/common/text.c:915
#: src/common/text.c:921 src/common/text.c:926 src/common/text.c:931
#: src/common/text.c:938 src/common/text.c:944 src/common/text.c:950
#: src/common/text.c:955 src/common/text.c:960 src/common/text.c:964
#: src/common/text.c:970 src/common/text.c:978 src/common/text.c:1012
#: src/common/text.c:1017
msgid "Nickname"
msgstr "Прякор"

#: src/common/text.c:571
msgid "The action"
msgstr "Действието"

#: src/common/text.c:576
msgid "The text"
msgstr "Текстът"

#: src/common/text.c:577
msgid "Mode char"
msgstr ""

#: src/common/text.c:578 src/common/text.c:651
msgid "Identified text"
msgstr ""

#: src/common/text.c:583 src/common/text.c:639 src/common/text.c:645
#: src/common/text.c:650
msgid "The message"
msgstr "Съобщението"

#: src/common/text.c:587 src/common/text.c:655
msgid "Old nickname"
msgstr "Стар прякор"

#: src/common/text.c:588 src/common/text.c:656
msgid "New nickname"
msgstr "Нов прякор"

#: src/common/text.c:592
msgid "Nick of person who changed the topic"
msgstr "Прякорът на човека, който смени темата"

#: src/common/text.c:593 src/common/text.c:599 src/fe-gtk/chanlist.c:599
#: src/fe-gtk/chanlist.c:700
msgid "Topic"
msgstr "Тема"

#: src/common/text.c:594 src/common/text.c:598 src/common/text.c:1032
#: src/fe-gtk/chanlist.c:597 src/fe-gtk/chanlist.c:691
#: src/fe-gtk/ignoregui.c:176
msgid "Channel"
msgstr "Стая"

#: src/common/text.c:603 src/common/text.c:662
msgid "The nickname of the kicker"
msgstr "Прякора на човека, който е изхвърлил някой"

#: src/common/text.c:604 src/common/text.c:660
msgid "The person being kicked"
msgstr "Човека, който е бил изхвърлен от стаята"

#: src/common/text.c:605 src/common/text.c:612 src/common/text.c:616
#: src/common/text.c:621 src/common/text.c:661 src/common/text.c:669
msgid "The channel"
msgstr "Стаята"

#: src/common/text.c:606 src/common/text.c:663 src/common/text.c:670
msgid "The reason"
msgstr "Причината"

#: src/common/text.c:610 src/common/text.c:667
msgid "The nick of the person leaving"
msgstr "Прякорът на човека, който излиза"

#: src/common/text.c:617 src/common/text.c:623
msgid "The time"
msgstr "Времето"

#: src/common/text.c:622
msgid "The creator"
msgstr "Създателят"

#: src/common/text.c:627
msgid "Nick"
msgstr "Прякор"

#: src/common/text.c:628 src/common/text.c:884
msgid "Reason"
msgstr "Причина"

#: src/common/text.c:629 src/common/text.c:776 src/common/text.c:859
msgid "Host"
msgstr "Хост"

#: src/common/text.c:633 src/common/text.c:638 src/common/text.c:643
msgid "Who it's from"
msgstr "От кой е"

#: src/common/text.c:634
msgid "The time in x.x format (see below)"
msgstr "Времето във х.х формат (вижте долу)"

#: src/common/text.c:644 src/common/text.c:686
msgid "The Channel it's going to"
msgstr "Стаята, към която отива"

#: src/common/text.c:674
msgid "The sound"
msgstr "Звукът"

#: src/common/text.c:675 src/common/text.c:680 src/common/text.c:685
msgid "The nick of the person"
msgstr "Прякорът на човека"

#: src/common/text.c:679 src/common/text.c:684
msgid "The CTCP event"
msgstr "CTCP събитието"

#: src/common/text.c:690
msgid "The nick of the person who set the key"
msgstr "Прякорът на човека, който е поставил ключа"

#: src/common/text.c:691
msgid "The key"
msgstr "Ключът"

#: src/common/text.c:695
msgid "The nick of the person who set the limit"
msgstr "Прякора на този, който е настроил лимита"

#: src/common/text.c:696
msgid "The limit"
msgstr "Лимитът"

#: src/common/text.c:700
msgid "The nick of the person who did the op'ing"
msgstr "Прякорът на човека, който е дал операторския статус"

#: src/common/text.c:701
msgid "The nick of the person who has been op'ed"
msgstr "Прякорът на човека, който е получил операторски статус"

#: src/common/text.c:705
msgid "The nick of the person who has been halfop'ed"
msgstr "Прякорът на човека, който е получил полу-операторски статус"

#: src/common/text.c:706
msgid "The nick of the person who did the halfop'ing"
msgstr "Прякора на човека, който е дал полу-операторския статус"

#: src/common/text.c:710
msgid "The nick of the person who did the voice'ing"
msgstr "Прякора на човека, който е дал статус \"Voice\""

#: src/common/text.c:711
msgid "The nick of the person who has been voice'ed"
msgstr "Прякора на човека, който е получил статус \"Voice\""

#: src/common/text.c:715
msgid "The nick of the person who did the banning"
msgstr "Прякора на този, който е сложил забраната"

#: src/common/text.c:716 src/common/text.c:743
msgid "The ban mask"
msgstr "Маската на забраната"

#: src/common/text.c:720
msgid "The nick who removed the key"
msgstr "Прякорът, който е премахнал ключа"

#: src/common/text.c:724
msgid "The nick who removed the limit"
msgstr "Прякорът, който премахва лимита"

#: src/common/text.c:728
msgid "The nick of the person of did the deop'ing"
msgstr "Прякорът на човека, който е махнал операторския статус"

#: src/common/text.c:729
msgid "The nick of the person who has been deop'ed"
msgstr "Прякорът на човека, на който му е бил взет операторския статус"

#: src/common/text.c:732
msgid "The nick of the person of did the dehalfop'ing"
msgstr "Прякорът на човека, който е махнал операторския статус"

#: src/common/text.c:733
msgid "The nick of the person who has been dehalfop'ed"
msgstr "Прякорът на човека, на който му е бил взет полу-операторския статус"

#: src/common/text.c:737
msgid "The nick of the person of did the devoice'ing"
msgstr "Прякорът на човека, който е махнал статуса \"Voice\""

#: src/common/text.c:738
msgid "The nick of the person who has been devoice'ed"
msgstr "Прякорът на човека, на който е бил взет статус \"Voice\""

#: src/common/text.c:742
msgid "The nick of the person of did the unban'ing"
msgstr "Прякорът на човека, който е махнал забраната"

#: src/common/text.c:747
msgid "The nick of the person who did the exempt"
msgstr ""

#: src/common/text.c:748 src/common/text.c:753
msgid "The exempt mask"
msgstr "Маската на exempt статуса"

#: src/common/text.c:752
msgid "The nick of the person removed the exempt"
msgstr ""

#: src/common/text.c:757
msgid "The nick of the person who did the invite"
msgstr "Прякорът на човека, който е отправил поканата"

#: src/common/text.c:758 src/common/text.c:763
msgid "The invite mask"
msgstr "Маската за поканата"

#: src/common/text.c:762
msgid "The nick of the person removed the invite"
msgstr "Прякорът на човека, който е махнал поканата"

#: src/common/text.c:767
msgid "The nick of the person setting the mode"
msgstr "Прякорът на човека, който е настроил режима"

#: src/common/text.c:768
msgid "The mode's sign (+/-)"
msgstr "Знакът на режима (+/-)"

#: src/common/text.c:769
msgid "The mode letter"
msgstr "Буквата на режима"

#: src/common/text.c:770
msgid "The channel it's being set on"
msgstr "Стаята, за която се настройва"

#: src/common/text.c:775
msgid "Username"
msgstr "Потребителско име"

#: src/common/text.c:777
msgid "Full name"
msgstr "Пълно име"

#: src/common/text.c:782
msgid "Channel Membership/\"is an IRC operator\""
msgstr ""

#: src/common/text.c:787
msgid "Server Information"
msgstr "Информация за сървъра"

#: src/common/text.c:792 src/common/text.c:797
msgid "Idle time"
msgstr "Време без активност"

#: src/common/text.c:798
msgid "Signon time"
msgstr "Време на влизане"

#: src/common/text.c:803
msgid "Away reason"
msgstr "Причина за отсъствието"

#: src/common/text.c:812 src/common/text.c:818 src/common/text.c:826
#: src/common/text.c:1004
msgid "Message"
msgstr "Съобщение"

#: src/common/text.c:819
msgid "Account"
msgstr "Абонамент"

#: src/common/text.c:824
msgid "Real user@host"
msgstr "истински потребител@хост"

#: src/common/text.c:825
msgid "Real IP"
msgstr "Истинско IP"

#: src/common/text.c:830 src/common/text.c:839 src/common/text.c:845
#: src/common/text.c:1027
msgid "Channel Name"
msgstr "Име на стаята"

#: src/common/text.c:834 src/common/text.c:990 src/fe-gtk/textgui.c:338
msgid "Text"
msgstr "Текст"

#: src/common/text.c:835 src/common/text.c:841 src/common/text.c:1028
msgid "Server Name"
msgstr "Име на сървъра"

#: src/common/text.c:840
msgid "Nick of person who invited you"
msgstr "Прякора на този, който ви е поканил"

#: src/common/text.c:846 src/fe-gtk/chanlist.c:598
msgid "Users"
msgstr "Потребители"

#: src/common/text.c:850
msgid "Nickname in use"
msgstr "Прякора е зает"

#: src/common/text.c:851
msgid "Nick being tried"
msgstr "Опитва се с този прякор"

#: src/common/text.c:855 src/common/text.c:891 src/common/text.c:902
#: src/common/text.c:909 src/common/text.c:922 src/common/text.c:939
#: src/common/text.c:1039 src/common/util.c:352
msgid "Error"
msgstr "Грешка"

#: src/common/text.c:860 src/common/text.c:994
msgid "IP"
msgstr "IP"

#: src/common/text.c:861 src/common/text.c:890
msgid "Port"
msgstr "Порт"

#: src/common/text.c:865
msgid "PID"
msgstr "PID"

#: src/common/text.c:873
msgid "Channel name"
msgstr "Име на стаята"

#: src/common/text.c:874 src/common/text.c:879
msgid "Modes string"
msgstr ""

#: src/common/text.c:889 src/common/text.c:927 src/common/text.c:932
#: src/common/text.c:973
msgid "IP address"
msgstr "IP адрес"

#: src/common/text.c:895 src/common/text.c:920
msgid "DCC Type"
msgstr "DCC Вид"

#: src/common/text.c:896 src/common/text.c:901 src/common/text.c:906
#: src/common/text.c:913 src/common/text.c:933 src/common/text.c:937
#: src/common/text.c:943 src/common/text.c:949 src/common/text.c:956
#: src/common/text.c:965 src/common/text.c:971
msgid "Filename"
msgstr "Име на файла"

#: src/common/text.c:907 src/common/text.c:914
msgid "Destination filename"
msgstr "Име, под което да се запази файла"

#: src/common/text.c:916 src/common/text.c:945
msgid "CPS"
msgstr "CPS"

#: src/common/text.c:951
msgid "Pathname"
msgstr ""

#: src/common/text.c:966 src/fe-gtk/dccgui.c:518 src/fe-gtk/dccgui.c:676
msgid "Position"
msgstr "Позиция"

#: src/common/text.c:972 src/fe-gtk/dccgui.c:517 src/fe-gtk/dccgui.c:675
msgid "Size"
msgstr "Размер"

#: src/common/text.c:977
msgid "DCC String"
msgstr "DCC низ"

#: src/common/text.c:982
msgid "Number of notify items"
msgstr "Брой на обектите за уведомяване"

#: src/common/text.c:986
msgid "Servername"
msgstr "Име на сървъра"

#: src/common/text.c:998
msgid "Old Filename"
msgstr "Старо име на файла"

#: src/common/text.c:999
msgid "New Filename"
msgstr "Ново име на файла"

#: src/common/text.c:1003
msgid "Receiver"
msgstr "Получател"

#: src/common/text.c:1008
msgid "Hostmask"
msgstr "Хостмаска"

#: src/common/text.c:1013
msgid "Hostname"
msgstr "Име на хоста"

#: src/common/text.c:1018
msgid "The Packet"
msgstr "Пакетът"

#: src/common/text.c:1022
msgid "Seconds"
msgstr "Секунди"

#: src/common/text.c:1026
msgid "Nick of person who have been invited"
msgstr "Прякор на човека, който е поканен"

#: src/common/text.c:1033
msgid "Banmask"
msgstr "Маска на забраната"

#: src/common/text.c:1034
msgid "Who set the ban"
msgstr "Кой е настроил бана"

#: src/common/text.c:1035
msgid "Ban time"
msgstr "Време на забраната"

#: src/common/text.c:1075
#, c-format
msgid ""
"Error parsing event %s.\n"
"Loading default."
msgstr ""

#: src/common/text.c:1713
#, c-format
msgid ""
"Cannot read sound file:\n"
"%s"
msgstr ""
"Звуковият файл не може да бъде прочетен:\n"
"%s"

#: src/common/util.c:296
msgid "Remote host closed socket"
msgstr ""

#: src/common/util.c:301
msgid "Connection refused"
msgstr "Връзката отказана"

#: src/common/util.c:304
msgid "No route to host"
msgstr "Няма път то хоста"

#: src/common/util.c:306
msgid "Connection timed out"
msgstr "Връзката се разпадна (Connection timed out)"

#: src/common/util.c:308
msgid "Cannot assign that address"
msgstr "Не може да се назначи този адрес"

#: src/common/util.c:310
msgid "Connection reset by peer"
msgstr ""

#: src/common/util.c:821
msgid "Andorra"
msgstr "Андора"

#: src/common/util.c:822
msgid "United Arab Emirates"
msgstr "ОАЕ"

#: src/common/util.c:823
msgid "Afghanistan"
msgstr "Афганистан"

#: src/common/util.c:824
msgid "Antigua and Barbuda"
msgstr "Атигуа и Барбуда"

#: src/common/util.c:825
msgid "Anguilla"
msgstr "Ангила"

#: src/common/util.c:826
msgid "Albania"
msgstr "Албания"

#: src/common/util.c:827
msgid "Armenia"
msgstr "Армения"

#: src/common/util.c:828
msgid "Netherlands Antilles"
msgstr "Холандски антили"

#: src/common/util.c:829
msgid "Angola"
msgstr "Ангола"

#: src/common/util.c:830
msgid "Antarctica"
msgstr "Антарктика"

#: src/common/util.c:831
msgid "Argentina"
msgstr "Аржентина"

#: src/common/util.c:832
msgid "Reverse DNS"
msgstr ""

#: src/common/util.c:833
msgid "American Samoa"
msgstr "Американска Самоа"

#: src/common/util.c:834
msgid "Austria"
msgstr "Австрия"

#: src/common/util.c:835
msgid "Nato Fiel"
msgstr "НАТО"

#: src/common/util.c:836
msgid "Australia"
msgstr "Австралия"

#: src/common/util.c:837
msgid "Aruba"
msgstr "Аруба"

#: src/common/util.c:838
msgid "Azerbaijan"
msgstr "Азербайджан"

#: src/common/util.c:839
msgid "Bosnia and Herzegovina"
msgstr "Босна и Херцеговина"

#: src/common/util.c:840
msgid "Barbados"
msgstr "Барбадос"

#: src/common/util.c:841
msgid "Bangladesh"
msgstr "Бангладеш"

#: src/common/util.c:842
msgid "Belgium"
msgstr "Белгия"

#: src/common/util.c:843
msgid "Burkina Faso"
msgstr "Буркина Фасо"

#: src/common/util.c:844
msgid "Bulgaria"
msgstr "България"

#: src/common/util.c:845
msgid "Bahrain"
msgstr "Бахрейн"

#: src/common/util.c:846
msgid "Burundi"
msgstr "Бурунди"

#: src/common/util.c:847
msgid "Businesses"
msgstr "Бизнеси"

#: src/common/util.c:848
msgid "Benin"
msgstr "Бенин"

#: src/common/util.c:849
msgid "Bermuda"
msgstr "Бермуда"

#: src/common/util.c:850
msgid "Brunei Darussalam"
msgstr "Бруней Дарусалам"

#: src/common/util.c:851
msgid "Bolivia"
msgstr "Боливия"

#: src/common/util.c:852
msgid "Brazil"
msgstr "Бразилия"

#: src/common/util.c:853
msgid "Bahamas"
msgstr "Бахамите"

#: src/common/util.c:854
msgid "Bhutan"
msgstr "Бутан"

#: src/common/util.c:855
msgid "Bouvet Island"
msgstr "Острови Буве"

#: src/common/util.c:856
msgid "Botswana"
msgstr "Ботсвана"

#: src/common/util.c:857
msgid "Belarus"
msgstr "Беларус"

#: src/common/util.c:858
msgid "Belize"
msgstr "Белиз"

#: src/common/util.c:859
msgid "Canada"
msgstr "Канада"

#: src/common/util.c:860
msgid "Cocos Islands"
msgstr "Кокосови острови"

#: src/common/util.c:861
msgid "Democratic Republic of Congo"
msgstr "Демократична република Конго"

#: src/common/util.c:862
msgid "Central African Republic"
msgstr "Централна Африканска Република"

#: src/common/util.c:863
msgid "Congo"
msgstr "Конго"

#: src/common/util.c:864
msgid "Switzerland"
msgstr "Швейцария"

#: src/common/util.c:865
msgid "Cote d'Ivoire"
msgstr "Кот Д'Ивоар"

#: src/common/util.c:866
msgid "Cook Islands"
msgstr "Островите Кук"

#: src/common/util.c:867
msgid "Chile"
msgstr "Чили"

#: src/common/util.c:868
msgid "Cameroon"
msgstr "Камерун"

#: src/common/util.c:869
msgid "China"
msgstr "Китай"

#: src/common/util.c:870
msgid "Colombia"
msgstr "Колумбия"

#: src/common/util.c:871
msgid "Internic Commercial"
msgstr "Интерник Комерсиален"

#: src/common/util.c:872
msgid "Costa Rica"
msgstr "Коста Рика"

#: src/common/util.c:873
msgid "Serbia and Montenegro"
msgstr "Сърбия и Черна гора"

#: src/common/util.c:874
msgid "Cuba"
msgstr "Куба"

#: src/common/util.c:875
msgid "Cape Verde"
msgstr "Капе Верде"

#: src/common/util.c:876
msgid "Christmas Island"
msgstr "Коледния остров"

#: src/common/util.c:877
msgid "Cyprus"
msgstr "Кипър"

#: src/common/util.c:878
msgid "Czech Republic"
msgstr "Чехия"

#: src/common/util.c:879
msgid "Germany"
msgstr "Германия"

#: src/common/util.c:880
msgid "Djibouti"
msgstr "Джибути"

#: src/common/util.c:881
msgid "Denmark"
msgstr "Дания"

#: src/common/util.c:882
msgid "Dominica"
msgstr "Доминика"

#: src/common/util.c:883
msgid "Dominican Republic"
msgstr "Доминиканската република"

#: src/common/util.c:884
msgid "Algeria"
msgstr "Алжир"

#: src/common/util.c:885
msgid "Ecuador"
msgstr "Еквадор"

#: src/common/util.c:886
msgid "Educational Institution"
msgstr "Образователна институция"

#: src/common/util.c:887
msgid "Estonia"
msgstr "Естония"

#: src/common/util.c:888
msgid "Egypt"
msgstr "Египет"

#: src/common/util.c:889
msgid "Western Sahara"
msgstr "Задана сахара"

#: src/common/util.c:890
msgid "Eritrea"
msgstr "Еритрея"

#: src/common/util.c:891
msgid "Spain"
msgstr "Испания"

#: src/common/util.c:892
msgid "Ethiopia"
msgstr "Етиопия"

#: src/common/util.c:893
msgid "Finland"
msgstr "Финландия"

#: src/common/util.c:894
msgid "Fiji"
msgstr "Фиджи"

#: src/common/util.c:895
msgid "Falkland Islands"
msgstr "Фолкландските острови"

#: src/common/util.c:896
msgid "Micronesia"
msgstr "Микронезия"

#: src/common/util.c:897
msgid "Faroe Islands"
msgstr "Фарьорските острови"

#: src/common/util.c:898
msgid "France"
msgstr "Франция"

#: src/common/util.c:899
msgid "France, Metropolitan"
msgstr "Франция, метрополитан"

#: src/common/util.c:900
msgid "Gabon"
msgstr "Габон"

#: src/common/util.c:901
msgid "Great Britain"
msgstr "Великобритания"

#: src/common/util.c:902
msgid "Grenada"
msgstr "Гренада"

#: src/common/util.c:903
msgid "Georgia"
msgstr "Грузия"

#: src/common/util.c:904
msgid "French Guiana"
msgstr "Френска Гвиана"

#: src/common/util.c:905
msgid "British Channel Isles"
msgstr "О-ви при Британския канал"

#: src/common/util.c:906
msgid "Ghana"
msgstr "Гана"

#: src/common/util.c:907
msgid "Gibraltar"
msgstr "Гибралтар"

#: src/common/util.c:908
msgid "Greenland"
msgstr "Гренландия"

#: src/common/util.c:909
msgid "Gambia"
msgstr "Гамбия"

#: src/common/util.c:910
msgid "Guinea"
msgstr "Гвинея"

#: src/common/util.c:911
msgid "Government"
msgstr "Правителствен"

#: src/common/util.c:912
msgid "Guadeloupe"
msgstr "Гваделупа"

#: src/common/util.c:913
msgid "Equatorial Guinea"
msgstr "Екваториалня Гвинея"

#: src/common/util.c:914
msgid "Greece"
msgstr "Гърция"

#: src/common/util.c:915
msgid "S. Georgia and S. Sandwich Isles"
msgstr "Св. Джорджия и Св. Сандичеви о-ви"

#: src/common/util.c:916
msgid "Guatemala"
msgstr "Гватемала"

#: src/common/util.c:917
msgid "Guam"
msgstr "Гуам"

#: src/common/util.c:918
msgid "Guinea-Bissau"
msgstr "Гвинея-Бисау"

#: src/common/util.c:919
msgid "Guyana"
msgstr "Гияна"

#: src/common/util.c:920
msgid "Hong Kong"
msgstr "Хонг Конг"

#: src/common/util.c:921
msgid "Heard and McDonald Islands"
msgstr "Хърд и Макдоналдови о-ви"

#: src/common/util.c:922
msgid "Honduras"
msgstr "Хондурас"

#: src/common/util.c:923
msgid "Croatia"
msgstr "Хърватска"

#: src/common/util.c:924
msgid "Haiti"
msgstr "Хаити"

#: src/common/util.c:925
msgid "Hungary"
msgstr "Унгария"

#: src/common/util.c:926
msgid "Indonesia"
msgstr "Индонезия"

#: src/common/util.c:927
msgid "Ireland"
msgstr "Ирландия"

#: src/common/util.c:928
msgid "Israel"
msgstr "Израел"

#: src/common/util.c:929
msgid "India"
msgstr "Индия"

#: src/common/util.c:930
msgid "Informational"
msgstr "Информационен"

#: src/common/util.c:931
msgid "International"
msgstr "Международен"

#: src/common/util.c:932
msgid "British Indian Ocean Territory"
msgstr "Британска територия в Индийския океан"

#: src/common/util.c:933
msgid "Iraq"
msgstr "Ирак"

#: src/common/util.c:934
msgid "Iran"
msgstr "Иран"

#: src/common/util.c:935
msgid "Iceland"
msgstr "Исландия"

#: src/common/util.c:936
msgid "Italy"
msgstr "Италия"

#: src/common/util.c:937
msgid "Jamaica"
msgstr "Ямайка"

#: src/common/util.c:938
msgid "Jordan"
msgstr "Йордания"

#: src/common/util.c:939
msgid "Japan"
msgstr "Япония"

#: src/common/util.c:940
msgid "Kenya"
msgstr "Кения"

#: src/common/util.c:941
msgid "Kyrgyzstan"
msgstr "Киргистан"

#: src/common/util.c:942
msgid "Cambodia"
msgstr "Камбоджа"

#: src/common/util.c:943
msgid "Kiribati"
msgstr "Кирибати"

#: src/common/util.c:944
msgid "Comoros"
msgstr "Коморос"

#: src/common/util.c:945
msgid "St. Kitts and Nevis"
msgstr "Св. Китс и Невис"

#: src/common/util.c:946
msgid "North Korea"
msgstr "Северна Корея"

#: src/common/util.c:947
msgid "South Korea"
msgstr "Южна Корея"

#: src/common/util.c:948
msgid "Kuwait"
msgstr "Кувейт"

#: src/common/util.c:949
msgid "Cayman Islands"
msgstr "Каймановите острови"

#: src/common/util.c:950
msgid "Kazakhstan"
msgstr "Казакстан"

#: src/common/util.c:951
msgid "Laos"
msgstr "Лаос"

#: src/common/util.c:952
msgid "Lebanon"
msgstr "Ливан"

#: src/common/util.c:953
msgid "Saint Lucia"
msgstr "Св. Лучия"

#: src/common/util.c:954
msgid "Liechtenstein"
msgstr "Лихтенщайн"

#: src/common/util.c:955
msgid "Sri Lanka"
msgstr "Шри Ланка"

#: src/common/util.c:956
msgid "Liberia"
msgstr "Либерия"

#: src/common/util.c:957
msgid "Lesotho"
msgstr "Лесото"

#: src/common/util.c:958
msgid "Lithuania"
msgstr "Литва"

#: src/common/util.c:959
msgid "Luxembourg"
msgstr "Люксембург"

#: src/common/util.c:960
msgid "Latvia"
msgstr "Латвия"

#: src/common/util.c:961
msgid "Libya"
msgstr "Либия"

#: src/common/util.c:962
msgid "Morocco"
msgstr "Мароко"

#: src/common/util.c:963
msgid "Monaco"
msgstr "Монако"

#: src/common/util.c:964
msgid "Moldova"
msgstr "Молдова"

#: src/common/util.c:965
msgid "United States Medical"
msgstr "Медицински САЩ"

#: src/common/util.c:966
msgid "Madagascar"
msgstr "Мадагаскар"

#: src/common/util.c:967
msgid "Marshall Islands"
msgstr "Маршаловите острови"

#: src/common/util.c:968
msgid "Military"
msgstr "Военен"

#: src/common/util.c:969
msgid "Macedonia"
msgstr "Македония"

#: src/common/util.c:970
msgid "Mali"
msgstr "Мали"

#: src/common/util.c:971
msgid "Myanmar"
msgstr "Мианмар"

#: src/common/util.c:972
msgid "Mongolia"
msgstr "Монголия"

#: src/common/util.c:973
msgid "Macau"
msgstr "Макао"

#: src/common/util.c:974
msgid "Northern Mariana Islands"
msgstr "Северни Мариански острови"

#: src/common/util.c:975
msgid "Martinique"
msgstr "Мартиника"

#: src/common/util.c:976
msgid "Mauritania"
msgstr "Мавритания"

#: src/common/util.c:977
msgid "Montserrat"
msgstr "Монсера"

#: src/common/util.c:978
msgid "Malta"
msgstr "Малта"

#: src/common/util.c:979
msgid "Mauritius"
msgstr "Маврициус"

#: src/common/util.c:980
msgid "Maldives"
msgstr "Малдивите"

#: src/common/util.c:981
msgid "Malawi"
msgstr "Малави"

#: src/common/util.c:982
msgid "Mexico"
msgstr "Мексико"

#: src/common/util.c:983
msgid "Malaysia"
msgstr "Малайзия"

#: src/common/util.c:984
msgid "Mozambique"
msgstr "Мозамбик"

#: src/common/util.c:985
msgid "Namibia"
msgstr "Намибия"

#: src/common/util.c:986
msgid "New Caledonia"
msgstr "Нова Каледония"

#: src/common/util.c:987
msgid "Niger"
msgstr "Нигер"

#: src/common/util.c:988
msgid "Internic Network"
msgstr "Мрежата на InterNIC"

#: src/common/util.c:989
msgid "Norfolk Island"
msgstr "Норфолксите острови"

#: src/common/util.c:990
msgid "Nigeria"
msgstr "Нигерия"

#: src/common/util.c:991
msgid "Nicaragua"
msgstr "Никарагуа"

#: src/common/util.c:992
msgid "Netherlands"
msgstr "Холандия"

#: src/common/util.c:993
msgid "Norway"
msgstr "Норвегия"

#: src/common/util.c:994
msgid "Nepal"
msgstr "Непал"

#: src/common/util.c:995
msgid "Nauru"
msgstr "Науру"

#: src/common/util.c:996
msgid "Neutral Zone"
msgstr "Неутрална зона"

#: src/common/util.c:997
msgid "Niue"
msgstr "Niue"

#: src/common/util.c:998
msgid "New Zealand"
msgstr "Нова Зеландия"

#: src/common/util.c:999
msgid "Oman"
msgstr "Оман"

#: src/common/util.c:1000
msgid "Internic Non-Profit Organization"
msgstr "InterNIC огранизация с идеална цел"

#: src/common/util.c:1001
msgid "Panama"
msgstr "Панама"

#: src/common/util.c:1002
msgid "Peru"
msgstr "Перу"

#: src/common/util.c:1003
msgid "French Polynesia"
msgstr "Френска полинезия"

#: src/common/util.c:1004
msgid "Papua New Guinea"
msgstr "Папуа Нова Гвинея"

#: src/common/util.c:1005
msgid "Philippines"
msgstr "Филипините"

#: src/common/util.c:1006
msgid "Pakistan"
msgstr "Пакистан"

#: src/common/util.c:1007
msgid "Poland"
msgstr "Полша"

#: src/common/util.c:1008
msgid "St. Pierre and Miquelon"
msgstr "Св. Пиер и Микелон"

#: src/common/util.c:1009
msgid "Pitcairn"
msgstr "Pitcairn"

#: src/common/util.c:1010
msgid "Puerto Rico"
msgstr "Пуерто Рико"

#: src/common/util.c:1011
msgid "Palestinian Territory"
msgstr "Палестински територии"

#: src/common/util.c:1012
msgid "Portugal"
msgstr "Португалия"

#: src/common/util.c:1013
msgid "Palau"
msgstr "Палау"

#: src/common/util.c:1014
msgid "Paraguay"
msgstr "Парагвай"

#: src/common/util.c:1015
msgid "Qatar"
msgstr "Катар"

#: src/common/util.c:1016
msgid "Reunion"
msgstr "Reunion"

#: src/common/util.c:1017
msgid "Romania"
msgstr "Румъния"

#: src/common/util.c:1018
msgid "Old School ARPAnet"
msgstr "Old School ARPAnet"

#: src/common/util.c:1019
msgid "Russian Federation"
msgstr "Руската федерация"

#: src/common/util.c:1020
msgid "Rwanda"
msgstr "Руанда"

#: src/common/util.c:1021
msgid "Saudi Arabia"
msgstr "Саудитска Арабия"

#: src/common/util.c:1022
msgid "Solomon Islands"
msgstr "Соломоновите острови"

#: src/common/util.c:1023
msgid "Seychelles"
msgstr "Сейшелските острови"

#: src/common/util.c:1024
msgid "Sudan"
msgstr "Судан"

#: src/common/util.c:1025
msgid "Sweden"
msgstr "Швеция"

#: src/common/util.c:1026
msgid "Singapore"
msgstr "Сингапур"

#: src/common/util.c:1027
msgid "St. Helena"
msgstr "Св. Елена"

#: src/common/util.c:1028
msgid "Slovenia"
msgstr "Словения"

#: src/common/util.c:1029
msgid "Svalbard and Jan Mayen Islands"
msgstr "О-ви Свалбард и Ян Майен"

#: src/common/util.c:1030
msgid "Slovak Republic"
msgstr "Словакия"

#: src/common/util.c:1031
msgid "Sierra Leone"
msgstr "Сиера Леоне"

#: src/common/util.c:1032
msgid "San Marino"
msgstr "Сан Марино"

#: src/common/util.c:1033
msgid "Senegal"
msgstr "Сенегал"

#: src/common/util.c:1034
msgid "Somalia"
msgstr "Сомалия"

#: src/common/util.c:1035
msgid "Suriname"
msgstr "Суринам"

#: src/common/util.c:1036
msgid "Sao Tome and Principe"
msgstr "Сао Томе и Принцип"

#: src/common/util.c:1037
msgid "Former USSR"
msgstr "Бившият СССР"

#: src/common/util.c:1038
msgid "El Salvador"
msgstr "Ел Салвадор"

#: src/common/util.c:1039
msgid "Syria"
msgstr "Сирия"

#: src/common/util.c:1040
msgid "Swaziland"
msgstr "Свазиленд"

#: src/common/util.c:1041
msgid "Turks and Caicos Islands"
msgstr "Турски и Кайко о-ви"

#: src/common/util.c:1042
msgid "Chad"
msgstr "Чад"

#: src/common/util.c:1043
msgid "French Southern Territories"
msgstr "Френски южни територии"

#: src/common/util.c:1044
msgid "Togo"
msgstr "Того"

#: src/common/util.c:1045
msgid "Thailand"
msgstr "Тайланд"

#: src/common/util.c:1046
msgid "Tajikistan"
msgstr "Таджикистан"

#: src/common/util.c:1047
msgid "Tokelau"
msgstr "Токелау"

#: src/common/util.c:1048
msgid "Turkmenistan"
msgstr "Туркменистан"

#: src/common/util.c:1049
msgid "Tunisia"
msgstr "Тунис"

#: src/common/util.c:1050
msgid "Tonga"
msgstr "Тонга"

#: src/common/util.c:1051
msgid "East Timor"
msgstr "Източен Тимор"

#: src/common/util.c:1052
msgid "Turkey"
msgstr "Турция"

#: src/common/util.c:1053
msgid "Trinidad and Tobago"
msgstr "Тринидад и Тобаго"

#: src/common/util.c:1054
msgid "Tuvalu"
msgstr "Тувалу"

#: src/common/util.c:1055
msgid "Taiwan"
msgstr "Тайван"

#: src/common/util.c:1056
msgid "Tanzania"
msgstr "Танзания"

#: src/common/util.c:1057
msgid "Ukraine"
msgstr "Украйна"

#: src/common/util.c:1058
msgid "Uganda"
msgstr "Уганда"

#: src/common/util.c:1059
msgid "United Kingdom"
msgstr "Обединеното Кралство"

#: src/common/util.c:1060
msgid "US Minor Outlying Islands"
msgstr "О-ви под американско управление"

#: src/common/util.c:1061
msgid "United States of America"
msgstr "САЩ"

#: src/common/util.c:1062
msgid "Uruguay"
msgstr "Уругвай"

#: src/common/util.c:1063
msgid "Uzbekistan"
msgstr "Узбекистан"

#: src/common/util.c:1064
msgid "Vatican City State"
msgstr "Ватикана"

#: src/common/util.c:1065
msgid "St. Vincent and the Grenadines"
msgstr "Св. Винсент и гренадините"

#: src/common/util.c:1066
msgid "Venezuela"
msgstr "Венецуела"

#: src/common/util.c:1067
msgid "British Virgin Islands"
msgstr "Британските Вирджински острови"

#: src/common/util.c:1068
msgid "US Virgin Islands"
msgstr "Американските Вирджински острови"

#: src/common/util.c:1069
msgid "Vietnam"
msgstr "Виетнам"

#: src/common/util.c:1070
msgid "Vanuatu"
msgstr "Вануату"

#: src/common/util.c:1071
msgid "Wallis and Futuna Islands"
msgstr "Wallis and Futuna Islands"

#: src/common/util.c:1072
msgid "Samoa"
msgstr "Самоа"

#: src/common/util.c:1073
msgid "Yemen"
msgstr "Йемен"

#: src/common/util.c:1074
msgid "Mayotte"
msgstr "Майот"

#: src/common/util.c:1075
msgid "Yugoslavia"
msgstr "Югославия"

#: src/common/util.c:1076
msgid "South Africa"
msgstr "Южна Африка"

#: src/common/util.c:1077
msgid "Zambia"
msgstr "Замбия"

#: src/common/util.c:1078
msgid "Zimbabwe"
msgstr "Зимбабве"

#: src/common/util.c:1088 src/common/util.c:1098 src/fe-gtk/menu.c:478
#: src/fe-gtk/menu.c:482 src/fe-gtk/menu.c:486 src/fe-gtk/menu.c:490
#: src/fe-gtk/menu.c:494
msgid "Unknown"
msgstr "Непознат"

#: src/common/xchat.c:929
msgid "Direct client-to-client"
msgstr "Директна връзка клиент-клиент"

#: src/common/xchat.c:930
msgid "Send File"
msgstr "Изпращане файл"

#: src/common/xchat.c:931
msgid "Offer Chat"
msgstr "Предлагане на чат"

#: src/common/xchat.c:932
msgid "Abort Chat"
msgstr "Отказване на разговор"

#: src/common/xchat.c:933 src/fe-gtk/plugingui.c:73
msgid "Version"
msgstr "Версия"

#: src/common/xchat.c:934
msgid "Userinfo"
msgstr "Информация за потребител"

#: src/common/xchat.c:935
msgid "Clientinfo"
msgstr "Информация за програма"

#: src/common/xchat.c:936 src/common/xchat.c:970 src/common/xchat.c:1021
msgid "Ping"
msgstr "Пинг"

#: src/common/xchat.c:937
msgid "Time"
msgstr "Време"

#: src/common/xchat.c:938
msgid "Finger"
msgstr "Finger"

#: src/common/xchat.c:939
msgid "Oper"
msgstr "Оператор"

#: src/common/xchat.c:940
msgid "Kill this user"
msgstr "Убиване на този потребител"

#: src/common/xchat.c:941
msgid "Mode"
msgstr "Режим"

#: src/common/xchat.c:942
msgid "Give Ops"
msgstr "Даване на операторски статус"

#: src/common/xchat.c:943
msgid "Take Ops"
msgstr "Взимане на операторски статус"

#: src/common/xchat.c:944
msgid "Give Half-Ops"
msgstr ""
"Даване на полу-\n"
"операторски статус"

#: src/common/xchat.c:945
msgid "Take Half-Ops"
msgstr ""
"Взимане на полу-\n"
"операторски статус"

#: src/common/xchat.c:946
msgid "Give Voice"
msgstr "Даване на Voice статус"

#: src/common/xchat.c:947
msgid "Take Voice"
msgstr "Взимане на Voice статус"

#: src/common/xchat.c:948
msgid "Ignore"
msgstr "Игнориране"

#: src/common/xchat.c:949
msgid "Ignore User"
msgstr "Игнориране на потребител"

#: src/common/xchat.c:950
msgid "UnIgnore User"
msgstr "Премахване на игнорирането"

#: src/common/xchat.c:951
msgid "Kick/Ban"
msgstr "Изхвърляне/Забрана"

#: src/common/xchat.c:952 src/common/xchat.c:1004
msgid "Kick"
msgstr "Изхвърляне"

#: src/common/xchat.c:953 src/common/xchat.c:954 src/common/xchat.c:955
#: src/common/xchat.c:956 src/common/xchat.c:957 src/common/xchat.c:1003
msgid "Ban"
msgstr "Забрана"

#: src/common/xchat.c:958 src/common/xchat.c:959 src/common/xchat.c:960
#: src/common/xchat.c:961
msgid "KickBan"
msgstr "Изхвърляне и Забрана"

#: src/common/xchat.c:962 src/fe-gtk/dccgui.c:564 src/fe-gtk/dccgui.c:712
msgid "Info"
msgstr "Информация"

#: src/common/xchat.c:963
msgid "Who"
msgstr "Who"

#: src/common/xchat.c:964 src/common/xchat.c:1017
msgid "WhoIs"
msgstr "Кой е ...?"

#: src/common/xchat.c:965
msgid "DNS Lookup"
msgstr ""

#: src/common/xchat.c:966
msgid "Trace"
msgstr "Trace"

#: src/common/xchat.c:967
msgid "UserHost"
msgstr "Хост на потребителя"

#: src/common/xchat.c:968
msgid "External"
msgstr "Външни"

#: src/common/xchat.c:969
msgid "Traceroute"
msgstr "Traceroute"

#: src/common/xchat.c:971
msgid "Telnet"
msgstr "Telnet"

#: src/common/xchat.c:972
msgid "Open Dialog Window"
msgstr "Започване на разговор"

#: src/common/xchat.c:984
msgid "Disconnect"
msgstr "Прекъсване на връзката"

#: src/common/xchat.c:985
msgid "Reconnect"
msgstr "Свързване наново"

#: src/common/xchat.c:986
msgid "Leave Channel"
msgstr "Напускане на стаята"

#: src/common/xchat.c:987
msgid "Join Channel..."
msgstr "Влизане в стая ..."

#: src/common/xchat.c:988
msgid "Enter Channel to Join:"
msgstr "Въведете име на стая:"

#: src/common/xchat.c:989
msgid "Server Links"
msgstr "Сървърни връзки"

#: src/common/xchat.c:990
msgid "Ping Server"
msgstr "Пингване на сървър"

#: src/common/xchat.c:991
msgid "Hide Version"
msgstr "Скриване на версията"

#: src/common/xchat.c:1001
msgid "Op"
msgstr "Даване на оп. статус"

#: src/common/xchat.c:1002
msgid "DeOp"
msgstr "Взимане на оп. статус"

#: src/common/xchat.c:1005
msgid "bye"
msgstr "чао"

#: src/common/xchat.c:1006
#, c-format
msgid "Enter reason to kick %s:"
msgstr "Причина за изхвърлянето на %s:"

#: src/common/xchat.c:1007
msgid "Sendfile"
msgstr "Изпращане на файл"

#: src/common/xchat.c:1008
msgid "Dialog"
msgstr "Разговор"

#: src/common/xchat.c:1018
msgid "Send"
msgstr "Изпращане"

#: src/common/xchat.c:1019
msgid "Chat"
msgstr "Разговор"

#: src/common/xchat.c:1020 src/fe-gtk/banlist.c:319 src/fe-gtk/ignoregui.c:388
#: src/fe-gtk/search.c:117 src/fe-gtk/urlgrab.c:200
msgid "Clear"
msgstr "Изчистване"

#: src/fe-gtk/about.c:102
msgid "About X-Chat"
msgstr "Относно X-Chat"

#: src/fe-gtk/about.c:124
msgid "A multiplatform IRC Client"
msgstr "Мултиплатформен IRC клиент"

#: src/fe-gtk/ascii.c:131
msgid "Character Chart"
msgstr "Таблица със символи"

#: src/fe-gtk/banlist.c:153 src/fe-gtk/banlist.c:237
msgid "You must select some bans."
msgstr "Трябва да изберете някои забрани."

#: src/fe-gtk/banlist.c:253 src/fe-gtk/ignoregui.c:175
msgid "Mask"
msgstr "Маска"

#: src/fe-gtk/banlist.c:254 src/fe-gtk/dccgui.c:520
msgid "From"
msgstr "От"

#: src/fe-gtk/banlist.c:255
msgid "Date"
msgstr "Дата"

#: src/fe-gtk/banlist.c:299
#, c-format
msgid "X-Chat: Ban List (%s)"
msgstr "X-Chat:·Списък със забранени адреси·(%s)"

#: src/fe-gtk/banlist.c:315
msgid "Unban"
msgstr "Махане на забрана"

#: src/fe-gtk/banlist.c:317
msgid "Crop"
msgstr "Изрязване"

#: src/fe-gtk/banlist.c:321
msgid "Refresh"
msgstr "Опресняване"

#: src/fe-gtk/chanlist.c:120
#, c-format
msgid "User and Channel Statistics: %d/%d Users on %d/%d Channels"
msgstr "Статистика за потребители и стаи: %d/%d Потребителя в %d/%d стаи"

#: src/fe-gtk/chanlist.c:536
msgid "I can't save an empty list!"
msgstr "Не може списъка да е празен!"

#: src/fe-gtk/chanlist.c:539 src/fe-gtk/menu.c:924
msgid "Select an output filename"
msgstr "Изберете изходно файлово име"

#: src/fe-gtk/chanlist.c:607
#, c-format
msgid "X-Chat: Channel List (%s)"
msgstr "X-Chat: Списък с стаите (%s)"

#: src/fe-gtk/chanlist.c:622
msgid "List display options:"
msgstr ""

#: src/fe-gtk/chanlist.c:634
msgid "Minimum Users:"
msgstr "Минимум потребители:"

#: src/fe-gtk/chanlist.c:649
msgid "Maximum Users:"
msgstr "Максимум потребители:"

#: src/fe-gtk/chanlist.c:664
msgid "Regex Match:"
msgstr ""

#: src/fe-gtk/chanlist.c:685
msgid "Apply Match to:"
msgstr "Прилагане на съвпаденията към:"

#: src/fe-gtk/chanlist.c:709
msgid "Apply"
msgstr "Прилагане"

#: src/fe-gtk/chanlist.c:751
msgid "Refresh the list"
msgstr "Опресняване на списъка"

#: src/fe-gtk/chanlist.c:753
msgid "Save the list"
msgstr "Записване на списъка"

#: src/fe-gtk/chanlist.c:755 src/fe-gtk/menu.c:721
msgid "Join Channel"
msgstr "Влизане в стая"

#: src/fe-gtk/dccgui.c:126
#, c-format
msgid "Send file to %s"
msgstr "Изпращане на файл на %s"

#: src/fe-gtk/dccgui.c:346
#, c-format
msgid ""
"      File: %s\n"
"   To/From: %s\n"
"      Size: %u\n"
"      Port: %d\n"
" IP Number: %s\n"
"Start Time: %s   Max CPS: %d\n"
msgstr ""
"      Файл: %s\n"
"   До/От: %s\n"
"      Размер: %u\n"
"      Порт: %d\n"
" IP Номер: %s\n"
"Време на начало: %s   Max CPS: %d\n"

#: src/fe-gtk/dccgui.c:379
msgid "That file is not resumable."
msgstr "Приемането на файла не може да бъде продължено."

#: src/fe-gtk/dccgui.c:383
#, c-format
msgid ""
"Cannot access file: %s\n"
"%s.\n"
"Resuming not possible."
msgstr ""
"Няма достъп до файл: %s\n"
"%s.\n"
"Продължаването не възможно."

#: src/fe-gtk/dccgui.c:390
msgid "File in download directory is larger than file offered. Resuming not possible."
msgstr "Файлът в папката за сваляне и по-голям от предлагания файл. Продължаването не е възможно."

#: src/fe-gtk/dccgui.c:394
msgid "Cannot resume the same file from two people."
msgstr "Не може да се продължава същия файл от различни хора."

#: src/fe-gtk/dccgui.c:509
msgid "MIME Type"
msgstr "MIME Вид"

#: src/fe-gtk/dccgui.c:515 src/fe-gtk/dccgui.c:673 src/fe-gtk/dccgui.c:796
#: src/fe-gtk/notifygui.c:110
msgid "Status"
msgstr "Статус"

#: src/fe-gtk/dccgui.c:516 src/fe-gtk/dccgui.c:674 src/fe-gtk/plugingui.c:74
msgid "File"
msgstr "Файл"

#: src/fe-gtk/dccgui.c:519 src/fe-gtk/dccgui.c:678
msgid "ETA"
msgstr ""

#: src/fe-gtk/dccgui.c:529
msgid "X-Chat: File Receive List"
msgstr "X-Chat: Списък с приеманите файлове"

#: src/fe-gtk/dccgui.c:558 src/fe-gtk/dccgui.c:711 src/fe-gtk/dccgui.c:826
msgid "Abort"
msgstr "Прекъсване"

#: src/fe-gtk/dccgui.c:560 src/fe-gtk/dccgui.c:827
msgid "Accept"
msgstr "Приемане"

#: src/fe-gtk/dccgui.c:562
msgid "Resume"
msgstr "Продължаване"

#: src/fe-gtk/dccgui.c:566
msgid "Open"
msgstr "Отваряне"

#: src/fe-gtk/dccgui.c:677
msgid "Ack"
msgstr ""

#: src/fe-gtk/dccgui.c:679
msgid "To"
msgstr "До"

#: src/fe-gtk/dccgui.c:689
msgid "X-Chat: File Send List"
msgstr "X-Chat: Списък с изпращаните файлове"

#: src/fe-gtk/dccgui.c:797
msgid "To/From"
msgstr "До/От"

#: src/fe-gtk/dccgui.c:798
msgid "Recv"
msgstr ""

#: src/fe-gtk/dccgui.c:799
msgid "Sent"
msgstr "Изпратено"

#: src/fe-gtk/dccgui.c:800
msgid "StartTime"
msgstr "Време на начало"

#: src/fe-gtk/dccgui.c:810
msgid "X-Chat: DCC Chat List"
msgstr "X-Chat: Списък с разговорите клиент-клиент"

#: src/fe-gtk/editlist.c:139
msgid "*NEW*"
msgstr "*НОВО*"

#: src/fe-gtk/editlist.c:140
msgid "EDIT ME"
msgstr "РЕДАКТИРАЙ МЕ"

#: src/fe-gtk/editlist.c:305 src/fe-gtk/plugingui.c:72
msgid "Name"
msgstr "Име"

#: src/fe-gtk/editlist.c:306
msgid "Command"
msgstr "Команда"

#: src/fe-gtk/editlist.c:333
msgid "Move Up"
msgstr "Преместване нагоре"

#: src/fe-gtk/editlist.c:337
msgid "Move Dn"
msgstr "Преместване надолу"

#: src/fe-gtk/editlist.c:345
msgid "Cancel"
msgstr "Отмяна"

#: src/fe-gtk/editlist.c:349 src/fe-gtk/textgui.c:413 src/fe-gtk/urlgrab.c:204
msgid "Save"
msgstr "Запазване"

#: src/fe-gtk/editlist.c:357
msgid "Add New"
msgstr "Добавяне на ново"

#: src/fe-gtk/editlist.c:361 src/fe-gtk/fkeys.c:751 src/fe-gtk/ignoregui.c:386
msgid "Delete"
msgstr "Изтриване"

#: src/fe-gtk/editlist.c:369
msgid "Sort"
msgstr "Подреждане"

#: src/fe-gtk/editlist.c:373
msgid "Help"
msgstr "Помощ"

#: src/fe-gtk/fe-gtk.c:170
msgid "Options"
msgstr "Опции"

#: src/fe-gtk/fe-gtk.c:171
msgid "don't auto connect"
msgstr "без автоматично свързване"

#: src/fe-gtk/fe-gtk.c:172
msgid "DIRECTORY"
msgstr "ПАПКА"

#: src/fe-gtk/fe-gtk.c:173
msgid "use a different config dir"
msgstr "използване на различна папка за настройки"

#: src/fe-gtk/fe-gtk.c:174
msgid "don't auto load any plugins"
msgstr "без автоматично зареждане на плъгини"

#: src/fe-gtk/fe-gtk.c:175
msgid "show plugin auto-load dir"
msgstr "показване на папката с автоматично зареждащи се плъгини"

#: src/fe-gtk/fe-gtk.c:176
msgid "show user config dir"
msgstr "показване на папката за настройките"

#: src/fe-gtk/fe-gtk.c:177
msgid "show version information"
msgstr "показване на информация за версията"

#: src/fe-gtk/fe-gtk.c:262
#, c-format
msgid ""
"Failed to open font:\n"
"\n"
"%s"
msgstr ""
"Неуспех при отваряне на шрифта:\n"
"\n"
"%s"

#: src/fe-gtk/fe-gtk.c:622
msgid "Search buffer is empty.\n"
msgstr "Буфера за търсенето е празен.\n"

#: src/fe-gtk/fe-gtk.c:699
#, c-format
msgid "%d bytes"
msgstr "%d байта"

#: src/fe-gtk/fkeys.c:155
msgid "The Run Command action runs the data in Data 1 as if it has been typed into the entry box where you pressed the key sequence. Thus it can contain text (which will be sent to the channel/person), commands or user commands. When run all \\n characters in Data 1 are used to deliminate seperate commands so it is possible to run more than one command. If you want a \\ in the actual text run then enter \\\\"
msgstr ""

#: src/fe-gtk/fkeys.c:157
msgid "The Change Page command switches between pages in the notebook. Set Data 1 to the page you want to switch to. If Data 2 is set to anything then the switch will be relative to the current position"
msgstr ""

#: src/fe-gtk/fkeys.c:159
msgid "The Insert in Buffer command will insert the contents of Data 1 into the entry where the key sequence was pressed at the current cursor position"
msgstr ""

#: src/fe-gtk/fkeys.c:161
msgid "The Scroll Page command scrolls the text widget up or down one page or one line. Set Data 1 to either Up, Down, +1 or -1."
msgstr ""

#: src/fe-gtk/fkeys.c:163
msgid "The Set Buffer command sets the entry where the key sequence was entered to the contents of Data 1"
msgstr ""

#: src/fe-gtk/fkeys.c:165
msgid "The Last Command command sets the entry to contain the last command entered - the same as pressing up in a shell"
msgstr ""

#: src/fe-gtk/fkeys.c:167
msgid "The Next Command command sets the entry to contain the next command entered - the same as pressing down in a shell"
msgstr ""

#: src/fe-gtk/fkeys.c:169
msgid "This command changes the text in the entry to finish an incomplete nickname or command. If Data 1 is set then double-tabbing in a string will select the last nick, not the next"
msgstr ""

#: src/fe-gtk/fkeys.c:171
msgid "This command scrolls up and down through the list of nicks. If Data 1 is set to anything it will scroll up, else it scrolls down"
msgstr ""

#: src/fe-gtk/fkeys.c:173
msgid "This command checks the last word entered in the entry against the replace list and replaces it if it finds a match"
msgstr ""

#: src/fe-gtk/fkeys.c:175
msgid "This command moves the front tab left by one"
msgstr "Тази команда премества избрания таб с една позиция на ляво"

#: src/fe-gtk/fkeys.c:177
msgid "This command moves the front tab right by one"
msgstr "Тази команда премества избрания таб с една позиция на дясно"

#: src/fe-gtk/fkeys.c:179
msgid "This command moves the current tab family to the left"
msgstr "Тази команда премества избраната група табове на ляво"

#: src/fe-gtk/fkeys.c:181
msgid "This command moves the current tab family to the right"
msgstr "Тази команда премества избраната група табове надясно"

#: src/fe-gtk/fkeys.c:183
msgid "Push input line into history but doesn't send to server"
msgstr "Внасяне на реда написан в полето за писане в историята, но без да се изпраща на сървъра"

#: src/fe-gtk/fkeys.c:195
msgid "There was an error loading key bindings configuration"
msgstr ""

#: src/fe-gtk/fkeys.c:439 src/fe-gtk/fkeys.c:440 src/fe-gtk/fkeys.c:441
#: src/fe-gtk/fkeys.c:442 src/fe-gtk/fkeys.c:724 src/fe-gtk/fkeys.c:730
#: src/fe-gtk/fkeys.c:735 src/fe-gtk/maingui.c:905 src/fe-gtk/maingui.c:921
#: src/fe-gtk/maingui.c:1064 src/fe-gtk/maingui.c:1117
#: src/fe-gtk/maingui.c:2494
msgid "<none>"
msgstr "<няма>"

#: src/fe-gtk/fkeys.c:688
msgid "Mod"
msgstr "Режим"

#: src/fe-gtk/fkeys.c:689 src/fe-gtk/fkeys.c:784
msgid "Key"
msgstr "Ключ"

#: src/fe-gtk/fkeys.c:690
msgid "Action"
msgstr "Действие"

#: src/fe-gtk/fkeys.c:699
msgid "X-Chat: Keyboard Shortcuts"
msgstr "X-Chat: Бързи клавиши"

#: src/fe-gtk/fkeys.c:746
msgid "Add new"
msgstr "Добавяне на ново"

#: src/fe-gtk/fkeys.c:777
msgid "Shift"
msgstr "Shift"

#: src/fe-gtk/fkeys.c:779
msgid "Alt"
msgstr "Alt"

#: src/fe-gtk/fkeys.c:781
msgid "Ctrl"
msgstr "Ctrl"

#: src/fe-gtk/fkeys.c:788
msgid "Data 1"
msgstr "Данни 1"

#: src/fe-gtk/fkeys.c:791
msgid "Data 2"
msgstr "Данни 2"

#: src/fe-gtk/fkeys.c:834
msgid "Error opening keys config file\n"
msgstr "Грешка при отваряне на конфигурационния файл на клавишите\n"

#: src/fe-gtk/fkeys.c:1005
#, c-format
msgid ""
"Unknown keyname %s in key bindings config file\n"
"Load aborted, please fix %s/keybindings.conf\n"
msgstr ""

#: src/fe-gtk/fkeys.c:1043
#, c-format
msgid ""
"Unknown action %s in key bindings config file\n"
"Load aborted, Please fix %s/keybindings\n"
msgstr ""

#: src/fe-gtk/fkeys.c:1064
#, c-format
msgid ""
"Expecting Data line (beginning Dx{:|!}) but got:\n"
"%s\n"
"\n"
"Load aborted, Please fix %s/keybindings\n"
msgstr ""

#: src/fe-gtk/fkeys.c:1133
#, c-format
msgid ""
"Key bindings config file is corrupt, load aborted\n"
"Please fix %s/keybindings.conf\n"
msgstr ""

#: src/fe-gtk/gtkutil.c:154
msgid "Cannot write to that file."
msgstr "Не може да се пише в този файл."

#: src/fe-gtk/gtkutil.c:156
msgid "Cannot read that file."
msgstr "Не може да се чете от този файл."

#: src/fe-gtk/ignoregui.c:117 src/fe-gtk/ignoregui.c:263
msgid "That mask already exists."
msgstr "Тази маска вече съществува."

#: src/fe-gtk/ignoregui.c:177 src/fe-gtk/maingui.c:1573
msgid "Private"
msgstr "Частен"

#: src/fe-gtk/ignoregui.c:178
msgid "Notice"
msgstr "Уведомяване"

#: src/fe-gtk/ignoregui.c:179
msgid "CTCP"
msgstr "CTCP"

#: src/fe-gtk/ignoregui.c:180
msgid "DCC"
msgstr "DCC"

#: src/fe-gtk/ignoregui.c:181
msgid "Invite"
msgstr "Покана"

#: src/fe-gtk/ignoregui.c:182
msgid "Unignore"
msgstr "Махане на игнорирането"

#: src/fe-gtk/ignoregui.c:307
msgid "Enter mask to ignore:"
msgstr "Въведете маската, която да се игнорира:"

#: src/fe-gtk/ignoregui.c:354
msgid "X-Chat: Ignore list"
msgstr "X-Chat: Списък с игнорираните"

#: src/fe-gtk/ignoregui.c:361
msgid "Ignore Stats:"
msgstr "Статистика за игнорирането:"

#: src/fe-gtk/ignoregui.c:369
msgid "Channel:"
msgstr "Стая:"

#: src/fe-gtk/ignoregui.c:370
msgid "Private:"
msgstr "Частен:"

#: src/fe-gtk/ignoregui.c:371
msgid "Notice:"
msgstr "Уведомяване:"

#: src/fe-gtk/ignoregui.c:372
msgid "CTCP:"
msgstr "CTCP:"

#: src/fe-gtk/ignoregui.c:373
msgid "Invite:"
msgstr "Покана:"

#: src/fe-gtk/ignoregui.c:384 src/fe-gtk/notifygui.c:306
msgid "Add"
msgstr "Добавяне"

#: src/fe-gtk/maingui.c:318
msgid "Dialog with"
msgstr "Разговор с"

#: src/fe-gtk/maingui.c:574
#, c-format
msgid "Topic for %s is: %s"
msgstr "Темата на %s е: %s"

#: src/fe-gtk/maingui.c:578
msgid "No topic is set"
msgstr "Няма настроена тема"

#: src/fe-gtk/maingui.c:974
msgid "No other tabs open, quit xchat?"
msgstr ""
"Няма отворени други табове,\n"
"желаете ли да затворите X-Chat?"

#: src/fe-gtk/maingui.c:1020
msgid "Insert color code"
msgstr "Вмъкване на код за цвят"

#: src/fe-gtk/maingui.c:1069
msgid "Beep on message"
msgstr "Бибиткане при съобщение"

#: src/fe-gtk/maingui.c:1072
msgid "Show join/part messages"
msgstr "Показване на кой влиза и излиза"

#: src/fe-gtk/maingui.c:1074
msgid "Color paste"
msgstr "Поставяне на цвят"

#: src/fe-gtk/maingui.c:1084
msgid "Go to"
msgstr "Отиване на"

#: src/fe-gtk/maingui.c:1097 src/fe-gtk/menu.c:1251
msgid "Close Tab"
msgstr "Затваряне на таб"

#: src/fe-gtk/maingui.c:1100 src/fe-gtk/menu.c:1404
msgid "Detach Tab"
msgstr "Откачане на таб"

#: src/fe-gtk/maingui.c:1291
msgid "Some file transfers still active, quit xchat?"
msgstr ""
"Някои файлови трансфери са още активни,\n"
"желаете ли да затворите X-Chat?"

#: src/fe-gtk/maingui.c:1441 src/fe-gtk/maingui.c:1547
msgid "User limit must be a number!\n"
msgstr "Лимита на потребители трябва да е номер!\n"

#: src/fe-gtk/maingui.c:1569
msgid "Topic Protection"
msgstr "Защита на темата"

#: src/fe-gtk/maingui.c:1570
msgid "No outside messages"
msgstr "Без външни съобщения"

#: src/fe-gtk/maingui.c:1571
msgid "Secret"
msgstr "Таен"

#: src/fe-gtk/maingui.c:1572
msgid "Invite Only"
msgstr "Само с покана"

#: src/fe-gtk/maingui.c:1574
msgid "Moderated"
msgstr "Модериран"

#: src/fe-gtk/maingui.c:1575
msgid "Ban List"
msgstr "Списък със забранени потребители/адреси"

#: src/fe-gtk/maingui.c:1577
msgid "Keyword"
msgstr "Ключова дума"

#: src/fe-gtk/maingui.c:1589
msgid "User Limit"
msgstr "Потребителски лимит"

#: src/fe-gtk/maingui.c:1605
msgid "Close this tab/window"
msgstr "Затваряне на този таб/прозорец"

#: src/fe-gtk/maingui.c:1702
msgid "Show/Hide userlist"
msgstr "Показва/скрива списъка с потребители"

#: src/fe-gtk/maingui.c:1815
msgid ""
"Unable to set transparent background!\n"
"\n"
"You may be using a non-compliant window\n"
"manager that is not currently supported.\n"
msgstr ""
"Не може да се използва прозрачен фон!\n"
"\n"
"Може би използвате несъвместим дисплей\n"
"мениджър, който не се поддържа.\n"

#: src/fe-gtk/maingui.c:2008
msgid "Enter new nickname:"
msgstr "Въведете нов прякор:"

#: src/fe-gtk/menu.c:116
msgid "Host unknown"
msgstr "Непознат хост"

#: src/fe-gtk/menu.c:477
#, c-format
msgid "User: %s"
msgstr "Потребител: %s"

#: src/fe-gtk/menu.c:481
#, c-format
msgid "Country: %s"
msgstr "Страна: %s"

#: src/fe-gtk/menu.c:485
#, c-format
msgid "Realname: %s"
msgstr "Истинско име: %s"

#: src/fe-gtk/menu.c:489
#, c-format
msgid "Server: %s"
msgstr "Сървър: %s"

#: src/fe-gtk/menu.c:493
#, c-format
msgid "Last Msg: %s"
msgstr "Последно съобщение: %s"

#: src/fe-gtk/menu.c:578
msgid "Menu Bar"
msgstr "Лента с менютата"

#: src/fe-gtk/menu.c:579
msgid "Topic Bar"
msgstr "Лента с темата"

#: src/fe-gtk/menu.c:583 src/fe-gtk/setup.c:159
msgid "User List"
msgstr "Списък с потребители"

#: src/fe-gtk/menu.c:586
msgid "Mode Buttons"
msgstr "Бутони за режимите"

#: src/fe-gtk/menu.c:592
msgid "User List Buttons"
msgstr "Бутони за потребителския списък"

#: src/fe-gtk/menu.c:662 src/fe-gtk/urlgrab.c:202
msgid "Copy selected URL"
msgstr "Копиране на избрания URL"

#: src/fe-gtk/menu.c:725
msgid "Part Channel"
msgstr "Напускане на стаята"

#: src/fe-gtk/menu.c:727
msgid "Cycle Channel"
msgstr "Излизане и влизане в стаята"

#: src/fe-gtk/menu.c:750
msgid "X-Chat: User menu"
msgstr "X-Chat: Потребителско меню"

#: src/fe-gtk/menu.c:759
msgid "Edit This Menu..."
msgstr "Редактиране на това меню..."

#: src/fe-gtk/menu.c:866
msgid ""
"*WARNING*\n"
"Auto accepting DCC to your home directory\n"
"can be dangerous and is exploitable. Eg:\n"
"Someone could send you a .bash_profile"
msgstr ""
"*ВНИМАНИЕ*\n"
"Автоматично приемане на DCC във вашата домашна папка\n"
"може да бъде опасно и използваемо от други. Пример:\n"
"Някой може да ви прати .bash_profile"

#: src/fe-gtk/menu.c:994
msgid "Settings saved."
msgstr "Настройките са запазени."

#: src/fe-gtk/menu.c:1031
msgid ""
"User Commands - Special codes:\n"
"\n"
"%c  =  current channel\n"
"%m  =  machine info\n"
"%n  =  your nick\n"
"%t  =  time/date\n"
"%v  =  xchat version\n"
"%2  =  word 2\n"
"%3  =  word 3\n"
"&2  =  word 2 to the end of line\n"
"&3  =  word 3 to the end of line\n"
"\n"
"eg:\n"
"/cmd john hello\n"
"\n"
"%2 would be \"john\"\n"
"&2 would be \"john hello\"."
msgstr ""

#: src/fe-gtk/menu.c:1046
msgid ""
"Userlist Buttons - Special codes:\n"
"\n"
"%a  =  all selected nicks\n"
"%c  =  current channel\n"
"%h  =  selected nick's hostname\n"
"%m  =  machine info\n"
"%n  =  your nick\n"
"%s  =  selected nick\n"
"%t  =  time/date\n"
msgstr ""

#: src/fe-gtk/menu.c:1055
msgid ""
"Dialog Buttons - Special codes:\n"
"\n"
"%a  =  all selected nicks\n"
"%c  =  current channel\n"
"%h  =  selected nick's hostname\n"
"%m  =  machine info\n"
"%n  =  your nick\n"
"%s  =  selected nick\n"
"%t  =  time/date\n"
msgstr ""

#: src/fe-gtk/menu.c:1064
msgid ""
"CTCP Replies - Special codes:\n"
"\n"
"%d  =  data (the whole ctcp)\n"
"%m  =  machine info\n"
"%s  =  nick who sent the ctcp\n"
"%t  =  time/date\n"
"%2  =  word 2\n"
"%3  =  word 3\n"
"&2  =  word 2 to the end of line\n"
"&3  =  word 3 to the end of line\n"
"\n"
msgstr ""
"CTCP Отговори - Специални кодове:\n"
"\n"
"%d  =  данни (целия ctcp)\n"
"%m  =  информация за машината\n"
"%s  =  прякора на този, който изпратил ctcp\n"
"%t  =  време/дата\n"
"%2  =  дума 2\n"
"%3  =  дума 3\n"
"&2  =  дума 2 до края на реда\n"
"&3  =  duma 3 до края на реда\n"
"\n"

#: src/fe-gtk/menu.c:1074
#, c-format
msgid ""
"URL Handlers - Special codes:\n"
"\n"
"%s  =  the URL string\n"
"\n"
"Putting a ! infront of the command\n"
"indicates it should be sent to a\n"
"shell instead of X-Chat"
msgstr ""

#: src/fe-gtk/menu.c:1083
msgid "X-Chat: User Defined Commands"
msgstr "X-Chat: Потребителски команди"

#: src/fe-gtk/menu.c:1090
msgid "X-Chat: Userlist Popup menu"
msgstr "X-Chat: Меню за потребителския списък"

#: src/fe-gtk/menu.c:1097
msgid "X-Chat: Replace"
msgstr "X-Chat: Замяна"

#: src/fe-gtk/menu.c:1104
msgid "X-Chat: URL Handlers"
msgstr "X-Chat: Управление на URL"

#: src/fe-gtk/menu.c:1123
msgid "X-Chat: Userlist buttons"
msgstr "X-Chat: Бутони за списъка с потребители"

#: src/fe-gtk/menu.c:1130
msgid "X-Chat: Dialog buttons"
msgstr "X-Chat: Диалогови бутони"

#: src/fe-gtk/menu.c:1137
msgid "X-Chat: CTCP Replies"
msgstr "X-Chat: CTCP отговори"

#: src/fe-gtk/menu.c:1225
msgid "_X-Chat"
msgstr "_X-Chat"

#: src/fe-gtk/menu.c:1226
msgid "Server List..."
msgstr "Списък със сървърите"

#: src/fe-gtk/menu.c:1229
msgid "New"
msgstr "Ново"

#: src/fe-gtk/menu.c:1230
msgid "Server Tab..."
msgstr "Таб за сървъра"

#: src/fe-gtk/menu.c:1231
msgid "Channel Tab..."
msgstr "Таб за стая..."

#: src/fe-gtk/menu.c:1232
msgid "Server Window..."
msgstr "Прозорец за сървър"

#: src/fe-gtk/menu.c:1233
msgid "Channel Window..."
msgstr "Прозорец за стая..."

#: src/fe-gtk/menu.c:1238 src/fe-gtk/menu.c:1240
msgid "Load Plugin or Script..."
msgstr "Зарежане на нов плъгин или скрипт..."

#: src/fe-gtk/menu.c:1244
msgid "New Shell Tab..."
msgstr ""

#: src/fe-gtk/menu.c:1253
msgid "Quit"
msgstr "Изход"

#: src/fe-gtk/menu.c:1255
msgid "_IRC"
msgstr "_IRC"

#: src/fe-gtk/menu.c:1256
msgid "Invisible"
msgstr "Невидим"

#: src/fe-gtk/menu.c:1257
msgid "Receive Wallops"
msgstr "Получаване на wallop съобщения"

#: src/fe-gtk/menu.c:1258
msgid "Receive Server Notices"
msgstr "Получване на сървърни уведомявания"

#: src/fe-gtk/menu.c:1260
msgid "Marked Away"
msgstr "\"Няма ме\""

#: src/fe-gtk/menu.c:1262
msgid "Auto Rejoin when Kicked"
msgstr "Автоматично влизане наново при изхвърляне"

#: src/fe-gtk/menu.c:1263
msgid "Auto Reconnect to Server"
msgstr "Автоматично свързване наново"

#: src/fe-gtk/menu.c:1264
msgid "Never-give-up ReConnect"
msgstr "Постоянни опити за ново свързване"

#: src/fe-gtk/menu.c:1266
msgid "Auto Open Dialog Windows"
msgstr "Автоматично отваряне на диалогови прозорци"

#: src/fe-gtk/menu.c:1267
msgid "Auto Accept Direct Chat"
msgstr "Автоматично приемане на директен разговор"

#: src/fe-gtk/menu.c:1268
msgid "Auto Accept Files"
msgstr "Автоматично приемане на файлове"

#: src/fe-gtk/menu.c:1270
msgid "_Server"
msgstr "Сървър"

#: src/fe-gtk/menu.c:1272
msgid "S_ettings"
msgstr "Настройки"

#: src/fe-gtk/menu.c:1273
msgid "Preferences..."
msgstr "Настройки"

#: src/fe-gtk/menu.c:1275
msgid "Advanced"
msgstr "Допълнителни"

#: src/fe-gtk/menu.c:1276
msgid "Auto Replace..."
msgstr "Автоматично заменяне"

#: src/fe-gtk/menu.c:1277
msgid "CTCP Replies..."
msgstr "CTCP отговори..."

#: src/fe-gtk/menu.c:1278
msgid "Dialog Buttons..."
msgstr "Диалогови бутони..."

#: src/fe-gtk/menu.c:1279
msgid "Keyboard Shortcuts..."
msgstr "Бързи клавиши..."

#: src/fe-gtk/menu.c:1280
msgid "Text Events..."
msgstr "Текстови събития..."

#: src/fe-gtk/menu.c:1281
msgid "URL Handlers..."
msgstr "Управление на URL-тата..."

#: src/fe-gtk/menu.c:1282
msgid "User Commands..."
msgstr "Потребителски команди..."

#: src/fe-gtk/menu.c:1283
msgid "Userlist Buttons..."
msgstr "Бутони при потребителския списък..."

#: src/fe-gtk/menu.c:1284
msgid "Userlist Popup..."
msgstr "Меню на списъка с потребители"

#: src/fe-gtk/menu.c:1289
msgid "Reload Settings"
msgstr "Презареждане на настройките"

#: src/fe-gtk/menu.c:1291
msgid "Save Settings now"
msgstr "Запазване на настройките сега"

#: src/fe-gtk/menu.c:1292
msgid "Save Settings on exit"
msgstr "Запазване на настройките при изход"

#: src/fe-gtk/menu.c:1295
msgid "_Window"
msgstr "Прозорец"

#: src/fe-gtk/menu.c:1296
msgid "Ban List..."
msgstr "Списък със забранение адреси..."

#: src/fe-gtk/menu.c:1297
msgid "Channel List..."
msgstr "Списък с стаите..."

#: src/fe-gtk/menu.c:1298
msgid "Character Chart..."
msgstr "Таблица с символи..."

#: src/fe-gtk/menu.c:1299
msgid "Direct Chat..."
msgstr "Директен чат..."

#: src/fe-gtk/menu.c:1300
msgid "File Receive..."
msgstr "Получаване на файлове..."

#: src/fe-gtk/menu.c:1301
msgid "File Send..."
msgstr "Изпращане на файлове..."

#: src/fe-gtk/menu.c:1302
msgid "Ignore List..."
msgstr "Списък с игнорираните"

#: src/fe-gtk/menu.c:1303
msgid "Notify List..."
msgstr "Списък с приятели..."

#: src/fe-gtk/menu.c:1304
msgid "Plugins and Scripts..."
msgstr "Плъгини и скриптове..."

#: src/fe-gtk/menu.c:1305
msgid "Raw Log..."
msgstr "Необработен журнал..."

#: src/fe-gtk/menu.c:1306
msgid "URL Grabber..."
msgstr "Улавяне на URL-та..."

#: src/fe-gtk/menu.c:1308
msgid "Reset Marker Line"
msgstr "Зануляване на отбелязващата линия"

#: src/fe-gtk/menu.c:1309
msgid "C_lear Text"
msgstr "Изчистване на текста"

#: src/fe-gtk/menu.c:1310
msgid "Search Text..."
msgstr "Търсене из текста..."

#: src/fe-gtk/menu.c:1311
msgid "Save Text..."
msgstr "Записване на текста..."

#: src/fe-gtk/menu.c:1313
msgid "_Help"
msgstr "Помощ"

#: src/fe-gtk/menu.c:1314
msgid "_Contents"
msgstr "_Потребителско ръководство"

#: src/fe-gtk/menu.c:1316 src/fe-gtk/menu.c:1318
msgid "_About"
msgstr "_Относно"

#: src/fe-gtk/menu.c:1406
msgid "Attach Tab"
msgstr "Закачане на таб"

#: src/fe-gtk/notifygui.c:109
msgid "User"
msgstr "Потребител"

#: src/fe-gtk/notifygui.c:111
msgid "Server"
msgstr "Сървър"

#: src/fe-gtk/notifygui.c:112
msgid "Last Seen"
msgstr "Последно видян"

#: src/fe-gtk/notifygui.c:149
msgid "Offline"
msgstr "Не е на линия"

#: src/fe-gtk/notifygui.c:169 src/fe-gtk/setup.c:199
msgid "Never"
msgstr "Никога"

#: src/fe-gtk/notifygui.c:187
msgid "Online"
msgstr "На линия"

#: src/fe-gtk/notifygui.c:277
msgid "Enter nickname to add:"
msgstr "Въведете прякор за добавяне:"

#: src/fe-gtk/notifygui.c:293
msgid "X-Chat: Notify List"
msgstr "X-Chat: Списък с приятелчета"

#: src/fe-gtk/notifygui.c:308
msgid "Remove"
msgstr "Премахване"

#: src/fe-gtk/plugingui.c:75 src/fe-gtk/textgui.c:341
msgid "Description"
msgstr "Описание"

#: src/fe-gtk/plugingui.c:150
msgid "Select a Plugin or Script to load"
msgstr "Избор на плъгин или скрипт за зареждане"

#: src/fe-gtk/plugingui.c:222
msgid "X-Chat: Plugins and Scripts"
msgstr "X-Chat: Плъгини и скриптове"

#: src/fe-gtk/plugingui.c:228
msgid "_Load..."
msgstr "Зареждане..."

#: src/fe-gtk/plugingui.c:231
msgid "_UnLoad"
msgstr "_Отзареждане"

#: src/fe-gtk/plugingui.c:235
msgid "_Close"
msgstr "Затваряне"

#: src/fe-gtk/rawlog.c:78
msgid "Save rawlog"
msgstr "Запазване на необработен журнал"

#: src/fe-gtk/rawlog.c:94
#, c-format
msgid "X-Chat: Rawlog (%s)"
msgstr ""

#: src/fe-gtk/rawlog.c:123
msgid "Clear rawlog"
msgstr ""

#: src/fe-gtk/rawlog.c:126
msgid "Save rawlog..."
msgstr ""

#: src/fe-gtk/search.c:47
msgid "The window you opened this Search for doesn't exist anymore."
msgstr "Прозореца, за който отворихте това търсене вече не съществува."

#: src/fe-gtk/search.c:91
msgid "X-Chat: Search"
msgstr "X-Chat: Търсене"

#: src/fe-gtk/search.c:100
msgid "Find:"
msgstr "Търсене:"

#: src/fe-gtk/search.c:114
msgid "Find"
msgstr "Търсене"

#: src/fe-gtk/search.c:119
msgid "Close"
msgstr "Затваряне"

#: src/fe-gtk/servlistgui.c:161 src/fe-gtk/servlistgui.c:260
msgid "New Network"
msgstr "Нова мрежа"

#: src/fe-gtk/servlistgui.c:493
#, c-format
msgid "Really remove network \"%s\" and all its servers?"
msgstr "Наистина ли да се изтрие мрежата \"%s\" и всичките и сървъри?"

#: src/fe-gtk/servlistgui.c:614 src/fe-gtk/servlistgui.c:630
msgid "User name and Real name cannot be left blank."
msgstr "Потребителското име и истинското име на може да бъдат оставени празни."

#: src/fe-gtk/servlistgui.c:981
#, c-format
msgid "X-Chat: Edit %s"
msgstr "X-Chat:·Редактиране на %s"

#: src/fe-gtk/servlistgui.c:1000
#, c-format
msgid "Servers for %s"
msgstr "Сървъри за %s"

#: src/fe-gtk/servlistgui.c:1011
msgid "Connect to selected server only"
msgstr "Свързване САМО към избрания сървър"

#: src/fe-gtk/servlistgui.c:1012
msgid "Don't cycle through all the servers when the connection fails."
msgstr "Да не се пробват един по един сървърите, ако връзката пропада."

#: src/fe-gtk/servlistgui.c:1014
msgid "Your Details"
msgstr "Вашите данни"

#: src/fe-gtk/servlistgui.c:1020
msgid "Use global user information"
msgstr "Използване на глобална потребителска информация"

#: src/fe-gtk/servlistgui.c:1023 src/fe-gtk/servlistgui.c:1255
msgid "_Nick name:"
msgstr "Прякор:"

#: src/fe-gtk/servlistgui.c:1027 src/fe-gtk/servlistgui.c:1276
msgid "_User name:"
msgstr "Потребител:"

#: src/fe-gtk/servlistgui.c:1031
msgid "Real na_me:"
msgstr "Истинско име:"

#: src/fe-gtk/servlistgui.c:1034
msgid "Connecting"
msgstr "Свързва се"

#: src/fe-gtk/servlistgui.c:1040
msgid "Auto connect to this network at startup"
msgstr ""
"Автоматично свързване към тази мрежа\n"
"при стартирането на X-Chat"

#: src/fe-gtk/servlistgui.c:1042
msgid "Use a proxy server"
msgstr "Използване на прокси сървър"

#: src/fe-gtk/servlistgui.c:1044
msgid "Use SSL for all the servers on this network"
msgstr "Използване на SSL за всички сървъри от тази мрежа"

#: src/fe-gtk/servlistgui.c:1049
msgid "Accept invalid SSL certificate"
msgstr "Приемане на невалидния SSL сертификат"

#: src/fe-gtk/servlistgui.c:1055
msgid "C_hannels to join:"
msgstr "Стаи, в които да се влиза:"

#: src/fe-gtk/servlistgui.c:1057
msgid "Channels to join, separated by commas, but not spaces!"
msgstr "Стаи, в които да се влиза, разделени със запетаи, не с празни места!!!"

#: src/fe-gtk/servlistgui.c:1060
msgid "Connect command:"
msgstr "Команда при свързване:"

#: src/fe-gtk/servlistgui.c:1062
msgid "Extra command to execute after connecting. If you need more than one, set this to LOAD -e <filename>, where <filename> is a text-file full of commands to execute."
msgstr ""

#: src/fe-gtk/servlistgui.c:1065
msgid "Nickserv password:"
msgstr "Парола за NickServ:"

#: src/fe-gtk/servlistgui.c:1070
msgid "Server password:"
msgstr "Парола за сървъра:"

#: src/fe-gtk/servlistgui.c:1072
msgid "Password for the server, if in doubt, leave blank."
msgstr "Парола за сървъра. Ако не сте сигурни, оставете полето празно."

#: src/fe-gtk/servlistgui.c:1075
msgid "Character set:"
msgstr "Кодиране:"

#: src/fe-gtk/servlistgui.c:1148
msgid "_Edit"
msgstr "_Редактиране"

#: src/fe-gtk/servlistgui.c:1229
msgid "X-Chat: Server List"
msgstr "X-Chat: Списък на сървърите"

#: src/fe-gtk/servlistgui.c:1245
msgid "User Information"
msgstr "Потребителска информация"

#: src/fe-gtk/servlistgui.c:1262
msgid "Second choice:"
msgstr "Втори избор:"

#: src/fe-gtk/servlistgui.c:1269
msgid "Third choice:"
msgstr "Трети избор:"

#: src/fe-gtk/servlistgui.c:1283
msgid "Rea_l name:"
msgstr "Истинско име:"

#: src/fe-gtk/servlistgui.c:1329
msgid "Networks"
msgstr "Мрежи"

#: src/fe-gtk/servlistgui.c:1370
msgid "Skip server list on startup"
msgstr "Да не се показва списъка със сървърите при стартиране"

#: src/fe-gtk/servlistgui.c:1401
msgid "_Edit..."
msgstr "_Редактиране..."

#: src/fe-gtk/servlistgui.c:1408
msgid "_Sort"
msgstr "_Подреждане"

#: src/fe-gtk/servlistgui.c:1424
msgid "C_onnect"
msgstr "Свързване"

#: src/fe-gtk/servlistgui.c:1433
msgid "Connect in new tab"
msgstr "Свързване в нов таб"

#: src/fe-gtk/setup.c:95
msgid "Text Box Appearance"
msgstr "Външен вид на полето за текста"

#: src/fe-gtk/setup.c:96
msgid "Font:"
msgstr "Шрифт:"

#: src/fe-gtk/setup.c:97
msgid "Background image:"
msgstr "Изображение за фон:"

#: src/fe-gtk/setup.c:98
msgid "Scrollback lines:"
msgstr "Запазени редове назад:"

#: src/fe-gtk/setup.c:99
msgid "Transparent background"
msgstr "Прозрачен фон"

#: src/fe-gtk/setup.c:100
msgid "Indent nick names"
msgstr ""

#: src/fe-gtk/setup.c:101
msgid "Make nick names right-justified"
msgstr "Прякорите да са подравнени в дясно"

#: src/fe-gtk/setup.c:102
msgid "Tint (shade) transparency"
msgstr ""

#: src/fe-gtk/setup.c:103
msgid "Colored nick names"
msgstr "Цветни прякори"

#: src/fe-gtk/setup.c:104
msgid "Give each person on IRC a different color"
msgstr "Всеки прякор да има назначен различен цвят"

#: src/fe-gtk/setup.c:105
msgid "Strip mIRC colors"
msgstr ""

#: src/fe-gtk/setup.c:106
msgid "Show marker line"
msgstr "Показва маркиращата линия"

#: src/fe-gtk/setup.c:107
msgid "Insert a red line after the last read text."
msgstr "Вмъкване на червена линия след последно прочетения текст"

#: src/fe-gtk/setup.c:108
msgid "Tint Settings"
msgstr ""

#: src/fe-gtk/setup.c:109
msgid "Red:"
msgstr "Червено:"

#: src/fe-gtk/setup.c:110
msgid "Green:"
msgstr "Зелено:"

#: src/fe-gtk/setup.c:111
msgid "Blue:"
msgstr "Синьо:"

#: src/fe-gtk/setup.c:113 src/fe-gtk/setup.c:312
msgid "Time Stamps"
msgstr "Време срещу всяка реплика"

#: src/fe-gtk/setup.c:114
msgid "Time stamp format:"
msgstr "Формат на отбелязване на времето:"

#: src/fe-gtk/setup.c:115
msgid "See strftime manpage for details."
msgstr "Вижте man страницата за strftime за повече информация"

#: src/fe-gtk/setup.c:116
msgid "Enable time stamps"
msgstr "Вмъква времето на репликите"

#: src/fe-gtk/setup.c:123
msgid "Nick Completion"
msgstr "Довършване на прякорите"

#: src/fe-gtk/setup.c:124
msgid "Automatic nick completion"
msgstr "Автоматично довършване на прякорите"

#: src/fe-gtk/setup.c:125
msgid "Completes nick names without using the TAB key"
msgstr "Довършване на прякорите без да се използва клавиша TAB"

#: src/fe-gtk/setup.c:126
msgid "Nick completion suffix:"
msgstr "Допълнение след довършените прякори:"

#: src/fe-gtk/setup.c:128
msgid "Input Box Codes"
msgstr "Кодове за полето за писане"

#: src/fe-gtk/setup.c:129
#, c-format
msgid "Interpret %nnn as an ASCII value"
msgstr "Интерпретиране на %nnn като ASCII стойност"

#: src/fe-gtk/setup.c:130
msgid "Interpret %C, %B as Color, Bold etc"
msgstr "Интерпретиране на %C, %B като Цвят, Удебелено и т.н."

#: src/fe-gtk/setup.c:132
msgid "Input Box Appearance"
msgstr "Външен вид на полето за писане"

#: src/fe-gtk/setup.c:133 src/fe-gtk/setup.c:163
msgid "Use the Text box font and colors"
msgstr "Използване на шрифта и цветовете на полето за текста"

#: src/fe-gtk/setup.c:140
msgid "Off"
msgstr "Изкл."

#: src/fe-gtk/setup.c:141
msgid "Graph"
msgstr "Графа"

#: src/fe-gtk/setup.c:142
msgid "Info text"
msgstr "Информация"

#: src/fe-gtk/setup.c:143
msgid "Both"
msgstr "И двете"

#: src/fe-gtk/setup.c:149
msgid "A-Z, Ops first"
msgstr "A-Z, Операторите първо"

#: src/fe-gtk/setup.c:150
msgid "A-Z"
msgstr "A-Z"

#: src/fe-gtk/setup.c:151
msgid "Z-A, Ops last"
msgstr "Z-A, Операторите последно"

#: src/fe-gtk/setup.c:152
msgid "Z-A"
msgstr "Z-A"

#: src/fe-gtk/setup.c:153
msgid "Unsorted"
msgstr "Неподреден"

#: src/fe-gtk/setup.c:160
msgid "User list sorted by:"
msgstr "Списък с потребителите сортиран по:"

#: src/fe-gtk/setup.c:161
msgid "Show hostnames in user list"
msgstr "Показва хостовете в списъка с потребители"

#: src/fe-gtk/setup.c:162
msgid "User list buttons enabled"
msgstr "Бутони за потребителския списък - включени"

#: src/fe-gtk/setup.c:164
msgid "Resizable user list"
msgstr "Оразмерим списък с потребителите"

#: src/fe-gtk/setup.c:166
msgid "Away tracking"
msgstr "Следене на статуса \"Няма ме\""

#: src/fe-gtk/setup.c:167
msgid "Enable away tracking"
msgstr ""
"Включване на следенето\n"
"на статуса \"Няма ме\""

#: src/fe-gtk/setup.c:168
msgid "On channels smaller than:"
msgstr "В стаи по-малки от:"

#: src/fe-gtk/setup.c:170
msgid "Action Upon Double Click"
msgstr "Действие при двойно натискане"

#: src/fe-gtk/setup.c:171
msgid "Execute command:"
msgstr "Изпълнение на команда:"

#: src/fe-gtk/setup.c:173
msgid "Extra Gadgets"
msgstr "Допълнителни играчки"

#: src/fe-gtk/setup.c:174
msgid "Lag meter:"
msgstr "Измервател на забавянето:"

#: src/fe-gtk/setup.c:175
msgid "Throttle meter:"
msgstr ""

#: src/fe-gtk/setup.c:182
msgid "Windows"
msgstr "Прозорци"

#: src/fe-gtk/setup.c:183 src/fe-gtk/setup.c:207 src/fe-gtk/setup.c:1446
msgid "Tabs"
msgstr "Табове"

#: src/fe-gtk/setup.c:189
msgid "Bottom"
msgstr "Долу"

#: src/fe-gtk/setup.c:190
msgid "Top"
msgstr "Горе"

#: src/fe-gtk/setup.c:191
msgid "Left"
msgstr "Ляво"

#: src/fe-gtk/setup.c:192
msgid "Right"
msgstr "Дясно"

#: src/fe-gtk/setup.c:193
msgid "Hidden"
msgstr "Скрит"

#: src/fe-gtk/setup.c:200
msgid "Always"
msgstr "Винаги"

#: src/fe-gtk/setup.c:201
msgid "Only requested tabs"
msgstr "Само изискани табове"

#: src/fe-gtk/setup.c:208
msgid "Open an extra tab for server messages"
msgstr "Отваряне на допълнителен таб за сървърни съобщения"

#: src/fe-gtk/setup.c:209
msgid "Open an extra tab for server notices"
msgstr "Отваряне на нов таб за сървърните уведомявания"

#: src/fe-gtk/setup.c:210
msgid "Small tabs"
msgstr "Малки табове"

#: src/fe-gtk/setup.c:211
msgid "Sort tabs in alphabetical order"
msgstr "Подрежда табовете по азбучен ред"

#: src/fe-gtk/setup.c:212
msgid "Focus new tabs:"
msgstr "Фокусиране на новите табове:"

#: src/fe-gtk/setup.c:213
msgid "Shorten tab labels to:"
msgstr "Скъсява табовете до:"

#: src/fe-gtk/setup.c:213
msgid "letters."
msgstr "букви."

#: src/fe-gtk/setup.c:215
msgid "Tabs Location"
msgstr "Положение на табовете"

#: src/fe-gtk/setup.c:216
msgid "Show tabs at:"
msgstr "Показване на табовете в:"

#: src/fe-gtk/setup.c:218
msgid "Tabs or Windows"
msgstr "Табове или Прозорци"

#: src/fe-gtk/setup.c:219
msgid "Open channels in:"
msgstr "Отваряне на стаи в:"

#: src/fe-gtk/setup.c:220
msgid "Open dialogs in:"
msgstr "Отваряне на разговори в:"

#: src/fe-gtk/setup.c:221
msgid "Open utilities in:"
msgstr "Отваряне на инструментите в:"

#: src/fe-gtk/setup.c:221
msgid "Open DCC, Ignore, Notify etc, in tabs or windows?"
msgstr "Отваряне на DCC, Игнориране, Списък с приятелчета и т.н. в отделни табове или прозорци?"

#: src/fe-gtk/setup.c:228
msgid "Files and Directories"
msgstr "Файлове и папки"

#: src/fe-gtk/setup.c:229
msgid "Download files to:"
msgstr "Сваляне на файловете в:"

#: src/fe-gtk/setup.c:230
msgid "Move completed files to:"
msgstr "Преместване на завършените файлове в:"

#: src/fe-gtk/setup.c:231
msgid "Save nick name in filenames"
msgstr "Запазване на прякора в името на файла"

#: src/fe-gtk/setup.c:232
msgid "Convert spaces to underscore before sending"
msgstr "Преобразуване на празните места в долни черти преди да се изпрати"

#: src/fe-gtk/setup.c:234
msgid "Network Settings"
msgstr "Настройки на мрежата"

#: src/fe-gtk/setup.c:235
msgid "DCC IP address:"
msgstr "DCC IP адрес:"

#: src/fe-gtk/setup.c:236
msgid "Claim you are at this address when offering files."
msgstr "Заявяване, че сте на този адрес при изпращането на файлове"

#: src/fe-gtk/setup.c:237
msgid "First DCC send port:"
msgstr "Първи DCC порт за пращане:"

#: src/fe-gtk/setup.c:238
msgid "Last DCC send port:"
msgstr "Последен DCC порт за пращане:"

#: src/fe-gtk/setup.c:239
msgid "(Leave ports at zero for full range)."
msgstr "(Оставете портовете на нула за пълния обсег)"

#: src/fe-gtk/setup.c:240
msgid "Get my address from the IRC server"
msgstr "Взимане на собствения адрес от IRC сървъра"

#: src/fe-gtk/setup.c:241
msgid "Asks the IRC server for your real address. Use this if you have a 192.168.*.* address!"
msgstr "Пита IRC сървъра за истинския ви адрес. Използвайте това ако имате адрес от вида 192.168.*.*!"

#: src/fe-gtk/setup.c:243
msgid "Maximum File Transfer Speeds (bytes per second)"
msgstr "Максимална скорост за файловите трансфери (байтове в секунда)"

#: src/fe-gtk/setup.c:244
msgid "One upload:"
msgstr "Едно качване:"

#: src/fe-gtk/setup.c:245 src/fe-gtk/setup.c:247
msgid "Maximum speed for one transfer"
msgstr "Максимална скорост за един трансфер"

#: src/fe-gtk/setup.c:246
msgid "One download:"
msgstr "Едно сваляне:"

#: src/fe-gtk/setup.c:248
msgid "All uploads combined:"
msgstr "Всички качвания комбинирано:"

#: src/fe-gtk/setup.c:249 src/fe-gtk/setup.c:251
msgid "Maximum speed for all files"
msgstr "Маскимална скорост за всички файлове"

#: src/fe-gtk/setup.c:250
msgid "All downloads combined:"
msgstr "Всички сваляния комбинирано:"

#: src/fe-gtk/setup.c:258
msgid "Default Messages"
msgstr "Стандартни съобщения"

#: src/fe-gtk/setup.c:259
msgid "Quit:"
msgstr "Изход:"

#: src/fe-gtk/setup.c:260
msgid "Leave channel:"
msgstr "Напускане на стая"

#: src/fe-gtk/setup.c:261
msgid "Away:"
msgstr "Няма ме:"

#: src/fe-gtk/setup.c:263
msgid "Away"
msgstr "\"Няма ме\""

#: src/fe-gtk/setup.c:264
msgid "Announce away messages"
msgstr "Обявяване на съобщенията за статуса \"Няма ме\""

#: src/fe-gtk/setup.c:265
msgid "Announce your away messages to all channels"
msgstr "Обявяване на статуса \"Няма ме\" във всички стаи"

#: src/fe-gtk/setup.c:266
msgid "Show away once"
msgstr "Показване на съобщението за липса само веднъж"

#: src/fe-gtk/setup.c:266
msgid "Show identical away messages only once"
msgstr "Показване на еднаквите съобщения за липса само веднъж"

#: src/fe-gtk/setup.c:267
msgid "Automatically unmark away"
msgstr "Автоматично махане на статуса \"Няма ме\""

#: src/fe-gtk/setup.c:267
msgid "Unmark yourself as away before sending messages"
msgstr "Отбелязване, че вече не сте в режим \"Няма ме\" преди да избращате съобщения"

#: src/fe-gtk/setup.c:270
msgid "(Can be a text file relative to ~/.xchat2/)."
msgstr "(може да е текстов файл с адрес относителен към ~/.xchat2/)"

#: src/fe-gtk/setup.c:272
msgid "(Can be a text file relative to config dir)."
msgstr "(може да е текстов файл с адрес относителен към папка с настройките)"

#: src/fe-gtk/setup.c:276
msgid "Alerts"
msgstr "Звукови уведомявания"

#: src/fe-gtk/setup.c:278
msgid "Flash taskbar on highlighted messages"
msgstr ""

#: src/fe-gtk/setup.c:280
msgid "Beep on highlighted messages"
msgstr "Бибиткане при осветени съобщения"

#: src/fe-gtk/setup.c:281
msgid "Extra words to highlight on:"
msgstr "Допълнителни думи, които да се осветяват:"

#: src/fe-gtk/setup.c:282
msgid "(Separate multiple words with commas)."
msgstr "(Ако са повече от една дума - разделете със запетаи)"

#: src/fe-gtk/setup.c:283
msgid "Beep on private messages"
msgstr "Бибиткане при лични съобщения"

#: src/fe-gtk/setup.c:284
msgid "Beep on channel messages"
msgstr "Бибиткане при съобщения в стая"

#: src/fe-gtk/setup.c:291
msgid "Advanced Settings"
msgstr "Подробни настройки"

#: src/fe-gtk/setup.c:292
msgid "Auto reconnect delay:"
msgstr "Изчакване преди автоматично свързване:"

#: src/fe-gtk/setup.c:293
msgid "Display MODEs in raw form"
msgstr "Показване на режимите в чиста форма"

#: src/fe-gtk/setup.c:294
msgid "Whois on notify"
msgstr "Пускане на \"Кой е ...?\" при появяване"

#: src/fe-gtk/setup.c:294
msgid "Sends a /WHOIS when a user comes online in your notify list"
msgstr "Изпращане на /WHOIS , когато потребител от списъка с приятелчета стане на линия"

#: src/fe-gtk/setup.c:295
msgid "Hide join and part messages"
msgstr "Скриване на кой влиза и излиза"

#: src/fe-gtk/setup.c:295
msgid "Hide channel join/part messages by default"
msgstr "По подразбиране да се скриват съобщенията за влизане и излизане от стаите"

#: src/fe-gtk/setup.c:296
msgid "Auto Open DCC Windows"
msgstr "Автоматично отваряне на DCC прозорци"

#: src/fe-gtk/setup.c:297
msgid "Send window"
msgstr "Прозореца за изпращане на файлове"

#: src/fe-gtk/setup.c:298
msgid "Receive window"
msgstr "Прозореца за получване на файлове"

#: src/fe-gtk/setup.c:299
msgid "Chat window"
msgstr "Прозореца за разговори"

#: src/fe-gtk/setup.c:307 src/fe-gtk/setup.c:1451
msgid "Logging"
msgstr "Записване на разговори"

#: src/fe-gtk/setup.c:308
msgid "Enable logging of conversations"
msgstr "Включване на записването на разговори"

#: src/fe-gtk/setup.c:309
msgid "Log filename mask:"
msgstr ""
"Маска на файловото име на\n"
"записа на разговор:"

#: src/fe-gtk/setup.c:310
#, c-format
msgid "(%s=Server %c=Channel %n=Network)."
msgstr "(%s=Сървър %c=Стая/Прякор %n=Мрежа)."

#: src/fe-gtk/setup.c:313
msgid "Insert timestamps in logs"
msgstr ""
"Вмъква времето на репликите\n"
"в записаните разговори(логовете)"

#: src/fe-gtk/setup.c:314
msgid "Log timestamp format:"
msgstr "Формат на отбелязване на времето:"

#: src/fe-gtk/setup.c:315
msgid "(See strftime manpage for details)."
msgstr "(вижте man страницата за strftime за повече информация)."

#: src/fe-gtk/setup.c:322
msgid "(Disabled)"
msgstr "(изключено)"

#: src/fe-gtk/setup.c:323
msgid "Wingate"
msgstr "Wingate"

#: src/fe-gtk/setup.c:324
msgid "Socks4"
msgstr "Socks4"

#: src/fe-gtk/setup.c:325
msgid "Socks5"
msgstr "Socks5"

#: src/fe-gtk/setup.c:326
msgid "HTTP"
msgstr "HTTP"

#: src/fe-gtk/setup.c:332
msgid "Your Address"
msgstr "Вашият адрес"

#: src/fe-gtk/setup.c:333
msgid "Bind to:"
msgstr "Вързване към:"

#: src/fe-gtk/setup.c:334
msgid "(Only useful for computers with multiple addresses)."
msgstr "(Полезно само за компютри с множество адреси)"

#: src/fe-gtk/setup.c:336
msgid "Proxy Server"
msgstr "Прокси сървър"

#: src/fe-gtk/setup.c:337
msgid "Hostname:"
msgstr "Хост:"

#: src/fe-gtk/setup.c:338
msgid "Username:"
msgstr "Потребител:"

#: src/fe-gtk/setup.c:339
msgid "Password:"
msgstr "Парола:"

#: src/fe-gtk/setup.c:340
msgid "Port:"
msgstr "Порт:"

#: src/fe-gtk/setup.c:341
msgid "Type:"
msgstr "Вид:"

#: src/fe-gtk/setup.c:343
msgid "Authenticate to the proxy server (HTTP and Socks5)"
msgstr "Идентифициране пред прокси сървъра (HTTP и Socks5)"

#: src/fe-gtk/setup.c:566
msgid "(disabled)"
msgstr "(изключено)"

#: src/fe-gtk/setup.c:567
msgid "A star (*)"
msgstr "Звезда (*)"

#: src/fe-gtk/setup.c:568
msgid "A red star (*)"
msgstr "Червена звезда (*)"

#: src/fe-gtk/setup.c:569
msgid "Underlined"
msgstr "Подчертано"

#: src/fe-gtk/setup.c:666
msgid "Select an Image File"
msgstr "Избор на файл с Изображение"

#: src/fe-gtk/setup.c:702
msgid "Select font"
msgstr "Избор на шрифт"

#: src/fe-gtk/setup.c:776
msgid "Browse..."
msgstr "Разглеждане..."

#: src/fe-gtk/setup.c:893
msgid "Mark identified users with:"
msgstr "Маркиране на регистрираните потребители с:"

#: src/fe-gtk/setup.c:895
msgid "Mark not-identified users with:"
msgstr "Маркиране на нерегистрираните потребители с:"

#: src/fe-gtk/setup.c:958
msgid "Select color"
msgstr "Избор на цвят"

#: src/fe-gtk/setup.c:1038
msgid "Text Colors"
msgstr "Цветове за текста"

#: src/fe-gtk/setup.c:1040
msgid "mIRC colors:"
msgstr "Цветове на mIRC:"

#: src/fe-gtk/setup.c:1048
msgid "Extra colors:"
msgstr "Допълнителни цветове:"

#: src/fe-gtk/setup.c:1056 src/fe-gtk/setup.c:1061
msgid "Foreground:"
msgstr "Цвят:"

#: src/fe-gtk/setup.c:1057 src/fe-gtk/setup.c:1062
msgid "Background:"
msgstr "Фон:"

#: src/fe-gtk/setup.c:1059
msgid "Marking Text"
msgstr ""

#: src/fe-gtk/setup.c:1064
msgid "Interface Colors"
msgstr "Цветовете на интерфейса"

#: src/fe-gtk/setup.c:1066
msgid "New data:"
msgstr "Нови данни:"

#: src/fe-gtk/setup.c:1067
msgid "Marker line:"
msgstr "Отбелязваща линия:"

#: src/fe-gtk/setup.c:1068
msgid "New message:"
msgstr "Ново съобщение:"

#: src/fe-gtk/setup.c:1069
msgid "Away user:"
msgstr "Липсващ потребител:"

#: src/fe-gtk/setup.c:1070
msgid "Highlight:"
msgstr "Осветявания:"

#: src/fe-gtk/setup.c:1166 src/fe-gtk/textgui.c:337
msgid "Event"
msgstr "Събитие"

#: src/fe-gtk/setup.c:1172
msgid "Sound file"
msgstr "Звуков файл"

#: src/fe-gtk/setup.c:1207
msgid "Select a sound file"
msgstr "Избор на звуков файл"

#: src/fe-gtk/setup.c:1279
msgid "Sound playing method:"
msgstr "Метод за пускане на звуци:"

#: src/fe-gtk/setup.c:1287
msgid "External sound playing _program:"
msgstr "Външна програма за пускане на звуци:"

#: src/fe-gtk/setup.c:1305
msgid "_External program"
msgstr "_Външни програми"

#: src/fe-gtk/setup.c:1315
msgid "_Automatic"
msgstr "_Автоматично"

#: src/fe-gtk/setup.c:1328
msgid "Sound files _directory:"
msgstr "Папка със звуковите файлове:"

#: src/fe-gtk/setup.c:1367
msgid "Sound file:"
msgstr "Звуков файл:"

#: src/fe-gtk/setup.c:1382
msgid "_Browse..."
msgstr "_Разглеждане..."

#: src/fe-gtk/setup.c:1393
msgid "_Play"
msgstr "_Изпълнение"

#: src/fe-gtk/setup.c:1442
msgid "Interface"
msgstr "Интерфейс"

#: src/fe-gtk/setup.c:1443
msgid "Text box"
msgstr "Поле за текста"

#: src/fe-gtk/setup.c:1444
msgid "Input box"
msgstr "Поле за писане"

#: src/fe-gtk/setup.c:1445
msgid "User list"
msgstr "Списък с потребителите"

#: src/fe-gtk/setup.c:1447
msgid "Colors"
msgstr "Цветове"

#: src/fe-gtk/setup.c:1449
msgid "Chatting"
msgstr "Разговаряне"

#: src/fe-gtk/setup.c:1450
msgid "General"
msgstr "Общи"

#: src/fe-gtk/setup.c:1452
msgid "Sound"
msgstr "Звук"

#: src/fe-gtk/setup.c:1455
msgid "Network"
msgstr "Мрежа"

#: src/fe-gtk/setup.c:1456
msgid "Network setup"
msgstr "Настройки на мрежата"

#: src/fe-gtk/setup.c:1457
msgid "File transfers"
msgstr "Файлови трансфери"

#: src/fe-gtk/setup.c:1564
msgid "Categories"
msgstr "Категории"

#: src/fe-gtk/setup.c:1694
msgid "Some settings were changed that require a restart to take full effect."
msgstr "Някои от променените настройки изискват рестартиране на програмата преди да влезнат в действие."

#: src/fe-gtk/setup.c:1722
msgid "X-Chat: Preferences"
msgstr "Настройки на X-Chat"

#: src/fe-gtk/textgui.c:160
msgid "There was an error parsing the string"
msgstr "Имаше грешка при обработването на низа"

#: src/fe-gtk/textgui.c:168
#, c-format
msgid "This signal is only passed %d args, $%d is invalid"
msgstr "На този сигнал се подават само %d аргумента, $%d е невалиден"

#: src/fe-gtk/textgui.c:276 src/fe-gtk/textgui.c:299
msgid "Print Texts File"
msgstr "Разпечатване на текстов файл"

#: src/fe-gtk/textgui.c:340
msgid "$ Number"
msgstr "$ Номер"

#: src/fe-gtk/textgui.c:350
msgid "Edit Events"
msgstr "Редактиране на събития"

#: src/fe-gtk/textgui.c:418
msgid "Save As"
msgstr "Записване като..."

#: src/fe-gtk/textgui.c:423
msgid "Load From"
msgstr "Зареждане от"

#: src/fe-gtk/textgui.c:428
msgid "Test All"
msgstr "Тестване на всички"

#: src/fe-gtk/urlgrab.c:97
msgid "URL"
msgstr "URL"

#: src/fe-gtk/urlgrab.c:147
msgid "Select a file to save to"
msgstr ""
"Изберете файлово име, под\n"
"което да се запази"

#: src/fe-gtk/urlgrab.c:187
msgid "X-Chat: URL Grabber"
msgstr "X-Chat: Улавяне на URL-та"

#: src/fe-gtk/urlgrab.c:200
msgid "Clear list"
msgstr "Изчистване на списъка"

#: src/fe-gtk/urlgrab.c:202
msgid "Copy"
msgstr "Копиране"

#: src/fe-gtk/urlgrab.c:204
msgid "Save list to a file"
msgstr "Запазване на списък във файл"

#: src/fe-gtk/userlistgui.c:108
#, c-format
msgid "%d ops, %d total"
msgstr "%d оператора, %d общо"

#~ msgid "ALLCHANL <cmd>, sends a command to all channels you're in"
#~ msgstr "ALLCHAN <команда>, изпраща команда към всички присъединени стаи"

#~ msgid "%C22*%O$tReceived a CTCP Sound $1 from $2 (to $3)"
#~ msgstr "%C22*%O$tПолучен звук CTCP $1 от $2 (до $3)"

#~ msgid "Away Msg: %s"
#~ msgstr "Съобщение \"Няма ме\": %s"

#~ msgid "Nicks not to highlight on:"
#~ msgstr "Прякори, които да не се осветяват:"

#, fuzzy
#~ msgid "%C22*%O$t%C28[%O$1%C28] %O$2"
#~ msgstr "-%C10-%C11-%O$t%C12[%O$1%C12] %O$2"

#~ msgid "Former Czechoslovakia"
#~ msgstr "Бившата Чехословакия"

#~ msgid "Zaire"
#~ msgstr "Заир"

#~ msgid "Delete All"
#~ msgstr "Изтрива всички"

#, fuzzy
#~ msgid "%C18*%O%C18$t$1 $2%O"
#~ msgstr "%C13*%O$t$1%O $2%O"

#, fuzzy
#~ msgid "%C24,18 %B-- Notify List --------------- %O"
#~ msgstr "%C08,02 %B-- Списък с приятелчета --------------- %O"

#, fuzzy
#~ msgid "-%C26-%C27-%O$t%C28[%O$1%C28] %O$2%C27 $3%O"
#~ msgstr "-%C10-%C11-%O$t%C12[%O$1%C12] %O$2 %C11$3%O"

#, fuzzy
#~ msgid "%C23[%O$1%O%C23]%O$t$2%O"
#~ msgstr "%C2<%O$1%C2>%O$t$2%O"

#~ msgid "Settings for %s"
#~ msgstr "Настройки за %s"

#~ msgid "_Remove \"%s\""
#~ msgstr "Премахва \"%s\""

#~ msgid "_Add new server"
#~ msgstr "Добавя нов сървър"

#~ msgid "Move \"%s\" _down"
#~ msgstr "Премести·\"%s\"·надолу"

#~ msgid "Move \"%s\" _up"
#~ msgstr "Премести \"%s\" нагоре"

#~ msgid "_Add new network"
#~ msgstr "Добавя нова мрежа"

#~ msgid "Nick Names:"
#~ msgstr "Прякори:"

#~ msgid "User Name:"
#~ msgstr "Потребителско име:"

#~ msgid "Servers"
#~ msgstr "Сървъри"

#~ msgid "Join Channels:"
#~ msgstr "Влиза в канали:"

#~ msgid "Command to execute after connecting. Can be used to authenticate to NickServ"
#~ msgstr "Команда за изпълнение след свързване. Може да бъде използвано да се идентифицирате пред NickServ"

#~ msgid "Cycle until connected"
#~ msgstr "Пробва се следващия сървър докато се свърже"

#~ msgid "Use secure SSL"
#~ msgstr "Използва сигурен SSL"

#~ msgid "Settings for Selected Network"
#~ msgstr "Настройки за избраната мрежа"

#~ msgid "Edit mode"
#~ msgstr "Режим \"Редакция\""

#~ msgid "-%C10-%C11-%O$t$1%O"
#~ msgstr "-%C10-%C11-%O$t$1%O"

#~ msgid "-%C10-%C11-%O$t%C12[%O$1%C12]%C $2"
#~ msgstr "-%C10-%C11-%O$t%C12[%O$1%C12]%C $2"

#~ msgid "Lists"
#~ msgstr "Списъци"

#~ msgid "Pop new tabs to front"
#~ msgstr "Изкарва новите табове най-отпред"
pre>
a6cc734b ^
4a6ceffb ^



























83032b1a ^
4a6ceffb ^






4c1fd3ee ^
4a6ceffb ^
































05a6097d ^
4a6ceffb ^











83032b1a ^
4a6ceffb ^







05a6097d ^
4a6ceffb ^







ed034bf8 ^
4a6ceffb ^
ed034bf8 ^
4a6ceffb ^
ed034bf8 ^





4a6ceffb ^


ed034bf8 ^

4a6ceffb ^



ed034bf8 ^
4a6ceffb ^


ed034bf8 ^
4a6ceffb ^
ed034bf8 ^
05a6097d ^
ed034bf8 ^

4a6ceffb ^
ed034bf8 ^
4a6ceffb ^


ed034bf8 ^
4a6ceffb ^
















4a6ceffb ^









































4af62462 ^
4a6ceffb ^










0f828dd7 ^








4a6ceffb ^

0f828dd7 ^













































4a6ceffb ^

























ce09cb4a ^
4a6ceffb ^

fa1eb92a ^

4a6ceffb ^










1f069228 ^



4a6ceffb ^
1f069228 ^
4a6ceffb ^

1f069228 ^


4a6ceffb ^









1f069228 ^

4a6ceffb ^



46e449f1 ^

4a6ceffb ^




4a6ceffb ^







83032b1a ^
4a6ceffb ^



















a6cc734b ^




4a6ceffb ^



83032b1a ^
4a6ceffb ^


83032b1a ^
4a6ceffb ^
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
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002














                                                                       
                                                                            






                                                                            
                          







                                                                                 
 
                   
                              

                           
                               
                          
                              
                   
                  
                  




                                                  

                    
                         

                   


                        



                   
                                                                 
 

                                                          














                                           

                         


                                                           
                                                   




                   
                               













                                        

                                                                            

                                                          



                                                                                                                                  

                                                                                                     



                                                                              
                                                                                    
                                                           






                                 

                                                                           
                                                                                                       

                                                                                                
                                                                                         

                                                                                            



                                                                                                                          
                                                                                                                                  
 

                                                     















                                                                        
      
 
                                                                                           
 



                                             

                   
                     




                                       
 



                                                                 
 




                                  
 
                          
         

                                                              
         

                                                                      
         



















                                                                                              
 







                                                                                             
         
                                                


           


                                                        





















































                                                                                             


                                                                             
                                 








                                                                                      
          
                                                                                 

                  

                   
 


                         



                                            















                                                                                   



                     

                                                                      
 
                      
 
                   
         
                               
 




                                                                                         
































                                                                                                              

                                                                                                 



                              
 

                                                                          


                   






                                                                                                                         




                                                                 


           

                                                    
                                                           

 


                                                    
                                                           

 











                                   
                                 

                              
                             







                                   








                                            
                                                         
 











                                                                                                            








                                                             

                                            
 

                                       
 


                                                                               
 
                                                             

                                                   
                                                                 
                 
 

                                       
















                                                                    


                                                          
                                                          
         
                                                                                   



                                                              

                                                                                                       















                                                                                                                                                     
                                              



















                                                                   
                                      






















                                                    
                                               












                                                                                      
                                                                               

























































                                                           

                                                                     







                                                                            
                                                        













                                                                        
                                               

                                   



                                                      



                                                                                   
                                                                  




                                                           
                                                                             
                                                                                                                                     
                                                                                                                 
 
                                                          
 
                                                                     



                                                   
                                                                  
                                                                                                                                              
                                                                  
                                                                                                                                              
                                                                       
                                                                                                                             
                                                                      
                                                                                                                             
                                                                      
                                                                                                                             
                                                                        

















                                                                                                                             
                                                                                





                                                   
                                         
 







                                                            

                                                                                                                   
 

                                                                         















                                                                         



                                                             
                                         
                                                         



                                                                  
                                                                                     








                                                                                                                       
                                                  

                                                                                                                 


         





















                                             
                                                                        

                        

                     
                           

                                    
 


                                                              
         

                                                                                         
                 

                                                           
                                      
                 









                                                        

                                     

























                                                                                           

                                                     






                                                    

         






                                                                                  

                                                            













                                                                             
                                                     

                                      
                         
         
 


                                                                      
 

                                                                            






                                        
                                                       



                                                              
                                                                                             




                       



                                                                 
                                                           
                                                                             
                 
                            



                                                                                      


                                       











                                            
                                                               
















































                                                                                                     
                                                                                                       



                    
                                                     


                                                                                            
                                                                                                      




                                                  






                                                       
                                           

                                                             





                                                                         
                                                                                    





                                                                                   
                                                                                                                                   












                                                                                
                                                                 




                                  

                                                            






































































                                                                                       
                                                                                      

                       

                                                 


















































































































































                                                                                                                 

                          
                


                               
 

                                                                                                                                   
 
                                                                                                                   
         
                                              

                       

                       
         

                                                     
         
 


                                                   

                                              



                                                                                                                                                
         
                                  
         
 
















                                                                                                                                    
         

















                                                                 
                                          
                                  

         


                                                  




                                                                                                     
                                             
                                       
 
                                                                       

                                 









                                                     
                                                                       

 









                                                 



                                               

                                          
 
                                                                        
                                                                                        
 



                                                                                                

                                      
                         

         










                                                                                                                                     






                                             

                                          
                    
 
                                                                        
 



                                                                                                               

                                      
                         

         









                                                       







                                                                                                                                   








                                                                                               




                              
                                                                                        

                                                      
                                              
         
                                                   


                                                           
                                    
                                                                                 
         



                                                     
                                                                         
                                                                   
                                                            
                                                                
         



                                                                         
                                                                                           


                       
                            
                                  

                              
                              
 
                                                                               

                                                                                 
 
                                 
                                                               
         






                                                
         

                                
 
                                                     
                                                                                                        
 

                                      
                







                                                         

                                        
                      





                                           
                                                                     
 
                                                                                          

                                                                               
                                                                                            
         




                                                                       
                                    


                                                         
                                    


                    

 


























                                                                     
                                                          








                                                   
                                                          





                                          






                                                                    

                                                                 
















                                                             

















                                                                                                      
                                               



                                                                                      


                                                                      




                                                                                      


                                                                    








                                                                    
                                        



                         





                                                                    
                            
                      
 
                                                               


                                    
                                                                     







                                                                               

                                                                                                                                 













                                                                                                                                                             
                                                         
















                                                                                                                 







                                                                                
                                                                                  
                                                                                                                      
                                                           








                                                            

                                                                                      
         



                                                            
                 
                                                
                         
                                                                                  

                                                                                                                    
                                                             
                         
 


                                                                   
 


                                                          
 


                                                           
 
                                                                      
 


                                                            
                 
                             



                                              

















                                                                                 
                           





                                                                                                                         
 
                             
         




                                          
                                                            




















                                                                       

                                   
                                                                              


















                                                                     
                                                                                   











                                                                       


                                           




                                                            







                                                   
                                                                                       
                                                          
                                                         


                                                                                     

                 






                                                             










                                                             
                                                                                          






                                                                                                                  











                                                                   
                                                               


                                                                              
                                                                    















                                                                                      
                                                                             





                                                                  
                                                                     
                                                  







                                                                 
                                                                    



                                                                  
                                                                     
                                                  




















                                                                                
                                                    




























































                                                                                             
                                   






































                                                                                                     

            
         
                                                                                              
                             






























                                                                                                       
                        
                 
                                                                                      



                                         

                                                                                                                                 

                                                                                                              

                                                              

                      
      






                                                                                                   
                          









                                                                                


                                                                                  
                                                                 


                                                                                


                                                                                  
                                                                 





                     






























                                                                                                  

                                            
                                     


                                     
                                                


                                                
                                                                  






                                                                                                    
                                                                                               

                                                                                           





                                                                                                                
                                                                                             


                                                                                                     
                                                  











                                                                               
                                                                  
                                                                                            

                                       
                                                                           
































                                                                                                                                 













                             
                                   








                                               

                                                                           
                                                                                                       
 
                  



                                
                                    
                                               

                           
                                             


                                 



                     

                       


                                      














                                                                                                   
                                                    







                                            






                                                            

                                         
                                                    
                                                      


                                                 
                                                                                     
                                 




                                                                        
                                 

                         

                            
         
 


                                                                             




                            

                              
            
                                                  
 


                       


                                                       







                                                          
                                                     



                                                                                       
                                                                                                                















                                                                                                               

                               


                    

                                                                          
                                                                                                                                       
 
                                                                  
                                        
 
                     





                                                                           
                                                                                                  


                                
                                   



                                                           
                                                                             













                                                                                                                    

                                                                                       

         

                                                                                         
         

                                                 
 
                                                                                         
 


                                        
         











                                                                                
                                                                                         
 





                                                                            
                                                             














                                                                                                                  

                                     


                             
        
 



















                                                                                          
















                                                                   





                                                        
                                                        

















































                                                                                         

                                                                  

                                                                                     


                                                                                                                
                                                                                                                 







                                     


                                   




                                  









                                                                                 




                                                                                       
                                                


                                         




























                                                                                                                       

                                                                                      
                                     



                                               
                                                        



                                                 















                                                                                                                                     
                                                                      

























                                                                                           
                                                                              












                                                                                            
                                                                              








                                                                                            
                                                     





                                                                             


                                                                                                
                                             







































                                                                                                              





                                           
                                             















                                                                                  

                                                       



                                              
                                             




                                                                     

                                                       



                                              
                                             




                                                                                           

                                              




                                                                                  
                                             

























                                                                                
                                             




                                                                 
                                             







                                                                                         
                                                                                    






                                                                                       
                                     




                                                    

                                                                                    
                                     

                                  
                                                 







                                                           


                                                             
                                     




                                                                




                                                         




                                                          
                                     













                                                                  
                             
 
                              


































                                                                                                            














                                                                      

                         











                                                      














                                                                                     
























                                                                                                





                                                              











                                                         

                                                                                                     






















































                                                                                                               
                     
 
                     
         


                                                                                     
         
                    









                                                                                                             
                               


                                                       





                                                           
                     


















                                                                                 
                                                                                                              




























                                                                                                                      
                         





                                










                                                                                    



                                       



                                                                                                                                                            






                                                                                         
                                                                                                                                      


                                                                                                                      
                                                                                




                                                                                 
                                                                                                                       

























                                                                                          


                                             
                                               

         
                                                        




                                                           
                                                                                        


































                                                                         
                                                                                    





                                                                            
                                                                                                                          











                                                     










                                                           

                                                                     



                                                                          
                                                                                    

                                  


                                             
                                                        





                                                              
                                                               

                        


                          
                                               


                                     





                                      
                                                                





                                                                
                                                               



                                                           
                                                                                















                                                                                                           
                                                                                                                

                                        
                             









                                                          
                        

                      

                                     

                                               


                                                                                               
                         
         


                             



                                                                               
                                                                                                       
                                     



                                              
                                              












                                                                       

                                                                                         








                                                                                    
                                                          














































                                                                                             
                                                                        
                         
                                    





                                       
                                                        

                                 
                                                                                   



                                   
                    

















                                                                                   

                                                                                    


















































                                                                                                                         
                                                               

























                                                              
                                          
                         
 
                                                       




                                                                                   
                                                                            



                                                                                         
                                                                                










                                                                 
                                                              

                                           
                                                  


                                                      
                 
                                                     
         

                                  


























                                                                                                                     


                       
      
 
























                                                                                                                 
                                    
 
                                                         
         




























                                                                                        





                                                                                                
 




                                                             
                                             

                                     
                     












                                           


                                                                                             





                                                
                                                            

                                                                               

                                                                                  




























                                                                                                                                              
                                                            





                                               
















                                                                                                                                              







                                              
                                 








                                                      

                                                                      








                                                              

                                                                       







                                                           

                                                    





                                             

                                            




                                                     
                                                 







                                                 
                                               



                                                  


                                                          





                                                                               

                                          

                   



                             
 
                                                                                    
 


                                                               
         





                                                                                                
                                                        





                                     
                                    
                 












                                                                                 

                                                                                  
 


                                
                       
 




                     

                                      
                 
                                                 

                              


                                    

                                             
 

                     
         

                                    
                 
                                               
                              
                 

                                    




                                             
         
 



                                                              
 
                                                                      

                                                              






                                                                                                                
         
                          


                                                                                        
                                                                                                                           








                                             
                                  
































                                                                                                                 
                             
         
 
                                   
                                        






                                                                                           








                                                                                                  











                                                                  
                                   



































                                                                               
                                             













































                                                                                                         
                                             



















                                                                                                   
         

                                                            
 

                                                                                            
                 


                                                             
                         



                                                                                     






















                                                                                                      



                                                                                    



























                                                                                                        
 


                                                                                          

















                                                                                                              

                                                               
                                                                                 
                                 

                                                                                      
                         
 






                                                                               
                                                                                                  












                                                                         
                                                                
                 
                                                        
                 
                                                            


                                                    
                                                                                 


                                          
                         
                 
                                                      

         

                                                   
                               
 


                   








                                                
                                                       

                                             
                               




                                                                          
                                                                            
                                                                            
                                                      


















                                                                         













                                          

                                                                    


                             
                          











                                                                           

                                                           
 

                                                                                                                 

                                      
                                                  

                                                           








                                                                                
                                            
                                                                       
                                         













                                                                                                                                                      

                                
         
                                                                             


                                           

                                       



                                                                     
         



























                                                                                                          
                                                                       






                                                           
                                                                            
































                                                                                   
                                                                                











                                                              
                                                      







                                                              
                                                 







                                       
 
   
                                                                
 





                                      


                   

                                                           



                                                            
                         


                                                                                                                                      
                         
                            
                         
                                                                                  

                         
                                                           
                                                                                       


                                
                                                               
















                                                                       









































                                                                       
                                                                                                 










                                                           








                                              

                                            













































                                                                                

























                                                                      
                                                          

                                                        

                                                                               










                                                         



                                           
                          
                                                                               

                                            


                                                                              









                                                                                  

                                                                                                                         



                                                   

                                                                      




                                                              







                                      
                                       



















                                                             




                                            



                                 
                             


                           
                     
 
/* X-Chat
 * Copyright (C) 1998 Peter Zelezny.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 * =========================================================================
 *
 * xtext, the text widget used by X-Chat.
 * By Peter Zelezny <zed@xchat.org>.
 *
 */

#define GDK_MULTIHEAD_SAFE
#define MARGIN 2						/* dont touch. */
#define REFRESH_TIMEOUT 20
#define WORDWRAP_LIMIT 24

#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <time.h>

#include "config.h"
#include "../common/hexchat.h"
#include "../common/fe.h"
#include "../common/util.h"
#include "../common/hexchatc.h"
#include "../common/url.h"
#include "../common/marshal.h"
#include "fe-gtk.h"
#include "xtext.h"
#include "fkeys.h"

#define charlen(str) g_utf8_skip[*(guchar *)(str)]

#ifdef WIN32
#include <windows.h>
#include <io.h>
#include <gdk/gdk.h>
#include <gdk/gdkwin32.h>
#else
#include <unistd.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
#endif

/* is delimiter */
#define is_del(c) \
	(c == ' ' || c == '\n' || c == '>' || c == '<' || c == 0)

/* force scrolling off */
#define dontscroll(buf) (buf)->last_pixel_pos = 0x7fffffff

static GtkWidgetClass *parent_class = NULL;

struct textentry
{
	struct textentry *next;
	struct textentry *prev;
	unsigned char *str;
	time_t stamp;
	gint16 str_width;
	gint16 str_len;
	gint16 mark_start;
	gint16 mark_end;
	gint16 indent;
	gint16 left_len;
	GSList *slp;
	GSList *sublines;
	guchar tag;
	guchar pad1;
	guchar pad2;	/* 32-bit align : 44 bytes total */
	GList *marks;	/* List of found strings */
};

enum
{
	WORD_CLICK,
	SET_SCROLL_ADJUSTMENTS,
	LAST_SIGNAL
};

/* values for selection info */
enum
{
	TARGET_UTF8_STRING,
	TARGET_STRING,
	TARGET_TEXT,
	TARGET_COMPOUND_TEXT
};

static guint xtext_signals[LAST_SIGNAL];

char *nocasestrstr (const char *text, const char *tofind);	/* util.c */
int xtext_get_stamp_str (time_t, char **);
static void gtk_xtext_render_page (GtkXText * xtext);
static void gtk_xtext_calc_lines (xtext_buffer *buf, int);
static char *gtk_xtext_selection_get_text (GtkXText *xtext, int *len_ret);
static textentry *gtk_xtext_nth (GtkXText *xtext, int line, int *subline);
static void gtk_xtext_adjustment_changed (GtkAdjustment * adj,
														GtkXText * xtext);
static void gtk_xtext_scroll_adjustments (GtkXText *xtext, GtkAdjustment *hadj,
										GtkAdjustment *vadj);
static int gtk_xtext_render_ents (GtkXText * xtext, textentry *, textentry *);
static void gtk_xtext_recalc_widths (xtext_buffer *buf, int);
static void gtk_xtext_fix_indent (xtext_buffer *buf);
static int gtk_xtext_find_subline (GtkXText *xtext, textentry *ent, int line);
/* static char *gtk_xtext_conv_color (unsigned char *text, int len, int *newlen); */
/* For use by gtk_xtext_strip_color() and its callers -- */
struct offlen_s {
	guint16 off;
	guint16 len;
	guint16 emph;
	guint16 width;
};
typedef struct offlen_s offlen_t;
static unsigned char *
gtk_xtext_strip_color (unsigned char *text, int len, unsigned char *outbuf,
							  int *newlen, GSList **slp, int strip_hidden);
static gboolean gtk_xtext_check_ent_visibility (GtkXText * xtext, textentry *find_ent, int add);
static int gtk_xtext_render_page_timeout (GtkXText * xtext);
static int gtk_xtext_search_offset (xtext_buffer *buf, textentry *ent, unsigned int off);
static GList * gtk_xtext_search_textentry (xtext_buffer *, textentry *);
static void gtk_xtext_search_textentry_add (xtext_buffer *, textentry *, GList *, gboolean);
static void gtk_xtext_search_textentry_del (xtext_buffer *, textentry *);
static void gtk_xtext_search_textentry_fini (gpointer, gpointer);
static void gtk_xtext_search_fini (xtext_buffer *);
static gboolean gtk_xtext_search_init (xtext_buffer *buf, const gchar *text, gtk_xtext_search_flags flags, GError **perr);
static char * gtk_xtext_get_word (GtkXText * xtext, int x, int y, textentry ** ret_ent, int *ret_off, int *ret_len, GSList **slp);

/* Avoid warning messages for this unused function */
#if 0
/* gives width of a 8bit string - with no mIRC codes in it */

static int
gtk_xtext_text_width_8bit (GtkXText *xtext, unsigned char *str, int len)
{
	int width = 0;

	while (len)
	{
		width += xtext->fontwidth[*str];
		str++;
		len--;
	}

	return width;
}
#endif

#define xtext_draw_bg(xt,x,y,w,h) gdk_draw_rectangle(xt->draw_buf, xt->bgc, 1, x, y, w, h);

/* ======================================= */
/* ============ PANGO BACKEND ============ */
/* ======================================= */

#define EMPH_ITAL 1
#define EMPH_BOLD 2
#define EMPH_HIDDEN 4
static PangoAttrList *attr_lists[4];
static int fontwidths[4][128];

static PangoAttribute *
xtext_pango_attr (PangoAttribute *attr)
{
	attr->start_index = PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING;
	attr->end_index = PANGO_ATTR_INDEX_TO_TEXT_END;
	return attr;
}

static void
xtext_pango_init (GtkXText *xtext)
{
	int i, j;
	char buf[2] = "\000";

	if (attr_lists[0])
	{
		for (i = 0; i < (EMPH_ITAL | EMPH_BOLD); i++)
			pango_attr_list_unref (attr_lists[i]);
	}

	for (i = 0; i < sizeof attr_lists / sizeof attr_lists[0]; i++)
	{
		attr_lists[i] = pango_attr_list_new ();
		switch (i)
		{
		case 0:		/* Roman */
			break;
		case EMPH_ITAL:		/* Italic */
			pango_attr_list_insert (attr_lists[i],
				xtext_pango_attr (pango_attr_style_new (PANGO_STYLE_ITALIC)));
			break;
		case EMPH_BOLD:		/* Bold */
			pango_attr_list_insert (attr_lists[i],
				xtext_pango_attr (pango_attr_weight_new (PANGO_WEIGHT_BOLD)));
			break;
		case EMPH_ITAL | EMPH_BOLD:		/* Italic Bold */
			pango_attr_list_insert (attr_lists[i],
				xtext_pango_attr (pango_attr_style_new (PANGO_STYLE_ITALIC)));
			pango_attr_list_insert (attr_lists[i],
				xtext_pango_attr (pango_attr_weight_new (PANGO_WEIGHT_BOLD)));
			break;
		}

		/* Now initialize fontwidths[i] */
		pango_layout_set_attributes (xtext->layout, attr_lists[i]);
		for (j = 0; j < 128; j++)
		{
			buf[0] = j;
			pango_layout_set_text (xtext->layout, buf, 1);
			pango_layout_get_pixel_size (xtext->layout, &fontwidths[i][j], NULL);
		}
	}
	xtext->space_width = fontwidths[0][' '];
}

static void
backend_font_close (GtkXText *xtext)
{
	pango_font_description_free (xtext->font->font);
}

static void
backend_init (GtkXText *xtext)
{
	if (xtext->layout == NULL)
	{
		xtext->layout = gtk_widget_create_pango_layout (GTK_WIDGET (xtext), 0); 
		if (xtext->font)
			pango_layout_set_font_description (xtext->layout, xtext->font->font);
	}
}

static void
backend_deinit (GtkXText *xtext)
{
	if (xtext->layout)
	{
		g_object_unref (xtext->layout);
		xtext->layout = NULL;
	}
}

static PangoFontDescription *
backend_font_open_real (char *name)
{
	PangoFontDescription *font;

	font = pango_font_description_from_string (name);
	if (font && pango_font_description_get_size (font) == 0)
	{
		pango_font_description_free (font);
		font = pango_font_description_from_string ("sans 11");
	}
	if (!font)
		font = pango_font_description_from_string ("sans 11");

	return font;
}

static void
backend_font_open (GtkXText *xtext, char *name)
{
	PangoLanguage *lang;
	PangoContext *context;
	PangoFontMetrics *metrics;

	xtext->font = &xtext->pango_font;
	xtext->font->font = backend_font_open_real (name);
	if (!xtext->font->font)
	{
		xtext->font = NULL;
		return;
	}

	backend_init (xtext);
	pango_layout_set_font_description (xtext->layout, xtext->font->font);
	xtext_pango_init (xtext);

	/* vte does it this way */
	context = gtk_widget_get_pango_context (GTK_WIDGET (xtext));
	lang = pango_context_get_language (context);
	metrics = pango_context_get_metrics (context, xtext->font->font, lang);
	xtext->font->ascent = pango_font_metrics_get_ascent (metrics) / PANGO_SCALE;
	xtext->font->descent = pango_font_metrics_get_descent (metrics) / PANGO_SCALE;
	pango_font_metrics_unref (metrics);
}
static int
backend_get_text_width_emph (GtkXText *xtext, guchar *str, int len, int emphasis)
{
	int width;
	int deltaw;
	int mbl;

	if (*str == 0)
		return 0;

	if ((emphasis & EMPH_HIDDEN))
		return 0;
	emphasis &= (EMPH_ITAL | EMPH_BOLD);

	width = 0;
	pango_layout_set_attributes (xtext->layout, attr_lists[emphasis]);
	while (len > 0)
	{
		mbl = charlen(str);
		if (*str < 128)
			deltaw = fontwidths[emphasis][*str];
		else
		{
			pango_layout_set_text (xtext->layout, str, mbl);
			pango_layout_get_pixel_size (xtext->layout, &deltaw, NULL);
		}
		width += deltaw;
		str += mbl;
		len -= mbl;
	}

	return width;
}

static int
backend_get_text_width_slp (GtkXText *xtext, guchar *str, GSList *slp)
{
	int width = 0;

	while (slp)
	{
		offlen_t *meta;

		meta = slp->data;
		width += backend_get_text_width_emph (xtext, str, meta->len, meta->emph);
		str += meta->len;
		slp = g_slist_next (slp);
	}

	return width;
}

/* simplified version of gdk_draw_layout_line_with_colors() */

static void 
xtext_draw_layout_line (GdkDrawable      *drawable,
								GdkGC            *gc,
								gint              x, 
								gint              y,
								PangoLayoutLine  *line)
{
	GSList *tmp_list = line->runs;
	PangoRectangle logical_rect;
	gint x_off = 0;

	while (tmp_list)
	{
		PangoLayoutRun *run = tmp_list->data;

		pango_glyph_string_extents (run->glyphs, run->item->analysis.font,
											 NULL, &logical_rect);

		gdk_draw_glyphs (drawable, gc, run->item->analysis.font,
							  x + x_off / PANGO_SCALE, y, run->glyphs);

		x_off += logical_rect.width;
		tmp_list = tmp_list->next;
	}
}

static void
backend_draw_text_emph (GtkXText *xtext, int dofill, GdkGC *gc, int x, int y,
						 char *str, int len, int str_width, int emphasis)
{
	GdkGCValues val;
	GdkColor col;
	PangoLayoutLine *line;

	pango_layout_set_attributes (xtext->layout, attr_lists[emphasis]);
	pango_layout_set_text (xtext->layout, str, len);

	if (dofill)
	{
		gdk_gc_get_values (gc, &val);
		col.pixel = val.background.pixel;
		gdk_gc_set_foreground (gc, &col);
		gdk_draw_rectangle (xtext->draw_buf, gc, 1, x, y -
									xtext->font->ascent, str_width, xtext->fontsize);
		col.pixel = val.foreground.pixel;
		gdk_gc_set_foreground (gc, &col);
	}

	line = pango_layout_get_lines (xtext->layout)->data;

	xtext_draw_layout_line (xtext->draw_buf, gc, x, y, line);
}

static void
xtext_set_fg (GtkXText *xtext, GdkGC *gc, int index)
{
	gdk_gc_set_foreground (gc, &xtext->palette[index]);
}

static void
xtext_set_bg (GtkXText *xtext, GdkGC *gc, int index)
{
	gdk_gc_set_background (gc, &xtext->palette[index]);
}

static void
gtk_xtext_init (GtkXText * xtext)
{
	xtext->pixmap = NULL;
	xtext->io_tag = 0;
	xtext->add_io_tag = 0;
	xtext->scroll_tag = 0;
	xtext->max_lines = 0;
	xtext->col_back = XTEXT_BG;
	xtext->col_fore = XTEXT_FG;
	xtext->nc = 0;
	xtext->pixel_offset = 0;
	xtext->underline = FALSE;
	xtext->hidden = FALSE;
	xtext->font = NULL;
	xtext->layout = NULL;
	xtext->jump_out_offset = 0;
	xtext->jump_in_offset = 0;
	xtext->ts_x = 0;
	xtext->ts_y = 0;
	xtext->clip_x = 0;
	xtext->clip_x2 = 1000000;
	xtext->clip_y = 0;
	xtext->clip_y2 = 1000000;
	xtext->urlcheck_function = NULL;
	xtext->color_paste = FALSE;
	xtext->skip_border_fills = FALSE;
	xtext->skip_stamp = FALSE;
	xtext->render_hilights_only = FALSE;
	xtext->un_hilight = FALSE;
	xtext->recycle = FALSE;
	xtext->dont_render = FALSE;
	xtext->dont_render2 = FALSE;
	gtk_xtext_scroll_adjustments (xtext, NULL, NULL);

	{
		static const GtkTargetEntry targets[] = {
			{ "UTF8_STRING", 0, TARGET_UTF8_STRING },
			{ "STRING", 0, TARGET_STRING },
			{ "TEXT",   0, TARGET_TEXT }, 
			{ "COMPOUND_TEXT", 0, TARGET_COMPOUND_TEXT }
		};
		static const gint n_targets = sizeof (targets) / sizeof (targets[0]);

		gtk_selection_add_targets (GTK_WIDGET (xtext), GDK_SELECTION_PRIMARY,
											targets, n_targets);
	}
}

static void
gtk_xtext_adjustment_set (xtext_buffer *buf, int fire_signal)
{
	GtkAdjustment *adj = buf->xtext->adj;

	if (buf->xtext->buffer == buf)
	{
		adj->lower = 0;
		adj->upper = buf->num_lines;

		if (adj->upper == 0)
			adj->upper = 1;

		adj->page_size = GTK_WIDGET (buf->xtext)->allocation.height /
							  buf->xtext->fontsize;
		adj->page_increment = adj->page_size;

		if (adj->value > adj->upper - adj->page_size)
		{
			buf->scrollbar_down = TRUE;
			adj->value = adj->upper - adj->page_size;
		}

		if (adj->value < 0)
			adj->value = 0;

		if (fire_signal)
			gtk_adjustment_changed (adj);
	}
}

static gint
gtk_xtext_adjustment_timeout (GtkXText * xtext)
{
	gtk_xtext_render_page (xtext);
	xtext->io_tag = 0;
	return 0;
}

static void
gtk_xtext_adjustment_changed (GtkAdjustment * adj, GtkXText * xtext)
{
	if (!gtk_widget_get_realized (GTK_WIDGET (xtext)))
		return;

	if (xtext->buffer->old_value != xtext->adj->value)
	{
		if (xtext->adj->value >= xtext->adj->upper - xtext->adj->page_size)
			xtext->buffer->scrollbar_down = TRUE;
		else
			xtext->buffer->scrollbar_down = FALSE;

		if (xtext->adj->value + 1 == xtext->buffer->old_value ||
			 xtext->adj->value - 1 == xtext->buffer->old_value)	/* clicked an arrow? */
		{
			if (xtext->io_tag)
			{
				g_source_remove (xtext->io_tag);
				xtext->io_tag = 0;
			}
			gtk_xtext_render_page (xtext);
		} else
		{
			if (!xtext->io_tag)
				xtext->io_tag = g_timeout_add (REFRESH_TIMEOUT,
															(GSourceFunc)
															gtk_xtext_adjustment_timeout,
															xtext);
		}
	}
	xtext->buffer->old_value = adj->value;
}

GtkWidget *
gtk_xtext_new (GdkColor palette[], int separator)
{
	GtkXText *xtext;

	xtext = g_object_new (gtk_xtext_get_type (), NULL);
	xtext->separator = separator;
	xtext->wordwrap = TRUE;
	xtext->buffer = gtk_xtext_buffer_new (xtext);
	xtext->orig_buffer = xtext->buffer;

	gtk_widget_set_double_buffered (GTK_WIDGET (xtext), FALSE);
	gtk_xtext_set_palette (xtext, palette);

	return GTK_WIDGET (xtext);
}

static void
gtk_xtext_destroy (GtkObject * object)
{
	GtkXText *xtext = GTK_XTEXT (object);

	if (xtext->add_io_tag)
	{
		g_source_remove (xtext->add_io_tag);
		xtext->add_io_tag = 0;
	}

	if (xtext->scroll_tag)
	{
		g_source_remove (xtext->scroll_tag);
		xtext->scroll_tag = 0;
	}

	if (xtext->io_tag)
	{
		g_source_remove (xtext->io_tag);
		xtext->io_tag = 0;
	}

	if (xtext->pixmap)
	{
		g_object_unref (xtext->pixmap);
		xtext->pixmap = NULL;
	}

	if (xtext->font)
	{
		backend_font_close (xtext);
		xtext->font = NULL;
	}

	if (xtext->adj)
	{
		g_signal_handlers_disconnect_matched (G_OBJECT (xtext->adj),
					G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, xtext);
	/*	gtk_signal_disconnect_by_data (G_OBJECT (xtext->adj), xtext);*/
		g_object_unref (G_OBJECT (xtext->adj));
		xtext->adj = NULL;
	}

	if (xtext->bgc)
	{
		g_object_unref (xtext->bgc);
		xtext->bgc = NULL;
	}

	if (xtext->fgc)
	{
		g_object_unref (xtext->fgc);
		xtext->fgc = NULL;
	}

	if (xtext->light_gc)
	{
		g_object_unref (xtext->light_gc);
		xtext->light_gc = NULL;
	}

	if (xtext->dark_gc)
	{
		g_object_unref (xtext->dark_gc);
		xtext->dark_gc = NULL;
	}

	if (xtext->thin_gc)
	{
		g_object_unref (xtext->thin_gc);
		xtext->thin_gc = NULL;
	}

	if (xtext->marker_gc)
	{
		g_object_unref (xtext->marker_gc);
		xtext->marker_gc = NULL;
	}

	if (xtext->hand_cursor)
	{
		gdk_cursor_unref (xtext->hand_cursor);
		xtext->hand_cursor = NULL;
	}

	if (xtext->resize_cursor)
	{
		gdk_cursor_unref (xtext->resize_cursor);
		xtext->resize_cursor = NULL;
	}

	if (xtext->orig_buffer)
	{
		gtk_xtext_buffer_free (xtext->orig_buffer);
		xtext->orig_buffer = NULL;
	}

	if (GTK_OBJECT_CLASS (parent_class)->destroy)
		(*GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}

static void
gtk_xtext_unrealize (GtkWidget * widget)
{
	backend_deinit (GTK_XTEXT (widget));

	/* if there are still events in the queue, this'll avoid segfault */
	gdk_window_set_user_data (widget->window, NULL);

	if (parent_class->unrealize)
		(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
}

static void
gtk_xtext_realize (GtkWidget * widget)
{
	GtkXText *xtext;
	GdkWindowAttr attributes;
	GdkGCValues val;
	GdkColor col;
	GdkColormap *cmap;

	gtk_widget_set_realized (widget, TRUE);
	xtext = GTK_XTEXT (widget);

	attributes.x = widget->allocation.x;
	attributes.y = widget->allocation.y;
	attributes.width = widget->allocation.width;
	attributes.height = widget->allocation.height;
	attributes.wclass = GDK_INPUT_OUTPUT;
	attributes.window_type = GDK_WINDOW_CHILD;
	attributes.event_mask = gtk_widget_get_events (widget) |
		GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
		| GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK;

	cmap = gtk_widget_get_colormap (widget);
	attributes.colormap = cmap;
	attributes.visual = gtk_widget_get_visual (widget);

	widget->window = gdk_window_new (widget->parent->window, &attributes,
												GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL |
												GDK_WA_COLORMAP);

	gdk_window_set_user_data (widget->window, widget);

	xtext->depth = gdk_window_get_visual (widget->window)->depth;

	val.subwindow_mode = GDK_INCLUDE_INFERIORS;
	val.graphics_exposures = 0;

	xtext->bgc = gdk_gc_new_with_values (widget->window, &val,
													 GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW);
	xtext->fgc = gdk_gc_new_with_values (widget->window, &val,
													 GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW);
	xtext->light_gc = gdk_gc_new_with_values (widget->window, &val,
											GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW);
	xtext->dark_gc = gdk_gc_new_with_values (widget->window, &val,
											GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW);
	xtext->thin_gc = gdk_gc_new_with_values (widget->window, &val,
											GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW);
	xtext->marker_gc = gdk_gc_new_with_values (widget->window, &val,
											GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW);

	/* for the separator bar (light) */
	col.red = 0xffff; col.green = 0xffff; col.blue = 0xffff;
	gdk_colormap_alloc_color (cmap, &col, FALSE, TRUE);
	gdk_gc_set_foreground (xtext->light_gc, &col);

	/* for the separator bar (dark) */
	col.red = 0x1111; col.green = 0x1111; col.blue = 0x1111;
	gdk_colormap_alloc_color (cmap, &col, FALSE, TRUE);
	gdk_gc_set_foreground (xtext->dark_gc, &col);

	/* for the separator bar (thinline) */
	col.red = 0x8e38; col.green = 0x8e38; col.blue = 0x9f38;
	gdk_colormap_alloc_color (cmap, &col, FALSE, TRUE);
	gdk_gc_set_foreground (xtext->thin_gc, &col);

	/* for the marker bar (marker) */
	gdk_gc_set_foreground (xtext->marker_gc, &xtext->palette[XTEXT_MARKER]);

	xtext_set_fg (xtext, xtext->fgc, XTEXT_FG);
	xtext_set_bg (xtext, xtext->fgc, XTEXT_BG);
	xtext_set_fg (xtext, xtext->bgc, XTEXT_BG);

	/* draw directly to window */
	xtext->draw_buf = widget->window;

	if (xtext->pixmap)
	{
		gdk_gc_set_tile (xtext->bgc, xtext->pixmap);
		gdk_gc_set_ts_origin (xtext->bgc, 0, 0);
		xtext->ts_x = xtext->ts_y = 0;
		gdk_gc_set_fill (xtext->bgc, GDK_TILED);
	}

	xtext->hand_cursor = gdk_cursor_new_for_display (gdk_window_get_display (widget->window), GDK_HAND1);
	xtext->resize_cursor = gdk_cursor_new_for_display (gdk_window_get_display (widget->window), GDK_LEFT_SIDE);

	gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
	widget->style = gtk_style_attach (widget->style, widget->window);

	backend_init (xtext);
}

static void
gtk_xtext_size_request (GtkWidget * widget, GtkRequisition * requisition)
{
	requisition->width = 200;
	requisition->height = 90;
}

static void
gtk_xtext_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
{
	GtkXText *xtext = GTK_XTEXT (widget);
	int height_only = FALSE;

	if (allocation->width == xtext->buffer->window_width)
		height_only = TRUE;

	widget->allocation = *allocation;
	if (gtk_widget_get_realized (GTK_WIDGET(widget)))
	{
		xtext->buffer->window_width = allocation->width;
		xtext->buffer->window_height = allocation->height;

		gdk_window_move_resize (widget->window, allocation->x, allocation->y,
										allocation->width, allocation->height);
		dontscroll (xtext->buffer);	/* force scrolling off */
		if (!height_only)
			gtk_xtext_calc_lines (xtext->buffer, FALSE);
		else
		{
			xtext->buffer->pagetop_ent = NULL;
			gtk_xtext_adjustment_set (xtext->buffer, FALSE);
		}
		if (xtext->buffer->scrollbar_down)
			gtk_adjustment_set_value (xtext->adj, xtext->adj->upper -
											  xtext->adj->page_size);
	}
}

static int
gtk_xtext_selection_clear (xtext_buffer *buf)
{
	textentry *ent;
	int ret = 0;

	ent = buf->last_ent_start;
	while (ent)
	{
		if (ent->mark_start != -1)
			ret = 1;
		ent->mark_start = -1;
		ent->mark_end = -1;
		if (ent == buf->last_ent_end)
			break;
		ent = ent->next;
	}

	return ret;
}

static int
find_x (GtkXText *xtext, textentry *ent, int x, int subline, int indent)
{
	int xx = indent;
	int suboff;
	GSList *list;
	GSList *hid = NULL;
	offlen_t *meta;
	int off, len, wid, mbl, mbw;

	/* Skip to the first chunk of stuff for the subline */
	list = ent->slp;
	if (subline > 0)
	{
		suboff = GPOINTER_TO_INT (g_slist_nth_data (ent->sublines, subline - 1));
		for (list = ent->slp; list; list = g_slist_next (list))
		{
			meta = list->data;
			if (meta->off + meta->len > suboff)
				break;
		}
	}
	else
	{
		suboff = 0;
		list = ent->slp;
	} 
	/* Step to the first character of the subline */
	meta = list->data;
	off = meta->off;
	len = meta->len;
	if (meta->emph & EMPH_HIDDEN)
		hid = list;
	while (len > 0)
	{
		if (off >= suboff)
			break;
		mbl = charlen (ent->str + off);
		len -= mbl;
		off += mbl;
	}
	if (len < 0)
		return ent->str_len;		/* Bad char -- return max offset. */

	/* Step through characters to find the one at the x position */
	wid = x - indent;
	len = meta->len - (off - meta->off);
	while (wid > 0)
	{
		mbl = charlen (ent->str + off);
		mbw = backend_get_text_width_emph (xtext, ent->str + off, mbl, meta->emph);
		wid -= mbw;
		xx += mbw;
		if (xx >= x)
			return off;
		len -= mbl;
		off += mbl;
		if (len <= 0)
		{
			if (meta->emph & EMPH_HIDDEN)
				hid = list;
			list = g_slist_next (list);
			if (list == NULL)
				return ent->str_len;
			meta = list->data;
			off = meta->off;
			len = meta->len;
		}
	}

	/* If previous chunk exists and is marked hidden, regard it as unhidden */
	if (hid && list && hid->next == list)
	{
		meta = hid->data;
		off = meta->off;
	}

	/* Return offset of character at x within subline */
	return off;
}

static int
gtk_xtext_find_x (GtkXText * xtext, int x, textentry * ent, int subline,
						int line, int *out_of_bounds)
{
	int indent;
	unsigned char *str;

	if (subline < 1)
		indent = ent->indent;
	else
		indent = xtext->buffer->indent;

	if (line > xtext->adj->page_size || line < 0)
	{
		*out_of_bounds = TRUE;
		return 0;
	}

	str = ent->str + gtk_xtext_find_subline (xtext, ent, subline);
	if (str >= ent->str + ent->str_len)
		return 0;

	/* Let user select left a few pixels to grab hidden text e.g. '<' */
	if (x < indent - xtext->space_width)
	{
		*out_of_bounds = 1;
		return (str - ent->str);
	}

	*out_of_bounds = 0;

	return find_x (xtext, ent, x, subline, indent);
}

static textentry *
gtk_xtext_find_char (GtkXText * xtext, int x, int y, int *off,
							int *out_of_bounds, int *ret_subline)
{
	textentry *ent;
	int line;
	int subline;

	/* Adjust y value for negative rounding, double to int */
	if (y < 0)
		y -= xtext->fontsize;

	line = (y + xtext->pixel_offset) / xtext->fontsize;
	ent = gtk_xtext_nth (xtext, line + (int)xtext->adj->value, &subline);
	if (!ent)
		return NULL;

	if (off)
		*off = gtk_xtext_find_x (xtext, x, ent, subline, line, out_of_bounds);

	if (ret_subline)
		*ret_subline = subline;

	return ent;
}

static void
gtk_xtext_draw_sep (GtkXText * xtext, int y)
{
	int x, height;
	GdkGC *light, *dark;

	if (y == -1)
	{
		y = 0;
		height = GTK_WIDGET (xtext)->allocation.height;
	} else
	{
		height = xtext->fontsize;
	}

	/* draw the separator line */
	if (xtext->separator && xtext->buffer->indent)
	{
		light = xtext->light_gc;
		dark = xtext->dark_gc;

		x = xtext->buffer->indent - ((xtext->space_width + 1) / 2);
		if (x < 1)
			return;

		if (xtext->thinline)
		{
			if (xtext->moving_separator)
				gdk_draw_line (xtext->draw_buf, light, x, y, x, y + height);
			else
				gdk_draw_line (xtext->draw_buf, xtext->thin_gc, x, y, x, y + height);
		} else
		{
			if (xtext->moving_separator)
			{
				gdk_draw_line (xtext->draw_buf, light, x - 1, y, x - 1, y + height);
				gdk_draw_line (xtext->draw_buf, dark, x, y, x, y + height);
			} else
			{
				gdk_draw_line (xtext->draw_buf, dark, x - 1, y, x - 1, y + height);
				gdk_draw_line (xtext->draw_buf, light, x, y, x, y + height);
			}
		}
	}
}

static void
gtk_xtext_draw_marker (GtkXText * xtext, textentry * ent, int y)
{
	int x, width, render_y;

	if (!xtext->marker) return;

	if (xtext->buffer->marker_pos == ent)
	{
		render_y = y + xtext->font->descent;
	}
	else if (xtext->buffer->marker_pos == ent->next && ent->next != NULL)
	{
		render_y = y + xtext->font->descent + xtext->fontsize * g_slist_length (ent->sublines);
	}
	else return;

	x = 0;
	width = GTK_WIDGET (xtext)->allocation.width;

	gdk_draw_line (xtext->draw_buf, xtext->marker_gc, x, render_y, x + width, render_y);

	if (gtk_window_has_toplevel_focus (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (xtext)))))
	{
		xtext->buffer->marker_seen = TRUE;
	}
}

static void
gtk_xtext_paint (GtkWidget *widget, GdkRectangle *area)
{
	GtkXText *xtext = GTK_XTEXT (widget);
	textentry *ent_start, *ent_end;
	int x, y;

	if (area->x == 0 && area->y == 0 &&
		 area->height == widget->allocation.height &&
		 area->width == widget->allocation.width)
	{
		dontscroll (xtext->buffer);	/* force scrolling off */
		gtk_xtext_render_page (xtext);
		return;
	}

	ent_start = gtk_xtext_find_char (xtext, area->x, area->y, NULL, NULL, NULL);
	if (!ent_start)
	{
		xtext_draw_bg (xtext, area->x, area->y, area->width, area->height);
		goto xit;
	}
	ent_end = gtk_xtext_find_char (xtext, area->x + area->width,
											 area->y + area->height, NULL, NULL, NULL);
	if (!ent_end)
		ent_end = xtext->buffer->text_last;

	/* can't set a clip here, because fgc/bgc are used to draw the DB too */
/*	backend_set_clip (xtext, area);*/
	xtext->clip_x = area->x;
	xtext->clip_x2 = area->x + area->width;
	xtext->clip_y = area->y;
	xtext->clip_y2 = area->y + area->height;

	/* y is the last pixel y location it rendered text at */
	y = gtk_xtext_render_ents (xtext, ent_start, ent_end);

	if (y && y < widget->allocation.height && !ent_end->next)
	{
		GdkRectangle rect;

		rect.x = 0;
		rect.y = y;
		rect.width = widget->allocation.width;
		rect.height = widget->allocation.height - y;

		/* fill any space below the last line that also intersects with
			the exposure rectangle */
		if (gdk_rectangle_intersect (area, &rect, &rect))
		{
			xtext_draw_bg (xtext, rect.x, rect.y, rect.width, rect.height);
		}
	}

	/*backend_clear_clip (xtext);*/
	xtext->clip_x = 0;
	xtext->clip_x2 = 1000000;
	xtext->clip_y = 0;
	xtext->clip_y2 = 1000000;

xit:
	x = xtext->buffer->indent - ((xtext->space_width + 1) / 2);
	if (area->x <= x)
		gtk_xtext_draw_sep (xtext, -1);
}

static gboolean
gtk_xtext_expose (GtkWidget * widget, GdkEventExpose * event)
{
	gtk_xtext_paint (widget, &event->area);
	return FALSE;
}

/* render a selection that has extended or contracted upward */

static void
gtk_xtext_selection_up (GtkXText *xtext, textentry *start, textentry *end,
								int start_offset)
{
	/* render all the complete lines */
	if (start->next == end)
		gtk_xtext_render_ents (xtext, end, NULL);
	else
		gtk_xtext_render_ents (xtext, start->next, end);

	/* now the incomplete upper line */
	if (start == xtext->buffer->last_ent_start)
		xtext->jump_in_offset = xtext->buffer->last_offset_start;
	else
		xtext->jump_in_offset = start_offset;
	gtk_xtext_render_ents (xtext, start, NULL);
	xtext->jump_in_offset = 0;
}

/* render a selection that has extended or contracted downward */

static void
gtk_xtext_selection_down (GtkXText *xtext, textentry *start, textentry *end,
								  int end_offset)
{
	/* render all the complete lines */
	if (end->prev == start)
		gtk_xtext_render_ents (xtext, start, NULL);
	else
		gtk_xtext_render_ents (xtext, start, end->prev);

	/* now the incomplete bottom line */
	if (end == xtext->buffer->last_ent_end)
		xtext->jump_out_offset = xtext->buffer->last_offset_end;
	else
		xtext->jump_out_offset = end_offset;
	gtk_xtext_render_ents (xtext, end, NULL);
	xtext->jump_out_offset = 0;
}

static void
gtk_xtext_selection_render (GtkXText *xtext, textentry *start_ent, textentry *end_ent)
{
	textentry *ent;
	int start_offset = start_ent->mark_start;
	int end_offset = end_ent->mark_end;
	int start, end;

	xtext->skip_border_fills = TRUE;
	xtext->skip_stamp = TRUE;

	/* force an optimized render if there was no previous selection */
	if (xtext->buffer->last_ent_start == NULL && start_ent == end_ent)
	{
		xtext->buffer->last_offset_start = start_offset;
		xtext->buffer->last_offset_end = end_offset;
		goto lamejump;
	}

	/* mark changed within 1 ent only? */
	if (xtext->buffer->last_ent_start == start_ent &&
		 xtext->buffer->last_ent_end == end_ent)
	{
		/* when only 1 end of the selection is changed, we can really
			save on rendering */
		if (xtext->buffer->last_offset_start == start_offset ||
			 xtext->buffer->last_offset_end == end_offset)
		{
lamejump:
			ent = end_ent;
			/* figure out where to start and end the rendering */
			if (end_offset > xtext->buffer->last_offset_end)
			{
				end = end_offset;
				start = xtext->buffer->last_offset_end;
			} else if (end_offset < xtext->buffer->last_offset_end)
			{
				end = xtext->buffer->last_offset_end;
				start = end_offset;
			} else if (start_offset < xtext->buffer->last_offset_start)
			{
				end = xtext->buffer->last_offset_start;
				start = start_offset;
				ent = start_ent;
			} else if (start_offset > xtext->buffer->last_offset_start)
			{
				end = start_offset;
				start = xtext->buffer->last_offset_start;
				ent = start_ent;
			} else
			{	/* WORD selects end up here */
				end = end_offset;
				start = start_offset;
			}
		} else
		{
			/* LINE selects end up here */
			/* so which ent actually changed? */
			ent = start_ent;
			if (xtext->buffer->last_offset_start == start_offset)
				ent = end_ent;

			end = MAX (xtext->buffer->last_offset_end, end_offset);
			start = MIN (xtext->buffer->last_offset_start, start_offset);
		}

		xtext->jump_out_offset = end;
		xtext->jump_in_offset = start;
		gtk_xtext_render_ents (xtext, ent, NULL);
		xtext->jump_out_offset = 0;
		xtext->jump_in_offset = 0;
	}
	/* marking downward? */
	else if (xtext->buffer->last_ent_start == start_ent &&
				xtext->buffer->last_offset_start == start_offset)
	{
		/* find the range that covers both old and new selection */
		ent = start_ent;
		while (ent)
		{
			if (ent == xtext->buffer->last_ent_end)
			{
				gtk_xtext_selection_down (xtext, ent, end_ent, end_offset);
				/*gtk_xtext_render_ents (xtext, ent, end_ent);*/
				break;
			}
			if (ent == end_ent)
			{
				gtk_xtext_selection_down (xtext, ent, xtext->buffer->last_ent_end, end_offset);
				/*gtk_xtext_render_ents (xtext, ent, xtext->buffer->last_ent_end);*/
				break;
			}
			ent = ent->next;
		}
	}
	/* marking upward? */
	else if (xtext->buffer->last_ent_end == end_ent &&
				xtext->buffer->last_offset_end == end_offset)
	{
		ent = end_ent;
		while (ent)
		{
			if (ent == start_ent)
			{
				gtk_xtext_selection_up (xtext, xtext->buffer->last_ent_start, ent, start_offset);
				/*gtk_xtext_render_ents (xtext, xtext->buffer->last_ent_start, ent);*/
				break;
			}
			if (ent == xtext->buffer->last_ent_start)
			{
				gtk_xtext_selection_up (xtext, start_ent, ent, start_offset);
				/*gtk_xtext_render_ents (xtext, start_ent, ent);*/
				break;
			}
			ent = ent->prev;
		}
	}
	else	/* cross-over mark (stretched or shrunk at both ends) */
	{
		/* unrender the old mark */
		gtk_xtext_render_ents (xtext, xtext->buffer->last_ent_start, xtext->buffer->last_ent_end);
		/* now render the new mark, but skip overlaps */
		if (start_ent == xtext->buffer->last_ent_start)
		{
			/* if the new mark is a sub-set of the old, do nothing */
			if (start_ent != end_ent)
				gtk_xtext_render_ents (xtext, start_ent->next, end_ent);
		} else if (end_ent == xtext->buffer->last_ent_end)
		{
			/* if the new mark is a sub-set of the old, do nothing */
			if (start_ent != end_ent)
				gtk_xtext_render_ents (xtext, start_ent, end_ent->prev);
		} else
			gtk_xtext_render_ents (xtext, start_ent, end_ent);
	}

	xtext->buffer->last_ent_start = start_ent;
	xtext->buffer->last_ent_end = end_ent;
	xtext->buffer->last_offset_start = start_offset;
	xtext->buffer->last_offset_end = end_offset;

	xtext->skip_border_fills = FALSE;
	xtext->skip_stamp = FALSE;
}

static void
gtk_xtext_selection_draw (GtkXText * xtext, GdkEventMotion * event, gboolean render)
{
	textentry *ent;
	textentry *ent_end;
	textentry *ent_start;
	int offset_start;
	int offset_end;
	int subline_start;
	int subline_end;
	int oob;
	int marking_up = FALSE;
	int len_start;
	int len_end;

	ent_start = gtk_xtext_find_char (xtext, xtext->select_start_x, xtext->select_start_y, &offset_start, &oob, &subline_start);
	ent_end = gtk_xtext_find_char (xtext, xtext->select_end_x, xtext->select_end_y, &offset_end, &oob, &subline_end);

	if ((!ent_start || !ent_end) && !xtext->buffer->text_last && xtext->adj->value != xtext->buffer->old_value)
	{
		gtk_xtext_render_page (xtext);
		return;
	}

	if (!ent_start)
	{
		ent_start = xtext->buffer->text_last;
		offset_start = ent_start->str_len;
	}

	if (!ent_end)
	{
		ent_end = xtext->buffer->text_last;
		offset_end = ent_end->str_len;
	}

	if ((ent_start != ent_end && xtext->select_start_y > xtext->select_end_y) || /* different entries */
		(ent_start == ent_end && subline_start > subline_end) || /* different lines */
		(ent_start == ent_end && subline_start == subline_end && xtext->select_start_x > xtext->select_end_x)) /* marking to the left */
	{
		marking_up = TRUE;
	}

	/* word selection */
	if (xtext->word_select)
	{
		/* a word selection cannot be started if the cursor is out of bounds in gtk_xtext_button_press */
		gtk_xtext_get_word (xtext, xtext->select_start_x, xtext->select_start_y, NULL, &offset_start, &len_start, NULL);

		/* in case the cursor is out of bounds we keep offset_end from gtk_xtext_find_char and fix the length */
		if (gtk_xtext_get_word (xtext, xtext->select_end_x, xtext->select_end_y, NULL, &offset_end, &len_end, NULL) == NULL)
			len_end = offset_end == ent_end->str_len? 0: -1; /* -1 for the space, 0 if at the end */

		if (!marking_up)
			offset_end += len_end;
		else
			offset_start += len_start;
	}
	/* line/ent selection */
	else if (xtext->line_select)
	{
		offset_start = marking_up? ent_start->str_len: 0;
		offset_end = marking_up? 0: ent_end->str_len;
	}

	if (marking_up)
	{
		int temp;

		/* ensure ent_start is above ent_end */
		if (ent_start != ent_end)
		{
			ent = ent_start;
			ent_start = ent_end;
			ent_end = ent;
		}

		/* switch offsets as well */
		temp = offset_start;
		offset_start = offset_end;
		offset_end = temp;
	}

	/* set all the old mark_ fields to -1 */
	gtk_xtext_selection_clear (xtext->buffer);

	/* set the default values */
	ent_start->mark_end = ent_start->str_len;
	ent_end->mark_start = 0;

	/* set the calculated values (this overwrites the default values if we're on the same ent) */
	ent_start->mark_start = offset_start;
	ent_end->mark_end = offset_end;

	/* set all the mark_ fields of the ents within the selection */
	if (ent_start != ent_end)
	{
		ent = ent_start->next;
		while (ent && ent != ent_end)
		{
			ent->mark_start = 0;
			ent->mark_end = ent->str_len;
			ent = ent->next;
		}
	}

	if (render)
		gtk_xtext_selection_render (xtext, ent_start, ent_end);
}

static int
gtk_xtext_timeout_ms (GtkXText *xtext, int pixes)
{
	int apixes = abs(pixes);

	if (apixes < 6) return 100;
	if (apixes < 12) return 50;
	if (apixes < 20) return 20;
	return 10;
}
static gint
gtk_xtext_scrolldown_timeout (GtkXText * xtext)
{
	int p_y, win_height;
	xtext_buffer *buf = xtext->buffer;
	GtkAdjustment *adj = xtext->adj;

	gdk_window_get_pointer (GTK_WIDGET (xtext)->window, 0, &p_y, 0);
	win_height = gdk_window_get_height (gtk_widget_get_window (GTK_WIDGET (xtext)));

	if (buf->last_ent_end == NULL ||	/* If context has changed OR */
		 buf->pagetop_ent == NULL ||	/* pagetop_ent is reset OR */
		 p_y <= win_height ||			/* pointer not below bottom margin OR */
		 adj->value >= adj->upper - adj->page_size) 	/* we're scrolled to bottom */
	{
		xtext->scroll_tag = 0;
		return 0;
	}

	xtext->select_start_y -= xtext->fontsize;
	xtext->select_start_adj++;
	adj->value++;
	gtk_adjustment_value_changed (adj);
	gtk_xtext_selection_draw (xtext, NULL, TRUE);
	gtk_xtext_render_ents (xtext, buf->pagetop_ent->next, buf->last_ent_end);
	xtext->scroll_tag = g_timeout_add (gtk_xtext_timeout_ms (xtext, p_y - win_height),
													(GSourceFunc)
													gtk_xtext_scrolldown_timeout,
													xtext);

	return 0;
}

static gint
gtk_xtext_scrollup_timeout (GtkXText * xtext)
{
	int p_y;
	xtext_buffer *buf = xtext->buffer;
	GtkAdjustment *adj = xtext->adj;
	int delta_y;

	gdk_window_get_pointer (GTK_WIDGET (xtext)->window, 0, &p_y, 0);

	if (buf->last_ent_start == NULL ||	/* If context has changed OR */
		 buf->pagetop_ent == NULL ||		/* pagetop_ent is reset OR */
		 p_y >= 0 ||							/* not above top margin OR */
		 adj->value == 0)						/* we're scrolled to the top */
	{
		xtext->scroll_tag = 0;
		return 0;
	}

	if (adj->value < 0)
	{
		delta_y = adj->value * xtext->fontsize;
		adj->value = 0;
	} else {
		delta_y = xtext->fontsize;
		adj->value--;
	}
	xtext->select_start_y += delta_y;
	xtext->select_start_adj = adj->value;
	gtk_adjustment_value_changed (adj);
	gtk_xtext_selection_draw (xtext, NULL, TRUE);
	gtk_xtext_render_ents (xtext, buf->pagetop_ent->prev, buf->last_ent_end);
	xtext->scroll_tag = g_timeout_add (gtk_xtext_timeout_ms (xtext, p_y),
													(GSourceFunc)
													gtk_xtext_scrollup_timeout,
													xtext);

	return 0;
}

static void
gtk_xtext_selection_update (GtkXText * xtext, GdkEventMotion * event, int p_y, gboolean render)
{
	int win_height;
	int moved;

	if (xtext->scroll_tag)
	{
		return;
	}

	win_height = gdk_window_get_height (gtk_widget_get_window (GTK_WIDGET (xtext)));

	/* selecting past top of window, scroll up! */
	if (p_y < 0 && xtext->adj->value >= 0)
	{
		gtk_xtext_scrollup_timeout (xtext);
	}

	/* selecting past bottom of window, scroll down! */
	else if (p_y > win_height &&
		 xtext->adj->value < (xtext->adj->upper - xtext->adj->page_size))
	{
		gtk_xtext_scrolldown_timeout (xtext);
	}
	else
	{
		moved = (int)xtext->adj->value - xtext->select_start_adj;
		xtext->select_start_y -= (moved * xtext->fontsize);
		xtext->select_start_adj = xtext->adj->value;
		gtk_xtext_selection_draw (xtext, event, render);
	}
}

static char *
gtk_xtext_get_word (GtkXText * xtext, int x, int y, textentry ** ret_ent,
						  int *ret_off, int *ret_len, GSList **slp)
{
	textentry *ent;
	int offset;
	unsigned char *word;
	unsigned char *last, *end;
	int len;
	int out_of_bounds = 0;
	int len_to_offset = 0;

	ent = gtk_xtext_find_char (xtext, x, y, &offset, &out_of_bounds, NULL);
	if (ent == NULL || out_of_bounds || offset < 0 || offset >= ent->str_len)
		return NULL;

	word = ent->str + offset;
	while ((word = g_utf8_find_prev_char (ent->str, word)))
	{
		if (is_del (*word))
		{
			word++;
			len_to_offset--;
			break;
		}
		len_to_offset += charlen (word);
	}
	if (!word)
		word = ent->str;

	/* remove color characters from the length */
	gtk_xtext_strip_color (word, len_to_offset, xtext->scratch_buffer, &len_to_offset, NULL, FALSE);

	last = word;
	end = ent->str + ent->str_len;
	len = 0;
	do
	{
		if (is_del (*last))
			break;
		len += charlen (last);
		last = g_utf8_find_next_char (last, end);
	}
	while (last);

	if (len > 0 && word[len-1]=='.')
		len--;

	if (ret_ent)
		*ret_ent = ent;
	if (ret_off)
		*ret_off = word - ent->str;
	if (ret_len)
		*ret_len = len;		/* Length before stripping */

	word = gtk_xtext_strip_color (word, len, xtext->scratch_buffer, NULL, slp, FALSE);

	/* avoid turning the cursor into a hand for non-url part of the word */
	if (xtext->urlcheck_function && xtext->urlcheck_function (GTK_WIDGET (xtext), word))
	{
		int start, end;
		url_last (&start, &end);

		/* make sure we're not before the start of the match */
		if (len_to_offset < start)
			return NULL;

		/* and not after it */
		if (len_to_offset - start >= end - start)
			return NULL;
	}

	return word;
}

static void
gtk_xtext_unrender_hilight (GtkXText *xtext)
{
	xtext->render_hilights_only = TRUE;
	xtext->skip_border_fills = TRUE;
	xtext->skip_stamp = TRUE;
	xtext->un_hilight = TRUE;

	gtk_xtext_render_ents (xtext, xtext->hilight_ent, NULL);

	xtext->render_hilights_only = FALSE;
	xtext->skip_border_fills = FALSE;
	xtext->skip_stamp = FALSE;
	xtext->un_hilight = FALSE;
}

static gboolean
gtk_xtext_leave_notify (GtkWidget * widget, GdkEventCrossing * event)
{
	GtkXText *xtext = GTK_XTEXT (widget);

	if (xtext->cursor_hand)
	{
		gtk_xtext_unrender_hilight (xtext);
		xtext->hilight_start = -1;
		xtext->hilight_end = -1;
		xtext->cursor_hand = FALSE;
		gdk_window_set_cursor (widget->window, 0);
		xtext->hilight_ent = NULL;
	}

	if (xtext->cursor_resize)
	{
		gtk_xtext_unrender_hilight (xtext);
		xtext->hilight_start = -1;
		xtext->hilight_end = -1;
		xtext->cursor_resize = FALSE;
		gdk_window_set_cursor (widget->window, 0);
		xtext->hilight_ent = NULL;
	}

	return FALSE;
}

/* check if we should mark time stamps, and if a redraw is needed */

static gboolean
gtk_xtext_check_mark_stamp (GtkXText *xtext, GdkModifierType mask)
{
	gboolean redraw = FALSE;

	if ((mask & STATE_SHIFT || prefs.hex_text_autocopy_stamp)
	    && (!prefs.hex_stamp_text || prefs.hex_text_indent))
	{
		if (!xtext->mark_stamp)
		{
			redraw = TRUE;	/* must redraw all */
			xtext->mark_stamp = TRUE;
		}
	} else
	{
		if (xtext->mark_stamp)
		{
			redraw = TRUE;	/* must redraw all */
			xtext->mark_stamp = FALSE;
		}
	}
	return redraw;
}

static int
gtk_xtext_get_word_adjust (GtkXText *xtext, int x, int y, textentry **word_ent, int *offset, int *len)
{
	GSList *slp = NULL;
	unsigned char *word;
	int word_type = 0;

	word = gtk_xtext_get_word (xtext, x, y, word_ent, offset, len, &slp);
	if (word)
	{
		int laststart, lastend;

		word_type = xtext->urlcheck_function (GTK_WIDGET (xtext), word);
		if (word_type > 0)
		{
			if (url_last (&laststart, &lastend))
			{
				int cumlen, startadj = 0, endadj = 0;
				offlen_t *meta;
				GSList *sl;

				for (sl = slp, cumlen = 0; sl; sl = g_slist_next (sl))
				{
					meta = sl->data;
					startadj = meta->off - cumlen;
					cumlen += meta->len;
					if (laststart < cumlen)
						break;
				}
				for (sl = slp, cumlen = 0; sl; sl = g_slist_next (sl))
				{
					meta = sl->data;
					endadj = meta->off - cumlen;
					cumlen += meta->len;
					if (lastend < cumlen)
						break;
				}
				laststart += startadj;
				*offset += laststart;
				*len = lastend + endadj - laststart;
			}
		}
	}
	g_slist_free_full (slp, g_free);

	return word_type;
}

static gboolean
gtk_xtext_motion_notify (GtkWidget * widget, GdkEventMotion * event)
{
	GtkXText *xtext = GTK_XTEXT (widget);
	GdkModifierType mask;
	int redraw, tmp, x, y, offset, len, line_x;
	textentry *word_ent;
	int word_type;

	gdk_window_get_pointer (widget->window, &x, &y, &mask);

	if (xtext->moving_separator)
	{
		if (x < (3 * widget->allocation.width) / 5 && x > 15)
		{
			tmp = xtext->buffer->indent;
			xtext->buffer->indent = x;
			gtk_xtext_fix_indent (xtext->buffer);
			if (tmp != xtext->buffer->indent)
			{
				gtk_xtext_recalc_widths (xtext->buffer, FALSE);
				if (xtext->buffer->scrollbar_down)
					gtk_adjustment_set_value (xtext->adj, xtext->adj->upper -
													  xtext->adj->page_size);
				if (!xtext->io_tag)
					xtext->io_tag = g_timeout_add (REFRESH_TIMEOUT,
																(GSourceFunc)
																gtk_xtext_adjustment_timeout,
																xtext);
			}
		}
		return FALSE;
	}

	if (xtext->button_down)
	{
		redraw = gtk_xtext_check_mark_stamp (xtext, mask);
		gtk_grab_add (widget);
		/*gdk_pointer_grab (widget->window, TRUE,
									GDK_BUTTON_RELEASE_MASK |
									GDK_BUTTON_MOTION_MASK, NULL, NULL, 0);*/
		xtext->select_end_x = x;
		xtext->select_end_y = y;
		gtk_xtext_selection_update (xtext, event, y, !redraw);
		xtext->hilighting = TRUE;

		/* user has pressed or released SHIFT, must redraw entire selection */
		if (redraw)
		{
			xtext->force_stamp = TRUE;
			gtk_xtext_render_ents (xtext, xtext->buffer->last_ent_start,
										  xtext->buffer->last_ent_end);
			xtext->force_stamp = FALSE;
		}
		return FALSE;
	}

	if (xtext->separator && xtext->buffer->indent)
	{
		line_x = xtext->buffer->indent - ((xtext->space_width + 1) / 2);
		if (line_x == x || line_x == x + 1 || line_x == x - 1)
		{
			if (!xtext->cursor_resize)
			{
				gdk_window_set_cursor (GTK_WIDGET (xtext)->window,
										  		xtext->resize_cursor);
				xtext->cursor_hand = FALSE;
				xtext->cursor_resize = TRUE;
			}
			return FALSE;
		}
	}

	if (xtext->urlcheck_function == NULL)
		return FALSE;

	word_type = gtk_xtext_get_word_adjust (xtext, x, y, &word_ent, &offset, &len);
	if (word_type > 0)
	{
		if (!xtext->cursor_hand ||
			 xtext->hilight_ent != word_ent ||
			 xtext->hilight_start != offset ||
			 xtext->hilight_end != offset + len)
		{
			if (!xtext->cursor_hand)
			{
				gdk_window_set_cursor (GTK_WIDGET (xtext)->window,
										  		xtext->hand_cursor);
				xtext->cursor_hand = TRUE;
				xtext->cursor_resize = FALSE;
			}

			/* un-render the old hilight */
			if (xtext->hilight_ent)
				gtk_xtext_unrender_hilight (xtext);

			xtext->hilight_ent = word_ent;
			xtext->hilight_start = offset;
			xtext->hilight_end = offset + len;

			xtext->skip_border_fills = TRUE;
			xtext->render_hilights_only = TRUE;
			xtext->skip_stamp = TRUE;

			gtk_xtext_render_ents (xtext, word_ent, NULL);

			xtext->skip_border_fills = FALSE;
			xtext->render_hilights_only = FALSE;
			xtext->skip_stamp = FALSE;
		}
		return FALSE;
	}

	gtk_xtext_leave_notify (widget, NULL);

	return FALSE;
}

static void
gtk_xtext_set_clip_owner (GtkWidget * xtext, GdkEventButton * event)
{
	char *str;
	int len;

	if (GTK_XTEXT (xtext)->selection_buffer &&
		GTK_XTEXT (xtext)->selection_buffer != GTK_XTEXT (xtext)->buffer)
		gtk_xtext_selection_clear (GTK_XTEXT (xtext)->selection_buffer);

	GTK_XTEXT (xtext)->selection_buffer = GTK_XTEXT (xtext)->buffer;

	str = gtk_xtext_selection_get_text (GTK_XTEXT (xtext), &len);
	if (str)
	{
		if (str[0])
		{
			gtk_clipboard_set_text (gtk_widget_get_clipboard (xtext, GDK_SELECTION_CLIPBOARD), str, len);
			
			gtk_selection_owner_set (xtext, GDK_SELECTION_PRIMARY, event ? event->time : GDK_CURRENT_TIME);
			gtk_selection_owner_set (xtext, GDK_SELECTION_SECONDARY, event ? event->time : GDK_CURRENT_TIME);
		}

		g_free (str);
	}
}

void
gtk_xtext_copy_selection (GtkXText *xtext)
{
	gtk_xtext_set_clip_owner (GTK_WIDGET (xtext), NULL);
}

static void
gtk_xtext_unselect (GtkXText *xtext)
{
	xtext_buffer *buf = xtext->buffer;

	xtext->skip_border_fills = TRUE;
	xtext->skip_stamp = TRUE;

	xtext->jump_in_offset = buf->last_ent_start->mark_start;
	/* just a single ent was marked? */
	if (buf->last_ent_start == buf->last_ent_end)
	{
		xtext->jump_out_offset = buf->last_ent_start->mark_end;
		buf->last_ent_end = NULL;
	}

	gtk_xtext_selection_clear (xtext->buffer);

	/* FIXME: use jump_out on multi-line selects too! */
	xtext->jump_in_offset = 0;
	xtext->jump_out_offset = 0;
	gtk_xtext_render_ents (xtext, buf->last_ent_start, buf->last_ent_end);

	xtext->skip_border_fills = FALSE;
	xtext->skip_stamp = FALSE;

	xtext->buffer->last_ent_start = NULL;
	xtext->buffer->last_ent_end = NULL;
}

static gboolean
gtk_xtext_button_release (GtkWidget * widget, GdkEventButton * event)
{
	GtkXText *xtext = GTK_XTEXT (widget);
	unsigned char *word;
	int old;

	if (xtext->moving_separator)
	{
		xtext->moving_separator = FALSE;
		old = xtext->buffer->indent;
		if (event->x < (4 * widget->allocation.width) / 5 && event->x > 15)
			xtext->buffer->indent = event->x;
		gtk_xtext_fix_indent (xtext->buffer);
		if (xtext->buffer->indent != old)
		{
			gtk_xtext_recalc_widths (xtext->buffer, FALSE);
			gtk_xtext_adjustment_set (xtext->buffer, TRUE);
			gtk_xtext_render_page (xtext);
		} else
			gtk_xtext_draw_sep (xtext, -1);
		return FALSE;
	}

	if (event->button == 1)
	{
		xtext->button_down = FALSE;
		if (xtext->scroll_tag)
		{
			g_source_remove (xtext->scroll_tag);
			xtext->scroll_tag = 0;
		}

		gtk_grab_remove (widget);
		/*gdk_pointer_ungrab (0);*/

		/* got a new selection? */
		if (xtext->buffer->last_ent_start)
		{
			xtext->color_paste = FALSE;
			if (event->state & STATE_CTRL || prefs.hex_text_autocopy_color)
				xtext->color_paste = TRUE;
			if (prefs.hex_text_autocopy_text)
			{
				gtk_xtext_set_clip_owner (GTK_WIDGET (xtext), event);
			}
		}

		if (xtext->word_select || xtext->line_select)
		{
			xtext->word_select = FALSE;
			xtext->line_select = FALSE;
			return FALSE;
		}

		if (xtext->select_start_x == event->x &&
			 xtext->select_start_y == event->y &&
			 xtext->buffer->last_ent_start)
		{
			gtk_xtext_unselect (xtext);
			xtext->mark_stamp = FALSE;
			return FALSE;
		}

		if (!xtext->hilighting)
		{
			word = gtk_xtext_get_word (xtext, event->x, event->y, 0, 0, 0, 0);
			g_signal_emit (G_OBJECT (xtext), xtext_signals[WORD_CLICK], 0, word ? word : NULL, event);
		} else
		{
			xtext->hilighting = FALSE;
		}
	}

	return FALSE;
}

static gboolean
gtk_xtext_button_press (GtkWidget * widget, GdkEventButton * event)
{
	GtkXText *xtext = GTK_XTEXT (widget);
	GdkModifierType mask;
	textentry *ent;
	unsigned char *word;
	int line_x, x, y, offset, len;

	gdk_window_get_pointer (widget->window, &x, &y, &mask);

	if (event->button == 3 || event->button == 2) /* right/middle click */
	{
		word = gtk_xtext_get_word (xtext, x, y, 0, 0, 0, 0);
		if (word)
		{
			g_signal_emit (G_OBJECT (xtext), xtext_signals[WORD_CLICK], 0,
								word, event);
		} else
			g_signal_emit (G_OBJECT (xtext), xtext_signals[WORD_CLICK], 0,
								"", event);
		return FALSE;
	}

	if (event->button != 1)		  /* we only want left button */
		return FALSE;

	if (event->type == GDK_2BUTTON_PRESS)	/* WORD select */
	{
		gtk_xtext_check_mark_stamp (xtext, mask);
		if (gtk_xtext_get_word (xtext, x, y, &ent, &offset, &len, 0))
		{
			if (len == 0)
				return FALSE;
			gtk_xtext_selection_clear (xtext->buffer);
			ent->mark_start = offset;
			ent->mark_end = offset + len;
			gtk_xtext_selection_render (xtext, ent, ent);
			xtext->word_select = TRUE;
		}

		return FALSE;
	}

	if (event->type == GDK_3BUTTON_PRESS)	/* LINE select */
	{
		gtk_xtext_check_mark_stamp (xtext, mask);
		if (gtk_xtext_get_word (xtext, x, y, &ent, 0, 0, 0))
		{
			gtk_xtext_selection_clear (xtext->buffer);
			ent->mark_start = 0;
			ent->mark_end = ent->str_len;
			gtk_xtext_selection_render (xtext, ent, ent);
			xtext->line_select = TRUE;
		}

		return FALSE;
	}

	/* check if it was a separator-bar click */
	if (xtext->separator && xtext->buffer->indent)
	{
		line_x = xtext->buffer->indent - ((xtext->space_width + 1) / 2);
		if (line_x == x || line_x == x + 1 || line_x == x - 1)
		{
			xtext->moving_separator = TRUE;
			/* draw the separator line */
			gtk_xtext_draw_sep (xtext, -1);
			return FALSE;
		}
	}

	xtext->button_down = TRUE;
	xtext->select_start_x = x;
	xtext->select_start_y = y;
	xtext->select_start_adj = xtext->adj->value;

	return FALSE;
}

/* another program has claimed the selection */

static gboolean
gtk_xtext_selection_kill (GtkXText *xtext, GdkEventSelection *event)
{
#ifndef WIN32
	if (xtext->buffer->last_ent_start)
		gtk_xtext_unselect (xtext);
#endif
	return TRUE;
}

static char *
gtk_xtext_selection_get_text (GtkXText *xtext, int *len_ret)
{
	textentry *ent;
	char *txt;
	char *pos;
	char *stripped;
	int len;
	int first = TRUE;
	xtext_buffer *buf;

	buf = xtext->selection_buffer;
	if (!buf)
		return NULL;

	/* first find out how much we need to malloc ... */
	len = 0;
	ent = buf->last_ent_start;
	while (ent)
	{
		if (ent->mark_start != -1)
		{
			/* include timestamp? */
			if (ent->mark_start == 0 && xtext->mark_stamp)
			{
				char *time_str;
				int stamp_size = xtext_get_stamp_str (ent->stamp, &time_str);
				g_free (time_str);
				len += stamp_size;
			}

			if (ent->mark_end - ent->mark_start > 0)
				len += (ent->mark_end - ent->mark_start) + 1;
			else
				len++;
		}
		if (ent == buf->last_ent_end)
			break;
		ent = ent->next;
	}

	if (len < 1)
		return NULL;

	/* now allocate mem and copy buffer */
	pos = txt = g_malloc (len);
	ent = buf->last_ent_start;
	while (ent)
	{
		if (ent->mark_start != -1)
		{
			if (!first)
			{
				*pos = '\n';
				pos++;
			}
			first = FALSE;
			if (ent->mark_end - ent->mark_start > 0)
			{
				/* include timestamp? */
				if (ent->mark_start == 0 && xtext->mark_stamp)
				{
					char *time_str;
					int stamp_size = xtext_get_stamp_str (ent->stamp, &time_str);
					memcpy (pos, time_str, stamp_size);
					g_free (time_str);
					pos += stamp_size;
				}

				memcpy (pos, ent->str + ent->mark_start,
						  ent->mark_end - ent->mark_start);
				pos += ent->mark_end - ent->mark_start;
			}
		}
		if (ent == buf->last_ent_end)
			break;
		ent = ent->next;
	}
	*pos = 0;

	if (xtext->color_paste)
	{
		/*stripped = gtk_xtext_conv_color (txt, strlen (txt), &len);*/
		stripped = txt;
		len = strlen (txt);
	}
	else
	{
		stripped = gtk_xtext_strip_color (txt, strlen (txt), NULL, &len, NULL, FALSE);
		g_free (txt);
	}

	*len_ret = len;
	return stripped;
}

/* another program is asking for our selection */

static void
gtk_xtext_selection_get (GtkWidget * widget,
								 GtkSelectionData * selection_data_ptr,
								 guint info, guint time)
{
	GtkXText *xtext = GTK_XTEXT (widget);
	char *stripped;
	guchar *new_text;
	int len;
	gsize glen;

	stripped = gtk_xtext_selection_get_text (xtext, &len);
	if (!stripped)
		return;

	switch (info)
	{
	case TARGET_UTF8_STRING:
		/* it's already in utf8 */
		gtk_selection_data_set_text (selection_data_ptr, stripped, len);
		break;
	case TARGET_TEXT:
	case TARGET_COMPOUND_TEXT:
#ifdef GDK_WINDOWING_X11
		{
			GdkDisplay *display = gdk_window_get_display (widget->window);
			GdkAtom encoding;
			gint format;
			gint new_length;

			gdk_x11_display_string_to_compound_text (display, stripped, &encoding,
												&format, &new_text, &new_length);
			gtk_selection_data_set (selection_data_ptr, encoding, format,
											new_text, new_length);
			gdk_x11_free_compound_text (new_text);

		}
		break;
#endif
	default:
		new_text = g_locale_from_utf8 (stripped, len, NULL, &glen, NULL);
		gtk_selection_data_set (selection_data_ptr, GDK_SELECTION_TYPE_STRING,
										8, new_text, glen);
		g_free (new_text);
	}

	g_free (stripped);
}

static gboolean
gtk_xtext_scroll (GtkWidget *widget, GdkEventScroll *event)
{
	GtkXText *xtext = GTK_XTEXT (widget);
	gfloat new_value;

	if (event->direction == GDK_SCROLL_UP)		/* mouse wheel pageUp */
	{
		new_value = xtext->adj->value - (xtext->adj->page_increment / 10);
		if (new_value < xtext->adj->lower)
			new_value = xtext->adj->lower;
		gtk_adjustment_set_value (xtext->adj, new_value);
	}
	else if (event->direction == GDK_SCROLL_DOWN)	/* mouse wheel pageDn */
	{
		new_value = xtext->adj->value + (xtext->adj->page_increment / 10);
		if (new_value > (xtext->adj->upper - xtext->adj->page_size))
			new_value = xtext->adj->upper - xtext->adj->page_size;
		gtk_adjustment_set_value (xtext->adj, new_value);
	}

	return FALSE;
}

static void
gtk_xtext_scroll_adjustments (GtkXText *xtext, GtkAdjustment *hadj, GtkAdjustment *vadj)
{
	/* hadj is ignored entirely */

	if (vadj)
		g_return_if_fail (GTK_IS_ADJUSTMENT (vadj));
	else
		vadj = GTK_ADJUSTMENT(gtk_adjustment_new (0, 0, 1, 1, 1, 1));

	if (xtext->adj && (xtext->adj != vadj))
	{
		g_signal_handlers_disconnect_by_func (xtext->adj,
								gtk_xtext_adjustment_changed,
								xtext);
		g_object_unref (xtext->adj);
	}

	if (xtext->adj != vadj)
	{
		xtext->adj = vadj;
		g_object_ref_sink (xtext->adj);

		xtext->vc_signal_tag = g_signal_connect (xtext->adj, "value-changed",
							G_CALLBACK (gtk_xtext_adjustment_changed),
							xtext);

		gtk_xtext_adjustment_changed (xtext->adj, xtext);
	}
}

static void
gtk_xtext_class_init (GtkXTextClass * class)
{
	GtkObjectClass *object_class;
	GtkWidgetClass *widget_class;
	GtkXTextClass *xtext_class;

	object_class = (GtkObjectClass *) class;
	widget_class = (GtkWidgetClass *) class;
	xtext_class = (GtkXTextClass *) class;

	parent_class = g_type_class_peek (gtk_widget_get_type ());

	xtext_signals[WORD_CLICK] =
		g_signal_new ("word_click",
							G_TYPE_FROM_CLASS (object_class),
							G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
							G_STRUCT_OFFSET (GtkXTextClass, word_click),
							NULL, NULL,
							_hexchat_marshal_VOID__POINTER_POINTER,
							G_TYPE_NONE,
							2, G_TYPE_POINTER, G_TYPE_POINTER);
	xtext_signals[SET_SCROLL_ADJUSTMENTS] =
		g_signal_new ("set_scroll_adjustments",
							G_OBJECT_CLASS_TYPE (object_class),
							G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
							G_STRUCT_OFFSET (GtkXTextClass, set_scroll_adjustments),
							NULL, NULL,
							_hexchat_marshal_VOID__OBJECT_OBJECT,
							G_TYPE_NONE,
							2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);

	object_class->destroy = gtk_xtext_destroy;

	widget_class->realize = gtk_xtext_realize;
	widget_class->unrealize = gtk_xtext_unrealize;
	widget_class->size_request = gtk_xtext_size_request;
	widget_class->size_allocate = gtk_xtext_size_allocate;
	widget_class->button_press_event = gtk_xtext_button_press;
	widget_class->button_release_event = gtk_xtext_button_release;
	widget_class->motion_notify_event = gtk_xtext_motion_notify;
	widget_class->selection_clear_event = (void *)gtk_xtext_selection_kill;
	widget_class->selection_get = gtk_xtext_selection_get;
	widget_class->expose_event = gtk_xtext_expose;
	widget_class->scroll_event = gtk_xtext_scroll;
	widget_class->leave_notify_event = gtk_xtext_leave_notify;
	widget_class->set_scroll_adjustments_signal = xtext_signals[SET_SCROLL_ADJUSTMENTS];

	xtext_class->word_click = NULL;
	xtext_class->set_scroll_adjustments = gtk_xtext_scroll_adjustments;
}

GType
gtk_xtext_get_type (void)
{
	static GType xtext_type = 0;

	if (!xtext_type)
	{
		static const GTypeInfo xtext_info =
		{
			sizeof (GtkXTextClass),
			NULL,		/* base_init */
			NULL,		/* base_finalize */
			(GClassInitFunc) gtk_xtext_class_init,
			NULL,		/* class_finalize */
			NULL,		/* class_data */
			sizeof (GtkXText),
			0,		/* n_preallocs */
			(GInstanceInitFunc) gtk_xtext_init,
		};

		xtext_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkXText",
														 &xtext_info, 0);
	}

	return xtext_type;
}

/* strip MIRC colors and other attribs. */

/* CL: needs to strip hidden when called by gtk_xtext_text_width, but not when copying text */

typedef struct chunk_s {
	GSList *slp;
	int off1, len1, emph;
	offlen_t meta;
} chunk_t;

static void
xtext_do_chunk(chunk_t *c)
{
	offlen_t *meta;

	if (c->len1 == 0)
		return;

	meta = g_new (offlen_t, 1);
	meta->off = c->off1;
	meta->len = c->len1;
	meta->emph = c->emph;
	meta->width = 0;
	c->slp = g_slist_append (c->slp, meta);

	c->len1 = 0;
}

static unsigned char *
gtk_xtext_strip_color (unsigned char *text, int len, unsigned char *outbuf,
							  int *newlen, GSList **slpp, int strip_hidden)
{
	chunk_t c;
	int i = 0;
	int rcol = 0, bgcol = 0;
	int hidden = FALSE;
	unsigned char *new_str;
	unsigned char *text0 = text;
	int mbl;	/* multi-byte length */

	if (outbuf == NULL)
		new_str = g_malloc (len + 2);
	else
		new_str = outbuf;

	c.slp = NULL;
	c.off1 = 0;
	c.len1 = 0;
	c.emph = 0;
	while (len > 0)
	{
		mbl = charlen (text);
		if (mbl > len)
			goto bad_utf8;

		if (rcol > 0 && (isdigit (*text) || (*text == ',' && isdigit (text[1]) && !bgcol)))
		{
			if (text[1] != ',') rcol--;
			if (*text == ',')
			{
				rcol = 2;
				bgcol = 1;
			}
		} else
		{
			rcol = bgcol = 0;
			switch (*text)
			{
			case ATTR_COLOR:
				xtext_do_chunk (&c);
				rcol = 2;
				break;
			case ATTR_BEEP:
			case ATTR_RESET:
			case ATTR_REVERSE:
			case ATTR_BOLD:
			case ATTR_UNDERLINE:
			case ATTR_ITALICS:
				xtext_do_chunk (&c);
				if (*text == ATTR_RESET)
					c.emph = 0;
				if (*text == ATTR_ITALICS)
					c.emph ^= EMPH_ITAL;
				if (*text == ATTR_BOLD)
					c.emph ^= EMPH_BOLD;
				break;
			case ATTR_HIDDEN:
				xtext_do_chunk (&c);
				c.emph ^= EMPH_HIDDEN;
				hidden = !hidden;
				break;
			default:
				if (strip_hidden == 2 || (!(hidden && strip_hidden)))
				{
					if (c.len1 == 0)
						c.off1 = text - text0;
					memcpy (new_str + i, text, mbl);
					i += mbl;
					c.len1 += mbl;
				}
			}
		}
		text += mbl;
		len -= mbl;
	}

bad_utf8:		/* Normal ending sequence, and give up if bad utf8 */
	xtext_do_chunk (&c);

	new_str[i] = 0;

	if (newlen != NULL)
		*newlen = i;

	if (slpp)
		*slpp = c.slp;
	else
		g_slist_free_full (c.slp, g_free);

	return new_str;
}

/* gives width of a string, excluding the mIRC codes */

static int
gtk_xtext_text_width_ent (GtkXText *xtext, textentry *ent)
{
	unsigned char *new_buf;
	GSList *slp0, *slp;
	int width;

	if (ent->slp)
	{
		g_slist_free_full (ent->slp, g_free);
		ent->slp = NULL;
	}

	new_buf = gtk_xtext_strip_color (ent->str, ent->str_len, xtext->scratch_buffer,
												NULL, &slp0, 2);

	width =  backend_get_text_width_slp (xtext, new_buf, slp0);
	ent->slp = slp0;

	for (slp = slp0; slp; slp = g_slist_next (slp))
	{
		offlen_t *meta;

		meta = slp->data;
		meta->width = backend_get_text_width_emph (xtext, ent->str + meta->off, meta->len, meta->emph);
	}
	return width;
}

static int
gtk_xtext_text_width (GtkXText *xtext, unsigned char *text, int len)
{
	unsigned char *new_buf;
	int new_len;
	GSList *slp;
	int width;

	new_buf = gtk_xtext_strip_color (text, len, xtext->scratch_buffer,
												&new_len, &slp, !xtext->ignore_hidden);

	width =  backend_get_text_width_slp (xtext, new_buf, slp);
	g_slist_free_full (slp, g_free);

	return width;
}

/* actually draw text to screen (one run with the same color/attribs) */

static int
gtk_xtext_render_flush (GtkXText * xtext, int x, int y, unsigned char *str,
								int len, GdkGC *gc, int *emphasis)
{
	int str_width, dofill;
	GdkDrawable *pix = NULL;
	int dest_x = 0, dest_y = 0;

	if (xtext->dont_render || len < 1 || xtext->hidden)
		return 0;

	str_width = backend_get_text_width_emph (xtext, str, len, *emphasis);

	if (xtext->dont_render2)
		return str_width;

	/* roll-your-own clipping (avoiding XftDrawString is always good!) */
	if (x > xtext->clip_x2 || x + str_width < xtext->clip_x)
		return str_width;
	if (y - xtext->font->ascent > xtext->clip_y2 || (y - xtext->font->ascent) + xtext->fontsize < xtext->clip_y)
		return str_width;

	if (xtext->render_hilights_only)
	{
		if (!xtext->in_hilight)	/* is it a hilight prefix? */
			return str_width;
		if (!xtext->un_hilight)	/* doing a hilight? no need to draw the text */
			goto dounder;
	}

	pix = gdk_pixmap_new (xtext->draw_buf, str_width, xtext->fontsize, xtext->depth);
	if (pix)
	{
		dest_x = x;
		dest_y = y - xtext->font->ascent;

		gdk_gc_set_ts_origin (xtext->bgc, xtext->ts_x - x, xtext->ts_y - dest_y);

		x = 0;
		y = xtext->font->ascent;
		xtext->draw_buf = pix;
	}

	dofill = TRUE;

	/* backcolor is always handled by XDrawImageString */
	if (!xtext->backcolor && xtext->pixmap)
	{
	/* draw the background pixmap behind the text - CAUSES FLICKER HERE!! */
		xtext_draw_bg (xtext, x, y - xtext->font->ascent, str_width,
							xtext->fontsize);
		dofill = FALSE;	/* already drawn the background */
	}

	backend_draw_text_emph (xtext, dofill, gc, x, y, str, len, str_width, *emphasis);

	if (pix)
	{
		GdkRectangle clip;
		GdkRectangle dest;

		gdk_gc_set_ts_origin (xtext->bgc, xtext->ts_x, xtext->ts_y);
		xtext->draw_buf = GTK_WIDGET (xtext)->window;
		clip.x = xtext->clip_x;
		clip.y = xtext->clip_y;
		clip.width = xtext->clip_x2 - xtext->clip_x;
		clip.height = xtext->clip_y2 - xtext->clip_y;

		dest.x = dest_x;
		dest.y = dest_y;
		dest.width = str_width;
		dest.height = xtext->fontsize;

		if (gdk_rectangle_intersect (&clip, &dest, &dest))
			/* dump the DB to window, but only within the clip_x/x2/y/y2 */
			gdk_draw_drawable (xtext->draw_buf, xtext->bgc, pix,
									 dest.x - dest_x, dest.y - dest_y,
									 dest.x, dest.y, dest.width, dest.height);
		g_object_unref (pix);
	}

	if (xtext->underline)
	{
dounder:

		if (pix)
			y = dest_y + xtext->font->ascent + 1;
		else
		{
			y++;
			dest_x = x;
		}
		/* draw directly to window, it's out of the range of our DB */
		gdk_draw_line (xtext->draw_buf, gc, dest_x, y, dest_x + str_width - 1, y);
	}

	return str_width;
}

static void
gtk_xtext_reset (GtkXText * xtext, int mark, int attribs)
{
	if (attribs)
	{
		xtext->underline = FALSE;
		xtext->hidden = FALSE;
	}
	if (!mark)
	{
		xtext->backcolor = FALSE;
		if (xtext->col_fore != XTEXT_FG)
			xtext_set_fg (xtext, xtext->fgc, XTEXT_FG);
		if (xtext->col_back != XTEXT_BG)
			xtext_set_bg (xtext, xtext->fgc, XTEXT_BG);
	}
	xtext->col_fore = XTEXT_FG;
	xtext->col_back = XTEXT_BG;
	xtext->parsing_color = FALSE;
	xtext->parsing_backcolor = FALSE;
	xtext->nc = 0;
}

/*
 * gtk_xtext_search_offset (buf, ent, off) --
 * Look for arg offset in arg textentry
 * Return one or more flags:
 * 	GTK_MATCH_MID if we are in a match
 * 	GTK_MATCH_START if we're at the first byte of it
 * 	GTK_MATCH_END if we're at the first byte past it
 * 	GTK_MATCH_CUR if it is the current match
 */
#define GTK_MATCH_START	1
#define GTK_MATCH_MID	2
#define GTK_MATCH_END	4
#define GTK_MATCH_CUR	8
static int
gtk_xtext_search_offset (xtext_buffer *buf, textentry *ent, unsigned int off)
{
	GList *gl;
	offsets_t o;
	int flags = 0;

	for (gl = g_list_first (ent->marks); gl; gl = g_list_next (gl))
	{
		o.u = GPOINTER_TO_UINT (gl->data);
		if (off < o.o.start || off > o.o.end)
			continue;
		flags = GTK_MATCH_MID;
		if (off == o.o.start)
			flags |= GTK_MATCH_START;
		if (off == o.o.end)
		{
			gl = g_list_next (gl);
			if (gl)
			{
				o.u = GPOINTER_TO_UINT (gl->data);
				if (off ==  o.o.start)	/* If subseq match is adjacent */
				{
					flags |= (gl == buf->curmark)? GTK_MATCH_CUR: 0;
				}
				else		/* If subseq match is not adjacent */
				{
					flags |= GTK_MATCH_END;
				}
			}
			else		/* If there is no subseq match */
			{
				flags |= GTK_MATCH_END;
			}
		}
		else if (gl == buf->curmark)	/* If not yet at the end of this match */
		{
			flags |= GTK_MATCH_CUR;
		}
		break;
	}
	return flags;
}

/* render a single line, which WONT wrap, and parse mIRC colors */

#define RENDER_FLUSH x += gtk_xtext_render_flush (xtext, x, y, pstr, j, gc, emphasis)

static int
gtk_xtext_render_str (GtkXText * xtext, int y, textentry * ent,
							 unsigned char *str, int len, int win_width, int indent,
							 int line, int left_only, int *x_size_ret, int *emphasis)
{
	GdkGC *gc;
	int i = 0, x = indent, j = 0;
	unsigned char *pstr = str;
	int col_num, tmp;
	int offset;
	int mark = FALSE;
	int ret = 1;
	int k;
	int srch_underline = FALSE;
	int srch_mark = FALSE;

	xtext->in_hilight = FALSE;

	offset = str - ent->str;

	gc = xtext->fgc;				  /* our foreground GC */

	if (ent->mark_start != -1 &&
		 ent->mark_start <= i + offset && ent->mark_end > i + offset)
	{
		xtext_set_bg (xtext, gc, XTEXT_MARK_BG);
		xtext_set_fg (xtext, gc, XTEXT_MARK_FG);
		xtext->backcolor = TRUE;
		mark = TRUE;
	}
	if (xtext->hilight_ent == ent &&
		 xtext->hilight_start <= i + offset && xtext->hilight_end > i + offset)
	{
		if (!xtext->un_hilight)
		{
			xtext->underline = TRUE;
		}
		xtext->in_hilight = TRUE;
	}

	if (!xtext->skip_border_fills && !xtext->dont_render)
	{
		/* draw background to the left of the text */
		if (str == ent->str && indent > MARGIN && xtext->buffer->time_stamp)
		{
			/* don't overwrite the timestamp */
			if (indent > xtext->stamp_width)
			{
				xtext_draw_bg (xtext, xtext->stamp_width, y - xtext->font->ascent,
									indent - xtext->stamp_width, xtext->fontsize);
			}
		} else
		{
			/* fill the indent area with background gc */
			if (indent >= xtext->clip_x)
			{
				xtext_draw_bg (xtext, 0, y - xtext->font->ascent,
									MIN (indent, xtext->clip_x2), xtext->fontsize);
			}
		}
	}

	if (xtext->jump_in_offset > 0 && offset < xtext->jump_in_offset)
		xtext->dont_render2 = TRUE;

	while (i < len)
	{

		if (xtext->hilight_ent == ent && xtext->hilight_start == (i + offset))
		{
			RENDER_FLUSH;
			pstr += j;
			j = 0;
			if (!xtext->un_hilight)
			{
				xtext->underline = TRUE;
			}

			xtext->in_hilight = TRUE;
		}

		if ((xtext->parsing_color && isdigit (str[i]) && xtext->nc < 2) ||
			 (xtext->parsing_color && str[i] == ',' && isdigit (str[i+1]) && xtext->nc < 3 && !xtext->parsing_backcolor))
		{
			pstr++;
			if (str[i] == ',')
			{
				xtext->parsing_backcolor = TRUE;
				if (xtext->nc)
				{
					xtext->num[xtext->nc] = 0;
					xtext->nc = 0;
					col_num = atoi (xtext->num);
					if (col_num == 99)	/* mIRC lameness */
						col_num = XTEXT_FG;
					else
					if (col_num > XTEXT_MAX_COLOR)
						col_num = col_num % XTEXT_MIRC_COLS;
					xtext->col_fore = col_num;
					if (!mark)
						xtext_set_fg (xtext, gc, col_num);
				}
			} else
			{
				xtext->num[xtext->nc] = str[i];
				if (xtext->nc < 7)
					xtext->nc++;
			}
		} else
		{
			if (xtext->parsing_color)
			{
				xtext->parsing_color = FALSE;
				if (xtext->nc)
				{
					xtext->num[xtext->nc] = 0;
					xtext->nc = 0;
					col_num = atoi (xtext->num);
					if (xtext->parsing_backcolor)
					{
						if (col_num == 99)	/* mIRC lameness */
							col_num = XTEXT_BG;
						else
						if (col_num > XTEXT_MAX_COLOR)
							col_num = col_num % XTEXT_MIRC_COLS;
						if (col_num == XTEXT_BG)
							xtext->backcolor = FALSE;
						else
							xtext->backcolor = TRUE;
						if (!mark)
							xtext_set_bg (xtext, gc, col_num);
						xtext->col_back = col_num;
					} else
					{
						if (col_num == 99)	/* mIRC lameness */
							col_num = XTEXT_FG;
						else
						if (col_num > XTEXT_MAX_COLOR)
							col_num = col_num % XTEXT_MIRC_COLS;
						if (!mark)
							xtext_set_fg (xtext, gc, col_num);
						xtext->col_fore = col_num;
					}
					xtext->parsing_backcolor = FALSE;
				} else
				{
					/* got a \003<non-digit>... i.e. reset colors */
					RENDER_FLUSH;
					pstr += j;
					j = 0;
					gtk_xtext_reset (xtext, mark, FALSE);
				}
			}

			if (!left_only && !mark &&
				 (k = gtk_xtext_search_offset (xtext->buffer, ent, offset + i)))
			{
				RENDER_FLUSH;
				pstr += j;
				j = 0;
				if (!(xtext->buffer->search_flags & highlight))
				{
					if (k & GTK_MATCH_CUR)
					{
						xtext_set_bg (xtext, gc, XTEXT_MARK_BG);
						xtext_set_fg (xtext, gc, XTEXT_MARK_FG);
						xtext->backcolor = TRUE;
						srch_mark = TRUE;
					} else
					{
						xtext_set_bg (xtext, gc, xtext->col_back);
						xtext_set_fg (xtext, gc, xtext->col_fore);
						xtext->backcolor = (xtext->col_back != XTEXT_BG)? TRUE: FALSE;
						srch_mark = FALSE;
					}
				}
				else
				{
					xtext->underline = (k & GTK_MATCH_CUR)? TRUE: FALSE;
					if (k & (GTK_MATCH_START | GTK_MATCH_MID))
					{
						xtext_set_bg (xtext, gc, XTEXT_MARK_BG);
						xtext_set_fg (xtext, gc, XTEXT_MARK_FG);
						xtext->backcolor = TRUE;
						srch_mark = TRUE;
					}
					if (k & GTK_MATCH_END)
					{
						xtext_set_bg (xtext, gc, xtext->col_back);
						xtext_set_fg (xtext, gc, xtext->col_fore);
						xtext->backcolor = (xtext->col_back != XTEXT_BG)? TRUE: FALSE;
						srch_mark = FALSE;
						xtext->underline = FALSE;
					}
					srch_underline = xtext->underline;
				}
			}

			switch (str[i])
			{
			case '\n':
			/*case ATTR_BEEP:*/
				break;
			case ATTR_REVERSE:
				RENDER_FLUSH;
				pstr += j + 1;
				j = 0;
				tmp = xtext->col_fore;
				xtext->col_fore = xtext->col_back;
				xtext->col_back = tmp;
				if (!mark)
				{
					xtext_set_fg (xtext, gc, xtext->col_fore);
					xtext_set_bg (xtext, gc, xtext->col_back);
				}
				if (xtext->col_back != XTEXT_BG)
					xtext->backcolor = TRUE;
				else
					xtext->backcolor = FALSE;
				break;
			case ATTR_BOLD:
				RENDER_FLUSH;
				*emphasis ^= EMPH_BOLD;
				pstr += j + 1;
				j = 0;
				break;
			case ATTR_UNDERLINE:
				RENDER_FLUSH;
				xtext->underline = !xtext->underline;
				pstr += j + 1;
				j = 0;
				break;
			case ATTR_ITALICS:
				RENDER_FLUSH;
				*emphasis ^= EMPH_ITAL;
				pstr += j + 1;
				j = 0;
				break;
			case ATTR_HIDDEN:
				RENDER_FLUSH;
				xtext->hidden = (!xtext->hidden) & (!xtext->ignore_hidden);
				pstr += j + 1;
				j = 0;
				break;
			case ATTR_RESET:
				RENDER_FLUSH;
				*emphasis = 0;
				pstr += j + 1;
				j = 0;
				gtk_xtext_reset (xtext, mark, !xtext->in_hilight);
				break;
			case ATTR_COLOR:
				RENDER_FLUSH;
				xtext->parsing_color = TRUE;
				pstr += j + 1;
				j = 0;
				break;
			default:
				tmp = charlen (str + i);
				/* invalid utf8 safe guard */
				if (tmp + i > len)
					tmp = len - i;
				j += tmp;	/* move to the next utf8 char */
			}
		}
		i += charlen (str + i);	/* move to the next utf8 char */
		/* invalid utf8 safe guard */
		if (i > len)
			i = len;

		/* Separate the left part, the space and the right part
		   into separate runs, and reset bidi state inbetween.
		   Perform this only on the first line of the message.
                */
		if (offset == 0)
		{
			/* we've reached the end of the left part? */
			if ((pstr-str)+j == ent->left_len)
			{
				RENDER_FLUSH;
				pstr += j;
				j = 0;
			}
			else if ((pstr-str)+j == ent->left_len+1)
			{
				RENDER_FLUSH;
				pstr += j;
				j = 0;
			}
		}

		/* have we been told to stop rendering at this point? */
		if (xtext->jump_out_offset > 0 && xtext->jump_out_offset <= (i + offset))
		{
			gtk_xtext_render_flush (xtext, x, y, pstr, j, gc, emphasis);
			ret = 0;	/* skip the rest of the lines, we're done. */
			j = 0;
			break;
		}

		if (xtext->jump_in_offset > 0 && xtext->jump_in_offset == (i + offset))
		{
			RENDER_FLUSH;
			pstr += j;
			j = 0;
			xtext->dont_render2 = FALSE;
		}

		if (xtext->hilight_ent == ent && xtext->hilight_end == (i + offset))
		{
			RENDER_FLUSH;
			pstr += j;
			j = 0;
			xtext->underline = FALSE;
			xtext->in_hilight = FALSE;
			if (xtext->render_hilights_only)
			{
				/* stop drawing this ent */
				ret = 0;
				break;
			}
		}

		if (!mark && ent->mark_start == (i + offset))
		{
			RENDER_FLUSH;
			pstr += j;
			j = 0;
			xtext_set_bg (xtext, gc, XTEXT_MARK_BG);
			xtext_set_fg (xtext, gc, XTEXT_MARK_FG);
			xtext->backcolor = TRUE;
			if (srch_underline)
			{
				xtext->underline = FALSE;
				srch_underline = FALSE;
			}
			mark = TRUE;
		}

		if (mark && ent->mark_end == (i + offset))
		{
			RENDER_FLUSH;
			pstr += j;
			j = 0;
			xtext_set_bg (xtext, gc, xtext->col_back);
			xtext_set_fg (xtext, gc, xtext->col_fore);
			if (xtext->col_back != XTEXT_BG)
				xtext->backcolor = TRUE;
			else
				xtext->backcolor = FALSE;
			mark = FALSE;
		}

	}

	if (j)
		RENDER_FLUSH;

	if (mark || srch_mark)
	{
		xtext_set_bg (xtext, gc, xtext->col_back);
		xtext_set_fg (xtext, gc, xtext->col_fore);
		if (xtext->col_back != XTEXT_BG)
			xtext->backcolor = TRUE;
		else
			xtext->backcolor = FALSE;
	}

	/* draw background to the right of the text */
	if (!left_only && !xtext->dont_render)
	{
		/* draw separator now so it doesn't appear to flicker */
		gtk_xtext_draw_sep (xtext, y - xtext->font->ascent);
		if (!xtext->skip_border_fills && xtext->clip_x2 >= x)
		{
			int xx = MAX (x, xtext->clip_x);

			xtext_draw_bg (xtext,
								xx,	/* x */
								y - xtext->font->ascent, /* y */
				MIN (xtext->clip_x2 - xx, (win_width + MARGIN) - xx), /* width */
								xtext->fontsize);		/* height */
		}
	}

	xtext->dont_render2 = FALSE;

	/* return how much we drew in the x direction */
	if (x_size_ret)
		*x_size_ret = x - indent;

	return ret;
}

/* walk through str until this line doesn't fit anymore */

static int
find_next_wrap (GtkXText * xtext, textentry * ent, unsigned char *str,
					 int win_width, int indent)
{
	unsigned char *last_space = str;
	unsigned char *orig_str = str;
	int str_width = indent;
	int rcol = 0, bgcol = 0;
	int hidden = FALSE;
	int mbl;
	int char_width;
	int ret;
	int limit_offset = 0;
	int emphasis = 0;
	GSList *lp;

	/* single liners */
	if (win_width >= ent->str_width + ent->indent)
		return ent->str_len;

	/* it does happen! */
	if (win_width < 1)
	{
		ret = ent->str_len - (str - ent->str);
		goto done;
	}

	/* Find emphasis value for the offset that is the first byte of our string */
	for (lp = ent->slp; lp; lp = g_slist_next (lp))
	{
		offlen_t *meta = lp->data;
		unsigned char *start, *end;

		start = ent->str + meta->off;
		end = start + meta->len;
		if (str >= start && str < end)
		{
			emphasis = meta->emph;
			break;
		}
	}

	while (1)
	{
		if (rcol > 0 && (isdigit (*str) || (*str == ',' && isdigit (str[1]) && !bgcol)))
		{
			if (str[1] != ',') rcol--;
			if (*str == ',')
			{
				rcol = 2;
				bgcol = 1;
			}
			limit_offset++;
			str++;
		} else
		{
			rcol = bgcol = 0;
			switch (*str)
			{
			case ATTR_COLOR:
				rcol = 2;
			case ATTR_BEEP:
			case ATTR_RESET:
			case ATTR_REVERSE:
			case ATTR_BOLD:
			case ATTR_UNDERLINE:
			case ATTR_ITALICS:
				if (*str == ATTR_RESET)
					emphasis = 0;
				if (*str == ATTR_ITALICS)
					emphasis ^= EMPH_ITAL;
				if (*str == ATTR_BOLD)
					emphasis ^= EMPH_BOLD;
				limit_offset++;
				str++;
				break;
			case ATTR_HIDDEN:
				if (xtext->ignore_hidden)
					goto def;
				hidden = !hidden;
				limit_offset++;
				str++;
				break;
			default:
			def:
				mbl = charlen (str);
				char_width = backend_get_text_width_emph (xtext, str, mbl, emphasis);
				if (!hidden) str_width += char_width;
				if (str_width > win_width)
				{
					if (xtext->wordwrap)
					{
						if (str - last_space > WORDWRAP_LIMIT + limit_offset)
							ret = str - orig_str; /* fall back to character wrap */
						else
						{
							if (*last_space == ' ')
								last_space++;
							ret = last_space - orig_str;
							if (ret == 0) /* fall back to character wrap */
								ret = str - orig_str;
						}
						goto done;
					}
					ret = str - orig_str;
					goto done;
				}

				/* keep a record of the last space, for wordwrapping */
				if (is_del (*str))
				{
					last_space = str;
					limit_offset = 0;
				}

				/* progress to the next char */
				str += mbl;

			}
		}

		if (str >= ent->str + ent->str_len)
		{
			ret = str - orig_str;
			goto done;
		}
	}

done:

	/* must make progress */
	if (ret < 1)
		ret = 1;

	return ret;
}

/* find the offset, in bytes, that wrap number 'line' starts at */

static int
gtk_xtext_find_subline (GtkXText *xtext, textentry *ent, int line)
{
	int rlen = 0;

	if (line > 0)
	{
		rlen = GPOINTER_TO_UINT (g_slist_nth_data (ent->sublines, line - 1));
		if (rlen == 0)
			rlen = ent->str_len;
	}
	return rlen;
}

/* horrible hack for drawing time stamps */

static void
gtk_xtext_render_stamp (GtkXText * xtext, textentry * ent,
								char *text, int len, int line, int win_width)
{
	textentry tmp_ent;
	int jo, ji, hs;
	int xsize, y, emphasis;

	/* trashing ent here, so make a backup first */
	memcpy (&tmp_ent, ent, sizeof (tmp_ent));
	jo = xtext->jump_out_offset;	/* back these up */
	ji = xtext->jump_in_offset;
	hs = xtext->hilight_start;
	xtext->jump_out_offset = 0;
	xtext->jump_in_offset = 0;
	xtext->hilight_start = 0xffff;	/* temp disable */
	emphasis = 0;

	if (xtext->mark_stamp)
	{
		/* if this line is marked, mark this stamp too */
		if (ent->mark_start == 0)	
		{
			ent->mark_start = 0;
			ent->mark_end = len;
		}
		else
		{
			ent->mark_start = -1;
			ent->mark_end = -1;
		}
		ent->str = text;
	}

	y = (xtext->fontsize * line) + xtext->font->ascent - xtext->pixel_offset;
	gtk_xtext_render_str (xtext, y, ent, text, len,
								 win_width, 2, line, TRUE, &xsize, &emphasis);

	/* restore everything back to how it was */
	memcpy (ent, &tmp_ent, sizeof (tmp_ent));
	xtext->jump_out_offset = jo;
	xtext->jump_in_offset = ji;
	xtext->hilight_start = hs;

	/* with a non-fixed-width font, sometimes we don't draw enough
		background i.e. when this stamp is shorter than xtext->stamp_width */
	xsize += MARGIN;
	if (xsize < xtext->stamp_width)
	{
		y -= xtext->font->ascent;
		xtext_draw_bg (xtext,
							xsize,	/* x */
							y,			/* y */
							xtext->stamp_width - xsize,	/* width */
							xtext->fontsize					/* height */);
	}
}

/* render a single line, which may wrap to more lines */

static int
gtk_xtext_render_line (GtkXText * xtext, textentry * ent, int line,
							  int lines_max, int subline, int win_width)
{
	unsigned char *str;
	int indent, taken, entline, len, y, start_subline;
	int emphasis = 0;

	entline = taken = 0;
	str = ent->str;
	indent = ent->indent;
	start_subline = subline;

	/* draw the timestamp */
	if (xtext->auto_indent && xtext->buffer->time_stamp &&
		 (!xtext->skip_stamp || xtext->mark_stamp || xtext->force_stamp))
	{
		char *time_str;
		int len;

		len = xtext_get_stamp_str (ent->stamp, &time_str);
		gtk_xtext_render_stamp (xtext, ent, time_str, len, line, win_width);
		g_free (time_str);
	}

	/* draw each line one by one */
	do
	{
		if (entline > 0)
			len = GPOINTER_TO_INT (g_slist_nth_data (ent->sublines, entline)) - GPOINTER_TO_INT (g_slist_nth_data (ent->sublines, entline - 1));
		else
			len = GPOINTER_TO_INT (g_slist_nth_data (ent->sublines, entline));

		entline++;

		y = (xtext->fontsize * line) + xtext->font->ascent - xtext->pixel_offset;
		if (!subline)
		{
			if (!gtk_xtext_render_str (xtext, y, ent, str, len, win_width,
												indent, line, FALSE, NULL, &emphasis))
			{
				/* small optimization */
				gtk_xtext_draw_marker (xtext, ent, y - xtext->fontsize * (taken + start_subline + 1));
				return g_slist_length (ent->sublines) - subline;
			}
		} else
		{
			xtext->dont_render = TRUE;
			gtk_xtext_render_str (xtext, y, ent, str, len, win_width,
										 indent, line, FALSE, NULL, &emphasis);
			xtext->dont_render = FALSE;
			subline--;
			line--;
			taken--;
		}

		indent = xtext->buffer->indent;
		line++;
		taken++;
		str += len;

		if (line >= lines_max)
			break;

	}
	while (str < ent->str + ent->str_len);

	gtk_xtext_draw_marker (xtext, ent, y - xtext->fontsize * (taken + start_subline));

	return taken;
}

void
gtk_xtext_set_palette (GtkXText * xtext, GdkColor palette[])
{
	int i;

	for (i = (XTEXT_COLS-1); i >= 0; i--)
	{
		xtext->palette[i] = palette[i];
	}

	if (gtk_widget_get_realized (GTK_WIDGET(xtext)))
	{
		xtext_set_fg (xtext, xtext->fgc, XTEXT_FG);
		xtext_set_bg (xtext, xtext->fgc, XTEXT_BG);
		xtext_set_fg (xtext, xtext->bgc, XTEXT_BG);

		gdk_gc_set_foreground (xtext->marker_gc, &xtext->palette[XTEXT_MARKER]);
	}
	xtext->col_fore = XTEXT_FG;
	xtext->col_back = XTEXT_BG;
}

static void
gtk_xtext_fix_indent (xtext_buffer *buf)
{
	int j;

	/* make indent a multiple of the space width */
	if (buf->indent && buf->xtext->space_width)
	{
		j = 0;
		while (j < buf->indent)
		{
			j += buf->xtext->space_width;
		}
		buf->indent = j;
	}

	dontscroll (buf);	/* force scrolling off */
}

static void
gtk_xtext_recalc_widths (xtext_buffer *buf, int do_str_width)
{
	textentry *ent;

	/* since we have a new font, we have to recalc the text widths */
	ent = buf->text_first;
	while (ent)
	{
		if (do_str_width)
		{
			ent->str_width = gtk_xtext_text_width_ent (buf->xtext, ent);
		}
		if (ent->left_len != -1)
		{
			ent->indent =
				(buf->indent -
				 gtk_xtext_text_width (buf->xtext, ent->str,
										ent->left_len)) - buf->xtext->space_width;
			if (ent->indent < MARGIN)
				ent->indent = MARGIN;
		}
		ent = ent->next;
	}

	gtk_xtext_calc_lines (buf, FALSE);
}

int
gtk_xtext_set_font (GtkXText *xtext, char *name)
{

	if (xtext->font)
		backend_font_close (xtext);

	/* realize now, so that font_open has a XDisplay */
	gtk_widget_realize (GTK_WIDGET (xtext));

	backend_font_open (xtext, name);
	if (xtext->font == NULL)
		return FALSE;

	xtext->fontsize = xtext->font->ascent + xtext->font->descent;

	{
		char *time_str;
		int stamp_size = xtext_get_stamp_str (time(0), &time_str);
		xtext->stamp_width =
			gtk_xtext_text_width (xtext, time_str, stamp_size) + MARGIN;
		g_free (time_str);
	}

	gtk_xtext_fix_indent (xtext->buffer);

	if (gtk_widget_get_realized (GTK_WIDGET(xtext)))
		gtk_xtext_recalc_widths (xtext->buffer, TRUE);

	return TRUE;
}

void
gtk_xtext_set_background (GtkXText * xtext, GdkPixmap * pixmap)
{
	GdkGCValues val;

	if (xtext->pixmap)
	{
		g_object_unref (xtext->pixmap);
		xtext->pixmap = NULL;
	}

	dontscroll (xtext->buffer);
	xtext->pixmap = pixmap;

	if (pixmap != 0)
	{
		g_object_ref (pixmap);
		if (gtk_widget_get_realized (GTK_WIDGET(xtext)))
		{
			gdk_gc_set_tile (xtext->bgc, pixmap);
			gdk_gc_set_ts_origin (xtext->bgc, 0, 0);
			xtext->ts_x = xtext->ts_y = 0;
			gdk_gc_set_fill (xtext->bgc, GDK_TILED);
		}
	} else if (gtk_widget_get_realized (GTK_WIDGET(xtext)))
	{
		g_object_unref (xtext->bgc);
		val.subwindow_mode = GDK_INCLUDE_INFERIORS;
		val.graphics_exposures = 0;
		xtext->bgc = gdk_gc_new_with_values (GTK_WIDGET (xtext)->window,
								&val, GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW);
		xtext_set_fg (xtext, xtext->bgc, XTEXT_BG);
	}
}

void
gtk_xtext_save (GtkXText * xtext, int fh)
{
	textentry *ent;
	int newlen;
	char *buf;

	ent = xtext->buffer->text_first;
	while (ent)
	{
		buf = gtk_xtext_strip_color (ent->str, ent->str_len, NULL,
											  &newlen, NULL, FALSE);
		write (fh, buf, newlen);
		write (fh, "\n", 1);
		g_free (buf);
		ent = ent->next;
	}
}

/* count how many lines 'ent' will take (with wraps) */

static int
gtk_xtext_lines_taken (xtext_buffer *buf, textentry * ent)
{
	unsigned char *str;
	int indent, len;
	int win_width;

	g_slist_free (ent->sublines);
	ent->sublines = NULL;
	win_width = buf->window_width - MARGIN;

	if (win_width >= ent->indent + ent->str_width)
	{
		ent->sublines = g_slist_append (ent->sublines, GINT_TO_POINTER (ent->str_len));
		return 1;
	}

	indent = ent->indent;
	str = ent->str;

	do
	{
		len = find_next_wrap (buf->xtext, ent, str, win_width, indent);
		ent->sublines = g_slist_append (ent->sublines, GINT_TO_POINTER (str + len - ent->str));
		indent = buf->indent;
		str += len;
	}
	while (str < ent->str + ent->str_len);

	return g_slist_length (ent->sublines);
}

/* Calculate number of actual lines (with wraps), to set adj->lower. *
 * This should only be called when the window resizes.               */

static void
gtk_xtext_calc_lines (xtext_buffer *buf, int fire_signal)
{
	textentry *ent;
	int width;
	int height;
	int lines;

	height = gdk_window_get_height (gtk_widget_get_window (GTK_WIDGET (buf->xtext)));
	width = gdk_window_get_width (gtk_widget_get_window (GTK_WIDGET (buf->xtext)));
	width -= MARGIN;

	if (width < 30 || height < buf->xtext->fontsize || width < buf->indent + 30)
		return;

	lines = 0;
	ent = buf->text_first;
	while (ent)
	{
		lines += gtk_xtext_lines_taken (buf, ent);
		ent = ent->next;
	}

	buf->pagetop_ent = NULL;
	buf->num_lines = lines;
	gtk_xtext_adjustment_set (buf, fire_signal);
}

/* find the n-th line in the linked list, this includes wrap calculations */

static textentry *
gtk_xtext_nth (GtkXText *xtext, int line, int *subline)
{
	int lines = 0;
	textentry *ent;

	ent = xtext->buffer->text_first;

	/* -- optimization -- try to make a short-cut using the pagetop ent */
	if (xtext->buffer->pagetop_ent)
	{
		if (line == xtext->buffer->pagetop_line)
		{
			*subline = xtext->buffer->pagetop_subline;
			return xtext->buffer->pagetop_ent;
		}
		if (line > xtext->buffer->pagetop_line)
		{
			/* lets start from the pagetop instead of the absolute beginning */
			ent = xtext->buffer->pagetop_ent;
			lines = xtext->buffer->pagetop_line - xtext->buffer->pagetop_subline;
		}
		else if (line > xtext->buffer->pagetop_line - line)
		{
			/* move backwards from pagetop */
			ent = xtext->buffer->pagetop_ent;
			lines = xtext->buffer->pagetop_line - xtext->buffer->pagetop_subline;
			while (1)
			{
				if (lines <= line)
				{
					*subline = line - lines;
					return ent;
				}
				ent = ent->prev;
				if (!ent)
					break;
				lines -= g_slist_length (ent->sublines);
			}
			return NULL;
		}
	}
	/* -- end of optimization -- */

	while (ent)
	{
		lines += g_slist_length (ent->sublines);
		if (lines > line)
		{
			*subline = g_slist_length (ent->sublines) - (lines - line);
			return ent;
		}
		ent = ent->next;
	}
	return NULL;
}

/* render enta (or an inclusive range enta->entb) */

static int
gtk_xtext_render_ents (GtkXText * xtext, textentry * enta, textentry * entb)
{
	textentry *ent, *orig_ent, *tmp_ent;
	int line;
	int lines_max;
	int width;
	int height;
	int subline;
	int drawing = FALSE;

	if (xtext->buffer->indent < MARGIN)
		xtext->buffer->indent = MARGIN;	  /* 2 pixels is our left margin */

	height = gdk_window_get_height (gtk_widget_get_window (GTK_WIDGET (xtext)));
	width = gdk_window_get_width (gtk_widget_get_window (GTK_WIDGET (xtext)));
	width -= MARGIN;

	if (width < 32 || height < xtext->fontsize || width < xtext->buffer->indent + 30)
		return 0;

	lines_max = ((height + xtext->pixel_offset) / xtext->fontsize) + 1;
	line = 0;
	orig_ent = xtext->buffer->pagetop_ent;
	subline = xtext->buffer->pagetop_subline;

	/* used before a complete page is in buffer */
	if (orig_ent == NULL)
		orig_ent = xtext->buffer->text_first;

	/* check if enta is before the start of this page */
	if (entb)
	{
		tmp_ent = orig_ent;
		while (tmp_ent)
		{
			if (tmp_ent == enta)
				break;
			if (tmp_ent == entb)
			{
				drawing = TRUE;
				break;
			}
			tmp_ent = tmp_ent->next;
		}
	}

	ent = orig_ent;
	while (ent)
	{
		if (entb && ent == enta)
			drawing = TRUE;

		if (drawing || ent == entb || ent == enta)
		{
			gtk_xtext_reset (xtext, FALSE, TRUE);
			line += gtk_xtext_render_line (xtext, ent, line, lines_max,
													 subline, width);
			subline = 0;
			xtext->jump_in_offset = 0;	/* jump_in_offset only for the 1st */
		} else
		{
			if (ent == orig_ent)
			{
				line -= subline;
				subline = 0;
			}
			line += g_slist_length (ent->sublines);
		}

		if (ent == entb)
			break;

		if (line >= lines_max)
			break;

		ent = ent->next;
	}

	/* space below last line */
	return (xtext->fontsize * line) - xtext->pixel_offset;
}

/* render a whole page/window, starting from 'startline' */

static void
gtk_xtext_render_page (GtkXText * xtext)
{
	textentry *ent;
	int line;
	int lines_max;
	int width;
	int height;
	int subline;
	int startline = xtext->adj->value;
	int pos, overlap;

	if(!gtk_widget_get_realized(GTK_WIDGET(xtext)))
	  return;

	if (xtext->buffer->indent < MARGIN)
		xtext->buffer->indent = MARGIN;	  /* 2 pixels is our left margin */

	gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height);

	if (width < 34 || height < xtext->fontsize || width < xtext->buffer->indent + 32)
		return;

	xtext->pixel_offset = (xtext->adj->value - startline) * xtext->fontsize;

	subline = line = 0;
	ent = xtext->buffer->text_first;

	if (startline > 0)
		ent = gtk_xtext_nth (xtext, startline, &subline);

	xtext->buffer->pagetop_ent = ent;
	xtext->buffer->pagetop_subline = subline;
	xtext->buffer->pagetop_line = startline;

	if (xtext->buffer->num_lines <= xtext->adj->page_size)
		dontscroll (xtext->buffer);

	pos = xtext->adj->value * xtext->fontsize;
	overlap = xtext->buffer->last_pixel_pos - pos;
	xtext->buffer->last_pixel_pos = pos;

#ifndef __APPLE__
	if (!xtext->pixmap && abs (overlap) < height)
	{
		GdkRectangle area;

		/* so the obscured regions are exposed */
		gdk_gc_set_exposures (xtext->fgc, TRUE);
		if (overlap < 1)	/* DOWN */
		{
			int remainder;

			gdk_draw_drawable (xtext->draw_buf, xtext->fgc, xtext->draw_buf,
									 0, -overlap, 0, 0, width, height + overlap);
			remainder = ((height - xtext->font->descent) % xtext->fontsize) +
							xtext->font->descent;
			area.y = (height + overlap) - remainder;
			area.height = remainder - overlap;
		} else
		{
			gdk_draw_drawable (xtext->draw_buf, xtext->fgc, xtext->draw_buf,
									 0, 0, 0, overlap, width, height - overlap);
			area.y = 0;
			area.height = overlap;
		}
		gdk_gc_set_exposures (xtext->fgc, FALSE);

		if (area.height > 0)
		{
			area.x = 0;
			area.width = width;
			gtk_xtext_paint (GTK_WIDGET (xtext), &area);
		}

		return;
	}
#endif

	width -= MARGIN;
	lines_max = ((height + xtext->pixel_offset) / xtext->fontsize) + 1;

	while (ent)
	{
		gtk_xtext_reset (xtext, FALSE, TRUE);
		line += gtk_xtext_render_line (xtext, ent, line, lines_max,
												 subline, width);
		subline = 0;

		if (line >= lines_max)
			break;

		ent = ent->next;
	}

	line = (xtext->fontsize * line) - xtext->pixel_offset;
	/* fill any space below the last line with our background GC */
	xtext_draw_bg (xtext, 0, line, width + MARGIN, height - line);

	/* draw the separator line */
	gtk_xtext_draw_sep (xtext, -1);
}

void
gtk_xtext_refresh (GtkXText * xtext)
{
	if (gtk_widget_get_realized (GTK_WIDGET (xtext)))
	{
		gtk_xtext_render_page (xtext);
	}
}

static int
gtk_xtext_kill_ent (xtext_buffer *buffer, textentry *ent)
{
	int visible;

	/* Set visible to TRUE if this is the current buffer */
	/* and this ent shows up on the screen now */
	visible = buffer->xtext->buffer == buffer &&
				 gtk_xtext_check_ent_visibility (buffer->xtext, ent, 0);

	if (ent == buffer->pagetop_ent)
		buffer->pagetop_ent = NULL;

	if (ent == buffer->last_ent_start)
	{
		buffer->last_ent_start = ent->next;
		buffer->last_offset_start = 0;
	}

	if (ent == buffer->last_ent_end)
	{
		buffer->last_ent_start = NULL;
		buffer->last_ent_end = NULL;
	}

	if (buffer->marker_pos == ent)
	{
		/* Allow for "Marker line reset because exceeded scrollback limit. to appear. */
		buffer->marker_pos = ent->next;
		buffer->marker_state = MARKER_RESET_BY_KILL;
	}

	if (ent->marks)
	{
		gtk_xtext_search_textentry_del (buffer, ent);
	}

	g_slist_free_full (ent->slp, g_free);
	g_slist_free (ent->sublines);

	g_free (ent);
	return visible;
}

/* remove the topline from the list */

static void
gtk_xtext_remove_top (xtext_buffer *buffer)
{
	textentry *ent;

	ent = buffer->text_first;
	if (!ent)
		return;
	buffer->num_lines -= g_slist_length (ent->sublines);
	buffer->pagetop_line -= g_slist_length (ent->sublines);
	buffer->last_pixel_pos -= (g_slist_length (ent->sublines) * buffer->xtext->fontsize);
	buffer->text_first = ent->next;
	if (buffer->text_first)
		buffer->text_first->prev = NULL;
	else
		buffer->text_last = NULL;

	buffer->old_value -= g_slist_length (ent->sublines);
	if (buffer->xtext->buffer == buffer)	/* is it the current buffer? */
	{
		buffer->xtext->adj->value -= g_slist_length (ent->sublines);
		buffer->xtext->select_start_adj -= g_slist_length (ent->sublines);
	}

	if (gtk_xtext_kill_ent (buffer, ent))
	{
		if (!buffer->xtext->add_io_tag)
		{
			/* remove scrolling events */
			if (buffer->xtext->io_tag)
			{
				g_source_remove (buffer->xtext->io_tag);
				buffer->xtext->io_tag = 0;
			}
			buffer->xtext->force_render = TRUE;
			buffer->xtext->add_io_tag = g_timeout_add (REFRESH_TIMEOUT * 2,
														(GSourceFunc)
														gtk_xtext_render_page_timeout,
														buffer->xtext);
		}
	}
}

static void
gtk_xtext_remove_bottom (xtext_buffer *buffer)
{
	textentry *ent;

	ent = buffer->text_last;
	if (!ent)
		return;
	buffer->num_lines -= g_slist_length (ent->sublines);
	buffer->text_last = ent->prev;
	if (buffer->text_last)
		buffer->text_last->next = NULL;
	else
		buffer->text_first = NULL;

	if (gtk_xtext_kill_ent (buffer, ent))
	{
		if (!buffer->xtext->add_io_tag)
		{
			/* remove scrolling events */
			if (buffer->xtext->io_tag)
			{
				g_source_remove (buffer->xtext->io_tag);
				buffer->xtext->io_tag = 0;
			}
			buffer->xtext->force_render = TRUE;
			buffer->xtext->add_io_tag = g_timeout_add (REFRESH_TIMEOUT * 2,
														(GSourceFunc)
														gtk_xtext_render_page_timeout,
														buffer->xtext);
		}
	}
}

/* If lines=0 => clear all */

void
gtk_xtext_clear (xtext_buffer *buf, int lines)
{
	textentry *next;
	int marker_reset = FALSE;

	if (lines != 0)
	{
		if (lines < 0)
		{
			/* delete lines from bottom */
			lines *= -1;
			while (lines)
			{
				if (buf->text_last == buf->marker_pos)
					marker_reset = TRUE;
				gtk_xtext_remove_bottom (buf);
				lines--;
			}
		}
		else
		{
			/* delete lines from top */
			while (lines)
			{
				if (buf->text_first == buf->marker_pos)
					marker_reset = TRUE;
				gtk_xtext_remove_top (buf);
				lines--;
			}
		}
	}
	else
	{
		/* delete all */
		if (buf->search_found)
			gtk_xtext_search_fini (buf);
		if (buf->xtext->auto_indent)
			buf->indent = MARGIN;
		buf->scrollbar_down = TRUE;
		buf->last_ent_start = NULL;
		buf->last_ent_end = NULL;
		buf->marker_pos = NULL;
		if (buf->text_first)
			marker_reset = TRUE;
		dontscroll (buf);

		while (buf->text_first)
		{
			next = buf->text_first->next;
			g_free (buf->text_first);
			buf->text_first = next;
		}
		buf->text_last = NULL;
	}

	if (buf->xtext->buffer == buf)
	{
		gtk_xtext_calc_lines (buf, TRUE);
		gtk_xtext_refresh (buf->xtext);
	} else
	{
		gtk_xtext_calc_lines (buf, FALSE);
	}

	if (marker_reset)
		buf->marker_state = MARKER_RESET_BY_CLEAR;
}

static gboolean
gtk_xtext_check_ent_visibility (GtkXText * xtext, textentry *find_ent, int add)
{
	textentry *ent;
	int lines;
	xtext_buffer *buf = xtext->buffer;
	int height;

	if (find_ent == NULL)
	{
		return FALSE;
	}

	height = gdk_window_get_height (gtk_widget_get_window (GTK_WIDGET (xtext)));

	ent = buf->pagetop_ent;
	/* If top line not completely displayed return FALSE */
	if (ent == find_ent && buf->pagetop_subline > 0)
	{
		return FALSE;
	}
	/* Loop through line positions looking for find_ent */
	lines = ((height + xtext->pixel_offset) / xtext->fontsize) + buf->pagetop_subline + add;
	while (ent)	
	{
		lines -= g_slist_length (ent->sublines);
		if (lines <= 0)
		{
			return FALSE;
		}
		if (ent == find_ent)
		{
			return TRUE;
		}
		ent = ent->next;
	}

	return FALSE;
}

void
gtk_xtext_check_marker_visibility (GtkXText * xtext)
{
	if (gtk_xtext_check_ent_visibility (xtext, xtext->buffer->marker_pos, 1))
		xtext->buffer->marker_seen = TRUE;
}

static void
gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint maxo)
{
	gint off1, off2, curlen;
	GSList *cursl;
	offsets_t marks;
	offlen_t *meta;

	off1 = 0;
	curlen = 0;
	cursl = slp;
	while (cursl)
	{
		meta = cursl->data;
		if (start < meta->len)
		{
			off1 = meta->off + start;
			break;
		}
		curlen += meta->len;
		start -= meta->len;
		end -= meta->len;
		cursl = g_slist_next (cursl);
	}

	off2 = off1;
	while (cursl)
	{
		meta = cursl->data;
		if (end < meta->len)
		{
			off2 = meta->off + end;
			break;
		}
		curlen += meta->len;
		end -= meta->len;
		cursl = g_slist_next (cursl);
	}
	if (!cursl)
	{
		off2 = maxo;
	}

	marks.o.start = off1;
	marks.o.end = off2;
	*gl = g_list_append (*gl, GUINT_TO_POINTER (marks.u));
}

/* Search a single textentry for occurrence(s) of search arg string */
static GList *
gtk_xtext_search_textentry (xtext_buffer *buf, textentry *ent)
{
	gchar *str;								/* text string to be searched */
	GList *gl = NULL;
	GSList *slp;
	gint lstr;

	if (buf->search_text == NULL)
	{
		return gl;
	}

	str = gtk_xtext_strip_color (ent->str, ent->str_len, buf->xtext->scratch_buffer,
										  &lstr, &slp, !buf->xtext->ignore_hidden);

	/* Regular-expression matching --- */
	if (buf->search_flags & regexp)
	{
		GMatchInfo *gmi;
		gint start, end;

		if (buf->search_re == NULL)
		{
			return gl;
		}
		g_regex_match (buf->search_re, str, 0, &gmi);
		while (g_match_info_matches (gmi))
		{
			g_match_info_fetch_pos (gmi, 0,  &start, &end);
			gtk_xtext_unstrip_color (start, end, slp, &gl, ent->str_len);
			g_match_info_next (gmi, NULL);
		}
		g_match_info_free (gmi);

	/* Non-regular-expression matching --- */
	} else {
		gchar *hay, *pos;
		gint lhay, off, len;
		gint match = buf->search_flags & case_match;

		hay = match? g_strdup (str): g_utf8_casefold (str, lstr);
		lhay = strlen (hay);
		off = 0;

		for (pos = hay, len = lhay; len;
			  off += buf->search_lnee, pos = hay + off, len = lhay - off)
		{
			str = g_strstr_len (pos, len, buf->search_nee);
			if (str == NULL)
			{
				break;
			}
			off = str - hay;
			gtk_xtext_unstrip_color (off, off + buf->search_lnee,
											 slp, &gl, ent->str_len);
		}

		g_free (hay);
	}

	/* Common processing --- */
	g_slist_free_full (slp, g_free);
	return gl;
}

/* Add a list of found search results to an entry, maybe NULL */
static void
gtk_xtext_search_textentry_add (xtext_buffer *buf, textentry *ent, GList *gl, gboolean pre)
{
	ent->marks = gl;
	if (gl)
	{
		buf->search_found = (pre? g_list_prepend: g_list_append) (buf->search_found, ent);
		if (pre == FALSE && buf->hintsearch == NULL)
		{
			buf->hintsearch = ent;
		}
	}
}

/* Free all search information for a textentry */
static void
gtk_xtext_search_textentry_del (xtext_buffer *buf, textentry *ent)
{
	g_list_free (ent->marks);
	ent->marks = NULL;
	if (buf->cursearch && buf->cursearch->data == ent)
	{
		buf->cursearch = NULL;
		buf->curmark = NULL;
		buf->curdata.u = 0;
	}
	if (buf->pagetop_ent == ent)
	{
		buf->pagetop_ent = NULL;
	}
	if (buf->hintsearch == ent)
	{
		buf->hintsearch = NULL;
	}
	buf->search_found = g_list_remove (buf->search_found, ent);
}

/* Used only by glist_foreach */
static void
gtk_xtext_search_textentry_fini (gpointer entp, gpointer dummy)
{
	textentry *ent = entp;

	g_list_free (ent->marks);
	ent->marks = NULL;
}

/* Free all search information for all textentrys and the xtext_buffer */
static void
gtk_xtext_search_fini (xtext_buffer *buf)
{
	g_list_foreach (buf->search_found, gtk_xtext_search_textentry_fini, 0);
	g_list_free (buf->search_found);
	buf->search_found = NULL;
	g_free (buf->search_text);
	buf->search_text = NULL;
	g_free (buf->search_nee);
	buf->search_nee = NULL;
	buf->search_flags = 0;
	buf->cursearch = NULL;
	buf->curmark = NULL;
	/* but leave buf->curdata.u alone! */
	if (buf->search_re)
	{
		g_regex_unref (buf->search_re);
		buf->search_re = NULL;
	}
}

/* Returns TRUE if the base search information exists and is still okay to use */
static gboolean
gtk_xtext_search_init (xtext_buffer *buf, const gchar *text, gtk_xtext_search_flags flags, GError **perr)
{
	/* Of the five flags, backward and highlight_all do not need a new search */
	if (buf->search_found &&
		 strcmp (buf->search_text, text) == 0 &&
		 (buf->search_flags & case_match) == (flags & case_match) &&
		 (buf->search_flags & follow) == (flags & follow) &&
		 (buf->search_flags & regexp) == (flags & regexp))
	{
		return TRUE;
	}
	buf->hintsearch = buf->cursearch? buf->cursearch->data: NULL;
	gtk_xtext_search_fini (buf);
	buf->search_text = g_strdup (text);
	if (flags & regexp)
	{
		buf->search_re = g_regex_new (text, (flags & case_match)? 0: G_REGEX_CASELESS, 0, perr);
		if (perr && *perr)
		{
			return FALSE;
		}
	}
	else
	{
		if (flags & case_match)
		{
			buf->search_nee = g_strdup (text);
		}
		else
		{
			buf->search_nee = g_utf8_casefold (text, strlen (text));
		}
		buf->search_lnee = strlen (buf->search_nee);
	}
	buf->search_flags = flags;
	buf->cursearch = NULL;
	buf->curmark = NULL;
	/* but leave buf->curdata.u alone! */
	return FALSE;
}

#define BACKWARD (flags & backward)
#define FIRSTLAST(lp)  (BACKWARD? g_list_last(lp): g_list_first(lp))
#define NEXTPREVIOUS(lp) (BACKWARD? g_list_previous(lp): g_list_next(lp))
textentry *
gtk_xtext_search (GtkXText * xtext, const gchar *text, gtk_xtext_search_flags flags, GError **perr)
{
	textentry *ent = NULL;
	xtext_buffer *buf = xtext->buffer;
	GList *gl;

	if (buf->text_first == NULL)
	{
		return NULL;
	}

	/* If the text arg is NULL, one of these has been toggled: highlight follow */
	if (text == NULL)		/* Here on highlight or follow toggle */
	{
		gint oldfollow = buf->search_flags & follow;
		gint newfollow = flags & follow;

		/* If "Follow" has just been checked, search possible new textentries --- */
		if (newfollow && (newfollow != oldfollow))
		{
			gl = g_list_last (buf->search_found);
			ent = gl? gl->data: buf->text_first;
			for (; ent; ent = ent->next)
			{
				GList *gl;

				gl = gtk_xtext_search_textentry (buf, ent);
				gtk_xtext_search_textentry_add (buf, ent, gl, FALSE);
			}
		}
		buf->search_flags = flags;
		ent = buf->pagetop_ent;
	}

	/* if the text arg is "", the reset button has been clicked or Control-Shift-F has been hit */
	else if (text[0] == 0)		/* Let a null string do a reset. */
	{
		gtk_xtext_search_fini (buf);
	}

	/* If the text arg is neither NULL nor "", it's the search string */
	else
	{
		if (gtk_xtext_search_init (buf, text, flags, perr) == FALSE)	/* If a new search: */
		{
			if (perr && *perr)
			{
				return NULL;
			}
			for (ent = buf->text_first; ent; ent = ent->next)
			{
				GList *gl;

				gl = gtk_xtext_search_textentry (buf, ent);
				gtk_xtext_search_textentry_add (buf, ent, gl, TRUE);
			}
			buf->search_found = g_list_reverse (buf->search_found);
		}

		/* Now base search results are in place. */

		if (buf->search_found)
		{
			/* If we're in the midst of moving among found items */
			if (buf->cursearch)
			{
				ent = buf->cursearch->data;
				buf->curmark = NEXTPREVIOUS (buf->curmark);
				if (buf->curmark == NULL)
				{
					/* We've returned all the matches for this textentry. */
					buf->cursearch = NEXTPREVIOUS (buf->cursearch);
					if (buf->cursearch)
					{
						ent = buf->cursearch->data;
						buf->curmark = FIRSTLAST (ent->marks);
					}
					else	/* We've returned all the matches for all textentries */
					{
						ent = NULL;
					}
				}
			}

			/* If user changed the search, let's look starting where he was */
			else if (buf->hintsearch)
			{
				GList *mark;
				offsets_t last, this;
				/*
				 * If we already have a 'current' item from the last search, and if
				 * the first character of an occurrence on this line for this new search
				 * is within that former item, use the occurrence as current.
				 */
				ent = buf->hintsearch;
				last.u = buf->curdata.u;
				for (mark = ent->marks; mark; mark = mark->next)
				{
					this.u = GPOINTER_TO_UINT (mark->data);
					if (this.o.start >= last.o.start && this.o.start < last.o.end)
					break;
				}
				if (mark == NULL)
				{
					for (ent = buf->hintsearch; ent; ent = BACKWARD? ent->prev: ent->next)
						if (ent->marks)
							break;
					mark = ent? FIRSTLAST (ent->marks): NULL;
				}
				buf->cursearch = g_list_find (buf->search_found, ent);
				buf->curmark = mark;
			}

			/* This is a fresh search */
			else
			{
				buf->cursearch = FIRSTLAST (buf->search_found);
				ent = buf->cursearch->data;
				buf->curmark = FIRSTLAST (ent->marks);
			}
			buf->curdata.u = (buf->curmark)? GPOINTER_TO_UINT (buf->curmark->data): 0;
		}
	}
	buf->hintsearch = ent;

	if (!gtk_xtext_check_ent_visibility (xtext, ent, 1))
	{
		GtkAdjustment *adj = xtext->adj;
		float value;

		buf->pagetop_ent = NULL;
		for (value = 0, ent = buf->text_first;
			  ent && ent != buf->hintsearch; ent = ent->next)
		{
			value += g_slist_length (ent->sublines);
		}
		if (value > adj->upper - adj->page_size)
		{
			value = adj->upper - adj->page_size;
		}
		else if ((flags & backward)  && ent)
		{
			value -= adj->page_size - g_slist_length (ent->sublines);
			if (value < 0)
			{
				value = 0;
			}
		}
		gtk_adjustment_set_value (adj, value);
	}

	gtk_widget_queue_draw (GTK_WIDGET (xtext));

	return buf->hintsearch;
}
#undef BACKWARD
#undef FIRSTLAST
#undef NEXTPREVIOUS

static int
gtk_xtext_render_page_timeout (GtkXText * xtext)
{
	GtkAdjustment *adj = xtext->adj;

	xtext->add_io_tag = 0;

	/* less than a complete page? */
	if (xtext->buffer->num_lines <= adj->page_size)
	{
		xtext->buffer->old_value = 0;
		adj->value = 0;
		gtk_xtext_render_page (xtext);
	} else if (xtext->buffer->scrollbar_down)
	{
		g_signal_handler_block (xtext->adj, xtext->vc_signal_tag);
		gtk_xtext_adjustment_set (xtext->buffer, FALSE);
		gtk_adjustment_set_value (adj, adj->upper - adj->page_size);
		g_signal_handler_unblock (xtext->adj, xtext->vc_signal_tag);
		xtext->buffer->old_value = adj->value;
		gtk_xtext_render_page (xtext);
	} else
	{
		gtk_xtext_adjustment_set (xtext->buffer, TRUE);
		if (xtext->force_render)
		{
			xtext->force_render = FALSE;
			gtk_xtext_render_page (xtext);
		}
	}

	return 0;
}

/* append a textentry to our linked list */

static void
gtk_xtext_append_entry (xtext_buffer *buf, textentry * ent, time_t stamp)
{
	int i;

	/* we don't like tabs */
	i = 0;
	while (i < ent->str_len)
	{
		if (ent->str[i] == '\t')
			ent->str[i] = ' ';
		i++;
	}

	ent->stamp = stamp;
	if (stamp == 0)
		ent->stamp = time (0);
	ent->slp = NULL;
	ent->str_width = gtk_xtext_text_width_ent (buf->xtext, ent);
	ent->mark_start = -1;
	ent->mark_end = -1;
	ent->next = NULL;
	ent->marks = NULL;

	if (ent->indent < MARGIN)
		ent->indent = MARGIN;	  /* 2 pixels is the left margin */

	/* append to our linked list */
	if (buf->text_last)
		buf->text_last->next = ent;
	else
		buf->text_first = ent;
	ent->prev = buf->text_last;
	buf->text_last = ent;

	ent->sublines = NULL;
	buf->num_lines += gtk_xtext_lines_taken (buf, ent);

	if ((buf->marker_pos == NULL || buf->marker_seen) && (buf->xtext->buffer != buf || 
		!gtk_window_has_toplevel_focus (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (buf->xtext))))))
	{
		buf->marker_pos = ent;
		buf->marker_state = MARKER_IS_SET;
		dontscroll (buf); /* force scrolling off */
		buf->marker_seen = FALSE;
	}

	if (buf->xtext->max_lines > 2 && buf->xtext->max_lines < buf->num_lines)
	{
		gtk_xtext_remove_top (buf);
	}

	if (buf->xtext->buffer == buf)
	{
		/* this could be improved */
		if ((buf->num_lines - 1) <= buf->xtext->adj->page_size)
			dontscroll (buf);

		if (!buf->xtext->add_io_tag)
		{
			/* remove scrolling events */
			if (buf->xtext->io_tag)
			{
				g_source_remove (buf->xtext->io_tag);
				buf->xtext->io_tag = 0;
			}
			buf->xtext->add_io_tag = g_timeout_add (REFRESH_TIMEOUT * 2,
															(GSourceFunc)
															gtk_xtext_render_page_timeout,
															buf->xtext);
		}
	}
	if (buf->scrollbar_down)
	{
		buf->old_value = buf->num_lines - buf->xtext->adj->page_size;
		if (buf->old_value < 0)
			buf->old_value = 0;
	}
	if (buf->search_flags & follow)
	{
		GList *gl;

		gl = gtk_xtext_search_textentry (buf, ent);
		gtk_xtext_search_textentry_add (buf, ent, gl, FALSE);
	}
}

/* the main two public functions */

void
gtk_xtext_append_indent (xtext_buffer *buf,
								 unsigned char *left_text, int left_len,
								 unsigned char *right_text, int right_len,
								 time_t stamp)
{
	textentry *ent;
	unsigned char *str;
	int space;
	int tempindent;
	int left_width;

	if (left_len == -1)
		left_len = strlen (left_text);

	if (right_len == -1)
		right_len = strlen (right_text);

	if (right_len >= sizeof (buf->xtext->scratch_buffer))
		right_len = sizeof (buf->xtext->scratch_buffer) - 1;

	if (right_text[right_len-1] == '\n')
		right_len--;

	ent = g_malloc (left_len + right_len + 2 + sizeof (textentry));
	str = (unsigned char *) ent + sizeof (textentry);

	memcpy (str, left_text, left_len);
	str[left_len] = ' ';
	memcpy (str + left_len + 1, right_text, right_len);
	str[left_len + 1 + right_len] = 0;

	left_width = gtk_xtext_text_width (buf->xtext, left_text, left_len);

	ent->left_len = left_len;
	ent->str = str;
	ent->str_len = left_len + 1 + right_len;
	ent->indent = (buf->indent - left_width) - buf->xtext->space_width;

	if (buf->time_stamp)
		space = buf->xtext->stamp_width;
	else
		space = 0;

	/* do we need to auto adjust the separator position? */
	if (buf->xtext->auto_indent && ent->indent < MARGIN + space)
	{
		tempindent = MARGIN + space + buf->xtext->space_width + left_width;

		if (tempindent > buf->indent)
			buf->indent = tempindent;

		if (buf->indent > buf->xtext->max_auto_indent)
			buf->indent = buf->xtext->max_auto_indent;

		gtk_xtext_fix_indent (buf);
		gtk_xtext_recalc_widths (buf, FALSE);

		ent->indent = (buf->indent - left_width) - buf->xtext->space_width;
		buf->xtext->force_render = TRUE;
	}

	gtk_xtext_append_entry (buf, ent, stamp);
}

void
gtk_xtext_append (xtext_buffer *buf, unsigned char *text, int len, time_t stamp)
{
	textentry *ent;

	if (len == -1)
		len = strlen (text);

	if (text[len-1] == '\n')
		len--;

	if (len >= sizeof (buf->xtext->scratch_buffer))
		len = sizeof (buf->xtext->scratch_buffer) - 1;

	ent = g_malloc (len + 1 + sizeof (textentry));
	ent->str = (unsigned char *) ent + sizeof (textentry);
	ent->str_len = len;
	if (len)
		memcpy (ent->str, text, len);
	ent->str[len] = 0;
	ent->indent = 0;
	ent->left_len = -1;

	gtk_xtext_append_entry (buf, ent, stamp);
}

gboolean
gtk_xtext_is_empty (xtext_buffer *buf)
{
	return buf->text_first == NULL;
}


int
gtk_xtext_lastlog (xtext_buffer *out, xtext_buffer *search_area)
{
	textentry *ent;
	int matches;
	GList *gl;

	ent = search_area->text_first;
	matches = 0;

	while (ent)
	{
		gl = gtk_xtext_search_textentry (out, ent);
		if (gl)
		{
			matches++;
			/* copy the text over */
			if (search_area->xtext->auto_indent)
			{
				gtk_xtext_append_indent (out, ent->str, ent->left_len,
												 ent->str + ent->left_len + 1,
												 ent->str_len - ent->left_len - 1, 0);
			}
			else
			{
				gtk_xtext_append (out, ent->str, ent->str_len, 0);
			}

			out->text_last->stamp = ent->stamp;
			gtk_xtext_search_textentry_add (out, out->text_last, gl, TRUE);
		}
		ent = ent->next;
	}
	out->search_found = g_list_reverse (out->search_found);

	return matches;
}

void
gtk_xtext_foreach (xtext_buffer *buf, GtkXTextForeach func, void *data)
{
	textentry *ent = buf->text_first;

	while (ent)
	{
		(*func) (buf->xtext, ent->str, data);
		ent = ent->next;
	}
}

void
gtk_xtext_set_indent (GtkXText *xtext, gboolean indent)
{
	xtext->auto_indent = indent;
}

void
gtk_xtext_set_max_indent (GtkXText *xtext, int max_auto_indent)
{
	xtext->max_auto_indent = max_auto_indent;
}

void
gtk_xtext_set_max_lines (GtkXText *xtext, int max_lines)
{
	xtext->max_lines = max_lines;
}

void
gtk_xtext_set_show_marker (GtkXText *xtext, gboolean show_marker)
{
	xtext->marker = show_marker;
}

void
gtk_xtext_set_show_separator (GtkXText *xtext, gboolean show_separator)
{
	xtext->separator = show_separator;
}

void
gtk_xtext_set_thin_separator (GtkXText *xtext, gboolean thin_separator)
{
	xtext->thinline = thin_separator;
}

void
gtk_xtext_set_time_stamp (xtext_buffer *buf, gboolean time_stamp)
{
	buf->time_stamp = time_stamp;
}

void
gtk_xtext_set_urlcheck_function (GtkXText *xtext, int (*urlcheck_function) (GtkWidget *, char *))
{
	xtext->urlcheck_function = urlcheck_function;
}

void
gtk_xtext_set_wordwrap (GtkXText *xtext, gboolean wordwrap)
{
	xtext->wordwrap = wordwrap;
}

void
gtk_xtext_set_marker_last (session *sess)
{
	xtext_buffer *buf = sess->res->buffer;

	buf->marker_pos = buf->text_last;
	buf->marker_state = MARKER_IS_SET;
}

void
gtk_xtext_reset_marker_pos (GtkXText *xtext)
{
	if (xtext->buffer->marker_pos)
	{
		xtext->buffer->marker_pos = NULL;
		dontscroll (xtext->buffer); /* force scrolling off */
		gtk_xtext_render_page (xtext);
		xtext->buffer->marker_state = MARKER_RESET_MANUALLY;
	}
}

int
gtk_xtext_moveto_marker_pos (GtkXText *xtext)
{
	gdouble value = 0;
	xtext_buffer *buf = xtext->buffer;
	textentry *ent = buf->text_first;
	GtkAdjustment *adj = xtext->adj;

	if (buf->marker_pos == NULL)
		return buf->marker_state;

	if (gtk_xtext_check_ent_visibility (xtext, buf->marker_pos, 1) == FALSE)
	{
		while (ent)
		{
			if (ent == buf->marker_pos)
				break;
			value += g_slist_length (ent->sublines);
			ent = ent->next;
		}
		if (value >= adj->value && value < adj->value + adj->page_size)
			return MARKER_IS_SET;
		value -= adj->page_size / 2;
		if (value < 0)
			value = 0;
		if (value > adj->upper - adj->page_size)
			value = adj->upper - adj->page_size;
		gtk_adjustment_set_value (adj, value);
		gtk_xtext_render_page (xtext);
	}

	/* If we previously lost marker position to scrollback limit -- */
	if (buf->marker_pos == buf->text_first &&
		 buf->marker_state == MARKER_RESET_BY_KILL)
		return MARKER_RESET_BY_KILL;
	else
		return MARKER_IS_SET;
}

void
gtk_xtext_buffer_show (GtkXText *xtext, xtext_buffer *buf, int render)
{
	int w, h;

	buf->xtext = xtext;

	if (xtext->buffer == buf)
		return;

/*printf("text_buffer_show: xtext=%p buffer=%p\n", xtext, buf);*/

	if (xtext->add_io_tag)
	{
		g_source_remove (xtext->add_io_tag);
		xtext->add_io_tag = 0;
	}

	if (xtext->io_tag)
	{
		g_source_remove (xtext->io_tag);
		xtext->io_tag = 0;
	}

	if (!gtk_widget_get_realized (GTK_WIDGET (xtext)))
		gtk_widget_realize (GTK_WIDGET (xtext));

	h = gdk_window_get_height (gtk_widget_get_window (GTK_WIDGET (xtext)));
	w = gdk_window_get_width (gtk_widget_get_window (GTK_WIDGET (xtext)));

	/* after a font change */
	if (buf->needs_recalc)
	{
		buf->needs_recalc = FALSE;
		gtk_xtext_recalc_widths (buf, TRUE);
	}

	/* now change to the new buffer */
	xtext->buffer = buf;
	dontscroll (buf);	/* force scrolling off */
	xtext->adj->value = buf->old_value;
	xtext->adj->upper = buf->num_lines;
	if (xtext->adj->upper == 0)
		xtext->adj->upper = 1;
	/* sanity check */
	else if (xtext->adj->value > xtext->adj->upper - xtext->adj->page_size)
	{
		/*buf->pagetop_ent = NULL;*/
		xtext->adj->value = xtext->adj->upper - xtext->adj->page_size;
		if (xtext->adj->value < 0)
			xtext->adj->value = 0;
	}

	if (render)
	{
		/* did the window change size since this buffer was last shown? */
		if (buf->window_width != w)
		{
			buf->window_width = w;
			gtk_xtext_calc_lines (buf, FALSE);
			if (buf->scrollbar_down)
				gtk_adjustment_set_value (xtext->adj, xtext->adj->upper -
												  xtext->adj->page_size);
		} else if (buf->window_height != h)
		{
			buf->window_height = h;
			buf->pagetop_ent = NULL;
			if (buf->scrollbar_down)
				xtext->adj->value = xtext->adj->upper;
			gtk_xtext_adjustment_set (buf, FALSE);
		}

		gtk_xtext_render_page (xtext);
		gtk_adjustment_changed (xtext->adj);
	}
}

xtext_buffer *
gtk_xtext_buffer_new (GtkXText *xtext)
{
	xtext_buffer *buf;

	buf = g_new0 (xtext_buffer, 1);
	buf->old_value = -1;
	buf->xtext = xtext;
	buf->scrollbar_down = TRUE;
	buf->indent = xtext->space_width * 2;
	dontscroll (buf);

	return buf;
}

void
gtk_xtext_buffer_free (xtext_buffer *buf)
{
	textentry *ent, *next;

	if (buf->xtext->buffer == buf)
		buf->xtext->buffer = buf->xtext->orig_buffer;

	if (buf->xtext->selection_buffer == buf)
		buf->xtext->selection_buffer = NULL;

	if (buf->search_found)
	{
		gtk_xtext_search_fini (buf);
	}

	ent = buf->text_first;
	while (ent)
	{
		next = ent->next;
		g_free (ent);
		ent = next;
	}

	g_free (buf);
}