summaryrefslogtreecommitdiff
path: root/patches/vclplug/vcl-inc.diff
blob: 9888e829618baef28d0dedadd0fe4965d9d21a9d (plain)
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
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
Index: vcl/inc/abstdlg.hxx
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ vcl/inc/abstdlg.hxx	2004-09-12 14:54:44.784065432 +0200
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ *  
+ *
+ *  
+ *
+ *  
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _VCL_ABSTDLG_HXX
+#define _VCL_ABSTDLG_HXX
+
+// include ---------------------------------------------------------------
+
+#include <tools/solar.h>
+#include <tools/string.hxx>
+
+class Window;
+class ResId;
+
+class VclAbstractDialog
+{
+public:
+	virtual	USHORT			Execute() = 0;
+	//virtual void			Show( BOOL bVisible = TRUE, USHORT nFlags = 0 ) = 0;
+	virtual					~VclAbstractDialog();
+};
+
+class VclAbstractTerminatedDialog : public VclAbstractDialog
+{
+public:
+	virtual void			EndDialog(long nResult =0) = 0;
+};
+
+class VclAbstractRefreshableDialog : public VclAbstractDialog
+{
+public:
+    virtual void            Update() = 0;
+    virtual void            Sync() = 0;
+};
+
+class VclAbstractDialogFactory
+{
+public:
+	static VclAbstractDialogFactory*	Create();
+	virtual VclAbstractDialog* 			CreateVclDialog( Window* pParent, const ResId& rResId ) = 0;
+};
+
+#endif
+
Index: vcl/inc/accel.hxx
===================================================================
--- vcl/inc/accel.hxx.orig	2004-09-12 14:26:21.659979648 +0200
+++ vcl/inc/accel.hxx	2004-09-12 14:54:44.785065280 +0200
@@ -65,11 +65,11 @@
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
-#ifndef _SV_RESID_HXX
-#include <resid.hxx>
+#ifndef _TOOLS_RESID_HXX
+#include <tools/resid.hxx>
 #endif
-#ifndef _SV_RC_HXX
-#include <rc.hxx>
+#ifndef _TOOLS_RC_HXX
+#include <tools/rc.hxx>
 #endif
 #ifndef _SV_KEYCOD_HXX
 #include <keycod.hxx>
@@ -84,6 +84,8 @@ class ImplAccelEntry;
 
 class Accelerator : public Resource
 {
+	friend class ImplAccelManager;
+
 private:
 	ImplAccelData*	mpData;
 	XubString		maHelpStr;
@@ -99,15 +101,12 @@ private:
 	BOOL*			mpDel;
 
 #if _SOLAR__PRIVATE
-#ifdef _SV_ACCEL_CXX
 	void			ImplInit();
 	void			ImplCopyData( ImplAccelData& rAccelData );
 	void			ImplDeleteData();
 	void			ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode,
 									 BOOL bEnable, Accelerator* pAutoAccel );
-#endif
 
-	friend class ImplAccelManager;
 	ImplAccelEntry* ImplGetAccelData( const KeyCode& rKeyCode ) const;
 #endif
 
@@ -118,7 +117,7 @@ public:
 					Accelerator();
 					Accelerator( const Accelerator& rAccel );
 					Accelerator( const ResId& rResId );
-					 ~Accelerator();
+	virtual			~Accelerator();
 
 	virtual void	Activate();
 	virtual void	Deactivate();
Index: vcl/inc/alpha.hxx
===================================================================
--- vcl/inc/alpha.hxx.orig	2004-09-12 14:26:21.659979648 +0200
+++ vcl/inc/alpha.hxx	2004-09-12 14:54:44.786065128 +0200
@@ -70,16 +70,16 @@
 // - AlphaMask -
 // -------------
 
+class ImageList;
+
 class AlphaMask : private Bitmap
 {
 	friend class BitmapEx;
 	friend class OutputDevice;
+	friend SvStream& operator<<( SvStream&, const ImageList& );
 
 private:
 
-	long					nDummy1;
-	long					nDummy2;
-
 	const Bitmap&			ImplGetBitmap() const;
 	void					ImplSetBitmap( const Bitmap& rBitmap );
 
Index: vcl/inc/apptypes.hxx
===================================================================
--- vcl/inc/apptypes.hxx.orig	2004-09-12 14:26:21.660979496 +0200
+++ vcl/inc/apptypes.hxx	2004-09-12 14:54:44.786065128 +0200
@@ -62,14 +62,14 @@
 #ifndef _VCL_APPTYPES_HXX
 #define _VCL_APPTYPES_HXX
 
-#ifndef _RTTI_HXX
-#include <tools/rtti.hxx>
-#endif
-
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
 
+#ifndef _RTTI_HXX
+#include <tools/rtti.hxx>
+#endif
+
 // ---------------------
 // - Application-Types -
 // ---------------------
Index: vcl/inc/bitmap.hxx
===================================================================
--- vcl/inc/bitmap.hxx.orig	2004-09-12 14:26:21.662979192 +0200
+++ vcl/inc/bitmap.hxx	2004-09-12 14:54:44.787064976 +0200
@@ -68,8 +68,8 @@
 #ifndef _SV_MAPMOD_HXX
 #include <mapmod.hxx>
 #endif
-#ifndef _SV_RC_HXX
-#include <rc.hxx>
+#ifndef _TOOLS_RC_HXX
+#include <tools/rc.hxx>
 #endif
 #ifndef _SV_REGION_HXX
 #include <region.hxx>
@@ -106,8 +106,8 @@
 
 // -----------------------------------------------------------------------------
 
-#define BMP_COL_TRANS				Color( 252, 3, 251 )
-
+#define BMP_COL_TRANS					Color( 252, 3, 251 )
+#define BMP_COLOR_MONOCHROME_THRESHOLD	128
 
 // ---------
 // - Enums -
@@ -188,7 +188,9 @@ enum BmpFilter
 enum BmpColorMode
 {
     BMP_COLOR_NORMAL = 0,
-    BMP_COLOR_HIGHCONTRAST = 1
+    BMP_COLOR_HIGHCONTRAST = 1,
+	BMP_COLOR_MONOCHROME_BLACK = 2,
+	BMP_COLOR_MONOCHROME_WHITE = 3
 };
 
 // --------------------
@@ -330,27 +332,6 @@ public:
 	BOOL					ImplMosaic( const BmpFilterParam* pFilterParam, const Link* pProgress );
 	BOOL					ImplPopArt( const BmpFilterParam* pFilterParam, const Link* pProgress );
 
-#ifdef REMOTE_APPSERVER
-
-	void                    ImplDrawRemote( OutputDevice* pOut,
-                                            const Point& rSrcPt, const Size& rSrcSz,
-                                            const Point& rDestPt, const Size& rDestSz ) const;
-	void                    ImplDrawRemoteEx( OutputDevice* pOut,
-                                            const Point& rSrcPt, const Size& rSrcSz,
-                                            const Point& rDestPt, const Size& rDestSz,
-											const Bitmap& rMask ) const;
-	void                    ImplDrawRemoteAlpha( OutputDevice* pOut,
-                                            const Point& rSrcPt, const Size& rSrcSz,
-                                            const Point& rDestPt, const Size& rDestSz,
-											const AlphaMask& rAlpha ) const;
-	void                    ImplDrawRemoteMask( OutputDevice* pOut,
-                                            const Point& rSrcPt, const Size& rSrcSz,
-                                            const Point& rDestPt, const Size& rDestSz,
-											const Color& rColor ) const;
-	void					ImplGetRemoteBmp( OutputDevice* pOut, const Point& rPt, 
-											  const Size& rSz );
-
-#endif // REMOTE_APPSERVER
 #endif // PRIVATE
 
 public:
Index: vcl/inc/bitmapex.hxx
===================================================================
--- vcl/inc/bitmapex.hxx.orig	2004-09-12 14:26:21.663979040 +0200
+++ vcl/inc/bitmapex.hxx	2004-09-12 14:54:44.788064824 +0200
@@ -68,8 +68,8 @@
 #ifndef _SV_ALPHA_HXX
 #include <alpha.hxx>
 #endif
-#ifndef _SV_COLOR_HXX
-#include <color.hxx>
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
 #endif
 
 // -------------------
@@ -100,23 +100,10 @@ private:
 	Size				aBitmapSize;
 	Color				aTransparentColor;
 	TransparentType		eTransparent;
-	USHORT				nDummy;
 	BOOL				bAlpha;
-	BYTE				cDummy;
 
 public:
 
-#ifdef REMOTE_APPSERVER
-
-	void				ImplDrawRemote( OutputDevice* pOut,
-										const Point& rSrcPt, const Size& rSrcSz,
-										const Point& rDestPt, const Size& rDestSz ) const;
-	void				ImplDrawRemoteAlpha( OutputDevice* pOut,
-										const Point& rSrcPt, const Size& rSrcSz,
-										const Point& rDestPt, const Size& rDestSz ) const;
-
-#endif // REMOTE
-
 #if _SOLAR__PRIVATE
 
     ImpBitmap*			ImplGetBitmapImpBitmap() const { return aBitmap.ImplGetImpBitmap(); }
Index: vcl/inc/brdwin.hxx
===================================================================
--- vcl/inc/brdwin.hxx.orig	2004-09-12 14:26:21.665978736 +0200
+++ vcl/inc/brdwin.hxx	2004-09-12 14:54:44.789064672 +0200
@@ -156,14 +156,12 @@ private:
 	BOOL					mbHelpBtn;
 	BOOL					mbDisplayActive;
 
-#ifdef _SV_BRDWIN_CXX
 	void					ImplInit( Window* pParent,
 									  WinBits nStyle, USHORT nTypeStyle,
 									  SystemParentData* pParentData );
 	void					ImplInit( Window* pParent,
 									  WinBits nStyle, USHORT nTypeStyle, 
 									  const ::com::sun::star::uno::Any& );
-#endif
 
 public:
 							ImplBorderWindow( Window* pParent,
@@ -213,8 +211,8 @@ public:
 	void					SetMinOutputSize( long nWidth, long nHeight )
 								{ mnMinWidth = nWidth; mnMinHeight = nHeight; }
 
-	void					GetBorder( long& rLeftBorder, long& rTopBorder,
-									   long& rRightBorder, long& rBottomBorder ) const;
+	void					GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+									   sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
 	long					CalcTitleWidth() const;
 };
 
@@ -242,10 +240,10 @@ struct ImplBorderFrameData
 	long					mnTrackY;
 	long					mnTrackWidth;
 	long					mnTrackHeight;
-	long					mnLeftBorder;
-	long					mnTopBorder;
-	long					mnRightBorder;
-	long					mnBottomBorder;
+	sal_Int32				mnLeftBorder;
+	sal_Int32				mnTopBorder;
+	sal_Int32				mnRightBorder;
+	sal_Int32				mnBottomBorder;
 	long					mnNoTitleTop;
 	long					mnBorderSize;
 	long					mnTitleHeight;
@@ -279,8 +277,8 @@ public:
 	virtual USHORT			RequestHelp( const Point& rPos, Rectangle& rHelpRect );
 
 	virtual void			Init( OutputDevice* pDev, long nWidth, long nHeight ) = 0;
-	virtual void			GetBorder( long& rLeftBorder, long& rTopBorder,
-									   long& rRightBorder, long& rBottomBorder ) const = 0;
+	virtual void			GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+									   sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const = 0;
 	virtual long			CalcTitleWidth() const = 0;
 	virtual void			DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev = NULL, const Point* pOffset = NULL ) = 0;
 
@@ -305,8 +303,8 @@ public:
 							ImplNoBorderWindowView( ImplBorderWindow* pBorderWindow );
 
 	virtual void			Init( OutputDevice* pDev, long nWidth, long nHeight );
-	virtual void			GetBorder( long& rLeftBorder, long& rTopBorder,
-									   long& rRightBorder, long& rBottomBorder ) const;
+	virtual void			GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+									   sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
 	virtual long			CalcTitleWidth() const;
 	virtual void			DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
 };
@@ -324,17 +322,17 @@ class ImplSmallBorderWindowView : public
 	OutputDevice*			mpOutDev;
 	long					mnWidth;
 	long					mnHeight;
-	long					mnLeftBorder;
-	long					mnTopBorder;
-	long					mnRightBorder;
-	long					mnBottomBorder;
+	sal_Int32				mnLeftBorder;
+	sal_Int32				mnTopBorder;
+	sal_Int32				mnRightBorder;
+	sal_Int32				mnBottomBorder;
 
 public:
 							ImplSmallBorderWindowView( ImplBorderWindow* pBorderWindow );
 
 	virtual void			Init( OutputDevice* pOutDev, long nWidth, long nHeight );
-	virtual void			GetBorder( long& rLeftBorder, long& rTopBorder,
-									   long& rRightBorder, long& rBottomBorder ) const;
+	virtual void			GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+									   sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
 	virtual long			CalcTitleWidth() const;
 	virtual void			DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
 };
@@ -363,8 +361,8 @@ public:
 	virtual USHORT			RequestHelp( const Point& rPos, Rectangle& rHelpRect );
 
 	virtual void			Init( OutputDevice* pDev, long nWidth, long nHeight );
-	virtual void			GetBorder( long& rLeftBorder, long& rTopBorder,
-									   long& rRightBorder, long& rBottomBorder ) const;
+	virtual void			GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+									   sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
 	virtual long			CalcTitleWidth() const;
 	virtual void			DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
 };
Index: vcl/inc/btndlg.hxx
===================================================================
--- vcl/inc/btndlg.hxx.orig	2004-09-12 14:26:21.666978584 +0200
+++ vcl/inc/btndlg.hxx	2004-09-12 14:54:44.790064520 +0200
@@ -101,20 +101,15 @@ private:
 	BOOL				mbFormat;
 	Link				maClickHdl;
 
-#if _SOLAR__PRIVATE
-#ifdef _SV_BTNDLG_CXX
 	void				ImplInitData();
 	PushButton* 		ImplCreatePushButton( USHORT nBtnFlags );
 	ImplBtnDlgItem* 	ImplGetItem( USHORT nId ) const;
 						DECL_LINK( ImplClickHdl, PushButton* pBtn );
 	void				ImplPosControls();
-#endif
-protected:
-	long				ImplGetButtonSize();
-#endif
 
 protected:
 						ButtonDialog( WindowType nType );
+	long				ImplGetButtonSize();
 
 public:
 						ButtonDialog( Window* pParent, WinBits nStyle = WB_STDDIALOG );
Index: vcl/inc/button.hxx
===================================================================
--- vcl/inc/button.hxx.orig	2004-09-12 14:26:21.667978432 +0200
+++ vcl/inc/button.hxx	2004-09-12 14:54:44.791064368 +0200
@@ -78,6 +78,10 @@
 #include <bitmap.hxx>
 #endif
 
+#ifndef _SV_NATIVEWIDGETS_HXX
+#include <salnativewidgets.hxx>
+#endif
+
 class UserDrawEvent;
 
 // ----------
@@ -124,7 +128,6 @@ protected:
     Image           maImageHC;
     BitmapEx*       mpBitmapEx;
     BitmapEx*       mpBitmapExHC;
-    void*           mpDummy;
     SymbolType      meSymbol;
     ImageAlign      meImageAlign;
     TriState        meState;
@@ -133,12 +136,9 @@ protected:
     USHORT          mnButtonState;
     BOOL            mbPressed;
     BOOL            mbInUserDraw;
-    BOOL            mbDummy1;
-    BOOL            mbDummy2;
     Link            maToggleHdl;
 
 #if _SOLAR__PRIVATE
-#ifdef _SV_BUTTON_CXX
     void            ImplInitData();
     WinBits         ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
     void            ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
@@ -148,7 +148,6 @@ protected:
     USHORT          ImplGetTextStyle() const;
     BOOL            IsSymbol() const { return ( (meSymbol != SYMBOL_NOSYMBOL) && (meSymbol != SYMBOL_IMAGE) ); }
     BOOL            IsImage() const { return !!maImage; }
-#endif
 
 protected:
     void            ImplInit( Window* pParent, WinBits nStyle );
@@ -180,6 +179,7 @@ public:
     virtual void    LoseFocus();
     virtual void    StateChanged( StateChangedType nType );
     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
+    virtual long    PreNotify( NotifyEvent& rNEvt );
     virtual void    UserDraw( const UserDrawEvent& rUDEvt );
 
     virtual void    Toggle();
@@ -253,10 +253,8 @@ inline BOOL PushButton::IsChecked() cons
 
 class OKButton : public PushButton
 {
-#ifdef _SV_BUTTON_CXX
 private:
     void            ImplInit( Window* pParent, WinBits nStyle );
-#endif
 
 public:
                     OKButton( Window* pParent, WinBits nStyle = WB_DEFBUTTON );
@@ -271,10 +269,8 @@ public:
 
 class CancelButton : public PushButton
 {
-#ifdef _SV_BUTTON_CXX
 private:
     void            ImplInit( Window* pParent, WinBits nStyle );
-#endif
 
 public:
                     CancelButton( Window* pParent, WinBits nStyle = 0 );
@@ -289,10 +285,8 @@ public:
 
 class HelpButton : public PushButton
 {
-#ifdef _SV_BUTTON_CXX
 private:
     void            ImplInit( Window* pParent, WinBits nStyle );
-#endif
 
 public:
                     HelpButton( Window* pParent, WinBits nStyle = 0 );
@@ -318,12 +312,9 @@ private:
     BOOL            mbSaveValue;
     BOOL            mbRadioCheck;
     BOOL            mbStateChanged;
-    BOOL            mbDummy1;
-    BOOL            mbDummy2;
     Link            maToggleHdl;
 
 #if _SOLAR__PRIVATE
-#ifdef _SV_BUTTON_CXX
     void            ImplInitData();
     WinBits         ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
     void            ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
@@ -336,7 +327,6 @@ private:
                               bool bLayout = false );
     void            ImplDrawRadioButton( bool bLayout = false );
     void            ImplUncheckAllOther();
-#endif
 
 protected:
     void            ImplInit( Window* pParent, WinBits nStyle );
@@ -376,6 +366,7 @@ public:
     virtual void    LoseFocus();
     virtual void    StateChanged( StateChangedType nType );
     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
+    virtual long    PreNotify( NotifyEvent& rNEvt );
 
     virtual void    Toggle();
 
@@ -428,7 +419,6 @@ private:
     Link            maToggleHdl;
 
 #if _SOLAR__PRIVATE
-#ifdef _SV_BUTTON_CXX
     void            ImplInitData();
     WinBits         ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
     void            ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
@@ -439,7 +429,6 @@ private:
                               Rectangle& rStateRect,
                               Rectangle& rMouseRect, Rectangle& rFocusRect, bool bLayout );
     void            ImplDrawCheckBox( bool bLayout = false );
-#endif
 
 protected:
     void            ImplInit( Window* pParent, WinBits nStyle );
@@ -465,6 +454,7 @@ public:
     virtual void    LoseFocus();
     virtual void    StateChanged( StateChangedType nType );
     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
+    virtual long    PreNotify( NotifyEvent& rNEvt );
 
     virtual void    Toggle();
 
Index: vcl/inc/cmdevt.hxx
===================================================================
--- vcl/inc/cmdevt.hxx.orig	2004-09-12 14:26:21.668978280 +0200
+++ vcl/inc/cmdevt.hxx	2004-09-12 14:54:44.792064216 +0200
@@ -101,7 +101,6 @@ private:
     xub_StrLen          mnOldTextLen;
     USHORT              mnCursorFlags;
     BOOL                mbOnlyCursor;
-    BOOL                mbDummy;
 
 public:
                         CommandExtTextInputData();
Index: vcl/inc/combobox.hxx
===================================================================
--- vcl/inc/combobox.hxx.orig	2004-09-12 14:26:21.669978128 +0200
+++ vcl/inc/combobox.hxx	2004-09-12 14:54:44.792064216 +0200
@@ -192,6 +192,7 @@ public:
     BOOL            IsUserDrawEnabled() const;
 
     void            DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE );
+    void            SetBorderStyle( USHORT nBorderStyle );
 
     void            SetSeparatorPos( USHORT n );
     void            SetSeparatorPos();
Index: vcl/inc/controllayout.hxx
===================================================================
--- vcl/inc/controllayout.hxx.orig	2004-09-12 14:26:21.670977976 +0200
+++ vcl/inc/controllayout.hxx	2004-09-12 14:54:44.793064064 +0200
@@ -103,6 +103,20 @@ struct ControlLayoutData
     // returns the interval [start,end] of line nLine
     // returns [-1,-1] for an invalid line
     Pair GetLineStartEnd( long nLine ) const;
+    /** ToRelativeLineIndex changes a layout data index to a count relative to its line.
+        
+    <p>This is equivalent to getting the line start/end pairs with
+    <member>GetLineStartEnd</member> until the index lies within [start,end] of a line
+    </p>
+
+    @param nIndex
+    the absolute index inside the display text to be changed to a relative index
+
+    @returns
+    the relative index inside the displayed line or -1 if the absolute index does
+    not match any line
+    */
+    long ToRelativeLineIndex( long nIndex ) const;
 };
 
 } // namespace vcl
Index: vcl/inc/ctrl.hxx
===================================================================
--- vcl/inc/ctrl.hxx.orig	2004-09-12 14:26:21.671977824 +0200
+++ vcl/inc/ctrl.hxx	2004-09-12 14:54:44.794063912 +0200
@@ -73,6 +73,10 @@
 #include <window.hxx>
 #endif
 
+#ifndef _SV_NATIVEWIDGETS_HXX
+#include <salnativewidgets.hxx>
+#endif
+
 // forward
 namespace vcl { struct ControlLayoutData; }
 
@@ -83,27 +87,26 @@ namespace vcl { struct ControlLayoutData
 class Control : public Window
 {
 protected:
-	mutable vcl::ControlLayoutData*			mpLayoutData;
+	mutable vcl::ControlLayoutData*	mpLayoutData;
 private:
-	long										mnDummy1;
-	BOOL										mbHasFocus;
-	BOOL										mbDummy1;
-	BOOL										mbDummy2;
-	BOOL										mbDummy3;
-	Link										maGetFocusHdl;
-	Link										maLoseFocusHdl;
+	BOOL							mbHasFocus;
+	Link							maGetFocusHdl;
+	Link							maLoseFocusHdl;
 
-#ifdef _SV_CTRL_CXX
 	void			ImplInitData();
-public:
-    void			ImplSubControlLayoutChanged() const;
-#endif
+
 protected:
 					Control( WindowType nType );
-    virtual void  FillLayoutData() const;
+    virtual void	FillLayoutData() const;
 
     // helper method for composite controls
     void			AppendLayoutData( const Control& rSubControl ) const;
+
+#if _SOLAR__PRIVATE
+public:
+    void			ImplClearLayoutData() const;
+#endif    
+
 public:
 					Control( Window* pParent, WinBits nWinStyle = 0 );
 					Control( Window* pParent, const ResId& rResId );
@@ -129,6 +132,20 @@ public:
     // returns the interval [start,end] of line nLine
     // returns [-1,-1] for an invalid line
     Pair GetLineStartEnd( long nLine ) const;
+    /** ToRelativeLineIndex changes a layout data index to a count relative to its line.
+        
+    <p>This is equivalent to getting the line start/end pairs with
+    <member>GetLineStartEnd</member> until the index lies within [start,end] of a line
+    </p>
+
+    @param nIndex
+    the absolute index inside the display text to be changed to a relative index
+
+    @returns
+    the relative index inside the displayed line or -1 if the absolute index does
+    not match any line
+    */
+    long ToRelativeLineIndex( long nIndex ) const;
     
 
 	void			SetGetFocusHdl( const Link& rLink ) { maGetFocusHdl = rLink; }
Index: vcl/inc/cursor.hxx
===================================================================
--- vcl/inc/cursor.hxx.orig	2004-09-12 14:26:21.672977672 +0200
+++ vcl/inc/cursor.hxx	2004-09-12 14:54:44.795063760 +0200
@@ -66,6 +66,10 @@
 #include <tools/gen.hxx>
 #endif
 
+#ifndef _LINK_HXX
+#include <tools/link.hxx>
+#endif
+
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
@@ -103,11 +107,9 @@ private:
 
 #if _SOLAR__PRIVATE
 public:
-#ifdef _SV_CURSOR_CXX
 	void			ImplDraw();
 	void			ImplRestore();
 					DECL_LINK( ImplTimerHdl, AutoTimer* );
-#endif
 	void			ImplShow( BOOL bDrawDirect = TRUE );
 	void			ImplHide();
 	void			ImplNew();
Index: vcl/inc/cvtsvm.hxx
===================================================================
--- vcl/inc/cvtsvm.hxx.orig	2004-09-12 14:26:21.672977672 +0200
+++ vcl/inc/cvtsvm.hxx	2004-09-12 14:54:44.795063760 +0200
@@ -129,7 +129,6 @@ class SVMConverter
 {
 private:
 #if _SOLAR__PRIVATE
-#ifdef _SV_CVTSVM_CXX
 	void				ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf );
 	void				ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf );
 	ULONG				ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
@@ -137,7 +136,6 @@ private:
 										  Color& rLineCol, Stack& rLineColStack,
 										  rtl_TextEncoding& rActualCharSet );
 #endif
-#endif // __PRIVATE
 
 public:
 						SVMConverter( SvStream& rIStm, GDIMetaFile& rMtf, ULONG nConvertMode  );
Index: vcl/inc/decoview.hxx
===================================================================
--- vcl/inc/decoview.hxx.orig	2004-09-12 14:26:21.674977368 +0200
+++ vcl/inc/decoview.hxx	2004-09-12 14:54:44.796063608 +0200
@@ -88,6 +88,7 @@ class OutputDevice;
 #define FRAME_DRAW_DOUBLEIN 				((USHORT)0x0004)
 #define FRAME_DRAW_DOUBLEOUT				((USHORT)0x0005)
 #define FRAME_DRAW_MENU                     ((USHORT)0x0010)
+#define FRAME_DRAW_WINDOWBORDER             ((USHORT)0x0020)
 #define FRAME_DRAW_MONO 					((USHORT)0x1000)
 #define FRAME_DRAW_NODRAW					((USHORT)0x8000)
 #define FRAME_DRAW_STYLE					((USHORT)0x000F)
Index: vcl/inc/dialog.hxx
===================================================================
--- vcl/inc/dialog.hxx.orig	2004-09-12 14:26:21.675977216 +0200
+++ vcl/inc/dialog.hxx	2004-09-12 14:54:44.796063608 +0200
@@ -81,20 +81,16 @@ class Dialog : public SystemWindow
 {
 private:
 	Window* 		mpDialogParent;
-	long			mnDummy;
 	Dialog* 		mpPrevExecuteDlg;
 	long*			mpResult;
-	long			mnDummy1;
 	long			mnMousePositioned;
 	BOOL			mbInExecute;
 	BOOL			mbOldSaveBack;
 	BOOL			mbInClose;
 	BOOL			mbModalMode;
 
-#ifdef _SV_DIALOG_CXX
 	void			ImplInitData();
 	void			ImplInitSettings();
-#endif
 
 #if _SOLAR__PRIVATE
 protected:
@@ -126,8 +122,8 @@ public:
 	void			EndDialog( long nResult = 0 );
 	static void		EndAllDialogs( Window* pParent=NULL );
 
-    void            GetDrawWindowBorder( long& rLeftBorder, long& rTopBorder,
-                                         long& rRightBorder, long& rBottomBorder ) const;
+    void            GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+                                         sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
 
 	void			SetModalInputMode( BOOL bModal );
 	void			SetModalInputMode( BOOL bModal, BOOL bSubModalDialogs );
Index: vcl/inc/dockwin.hxx
===================================================================
--- vcl/inc/dockwin.hxx.orig	2004-09-12 14:26:21.676977064 +0200
+++ vcl/inc/dockwin.hxx	2004-09-12 14:54:44.797063456 +0200
@@ -89,10 +89,10 @@ private:
 	long			mnTrackY;
 	long			mnTrackWidth;
 	long			mnTrackHeight;
-	long			mnDockLeft;
-	long			mnDockTop;
-	long			mnDockRight;
-	long			mnDockBottom;
+	sal_Int32			mnDockLeft;
+	sal_Int32			mnDockTop;
+	sal_Int32			mnDockRight;
+	sal_Int32			mnDockBottom;
 	WinBits 		mnFloatBits;
 	BOOL			mbDockCanceled:1,
 					mbDockPrevented:1,
@@ -106,15 +106,10 @@ private:
 					mbPined:1,
 					mbRollUp:1,
 					mbDockBtn:1,
-					mbHideBtn:1,
-					mbDummy1:1,
-					mbDummy2:1,
-					mbDummy3:1;
+					mbHideBtn:1;
 
 #if _SOLAR__PRIVATE
-#ifdef _SV_DOCKWIN_CXX
 	void			ImplInitData();
-#endif
 
 protected:
 	void			ImplInit( Window* pParent, WinBits nStyle );
Index: vcl/inc/edit.hxx
===================================================================
--- vcl/inc/edit.hxx.orig	2004-09-12 14:26:21.676977064 +0200
+++ vcl/inc/edit.hxx	2004-09-12 14:54:44.798063304 +0200
@@ -139,7 +139,6 @@ private:
 	Link				maAutocompleteHdl;
 
 #if _SOLAR__PRIVATE
-#ifdef _SV_EDIT_CXX
 						DECL_LINK( ImplUpdateDataHdl, Timer* );
 
 	void				ImplInitData();
@@ -164,7 +163,6 @@ private:
     void                ImplPaste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
     long                ImplGetExtraOffset() const;
 #endif
-#endif
 
 protected:
 #if _SOLAR__PRIVATE
@@ -174,6 +172,7 @@ protected:
 	void				ImplLoadRes( const ResId& rResId );
 	void				ImplSetSelection( const Selection& rSelection, BOOL bPaint = TRUE );
 #endif
+    int                 ImplGetNativeControlType();
 
 	::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener > mxDnDListener;
 
Index: vcl/inc/field.hxx
===================================================================
--- vcl/inc/field.hxx.orig	2004-09-12 14:26:21.679976608 +0200
+++ vcl/inc/field.hxx	2004-09-12 14:54:44.800063000 +0200
@@ -105,17 +105,10 @@ private:
     BOOL                    mbEmptyFieldValue;
     BOOL                    mbEmptyFieldValueEnabled;
     BOOL                    mbDefaultLocale;
-    ULONG                   mnDummy1;
-    BOOL                    mbDummy1;
-    BOOL                    mbDummy2;
-    BOOL                    mbDummy3;
-    BOOL                    mbDummy4;
 
 protected:
-#if defined( _SV_FIELD_CXX ) || defined( _SV_FIELD2_CXX ) || defined( VCL_LONGCURR_CXX )
     void                    ImplSetText( const XubString& rText, Selection* pNewSel = NULL );
     BOOL                    ImplGetEmptyFieldValue() const  { return mbEmptyFieldValue; }
-#endif
 
     void                    SetFieldText( const XubString& rText, BOOL bKeepSelection );
     void                    SetEmptyFieldValueData( BOOL bValue ) { mbEmptyFieldValue = bValue; }
@@ -125,7 +118,7 @@ protected:
 
 public:
                             FormatterBase( Edit* pField = NULL );
-                            ~FormatterBase();
+    virtual                 ~FormatterBase();
 
     const LocaleDataWrapper& GetLocaleDataWrapper() const;
 
@@ -174,21 +167,16 @@ private:
     XubString               maFieldString;
     XubString               maLiteralMask;
     USHORT                  mnFormatFlags;
-    USHORT                  mnDummy1;
     BOOL                    mbSameMask;
     BOOL                    mbInPattKeyInput;
-    BOOL                    mbDummy1;
-    BYTE                    mbDummy2;
 
 protected:
                             PatternFormatter();
 
-#ifdef _SV_FIELD2_CXX
     void                    ImplLoadRes( const ResId& rResId );
     void                    ImplSetMask( const ByteString& rEditMask, const XubString& rLiteralMask );
     BOOL                    ImplIsSameMask() const { return mbSameMask; }
     BOOL&                   ImplGetInPattKeyInput() { return mbInPattKeyInput; }
-#endif
 
 public:
                             ~PatternFormatter();
@@ -217,9 +205,7 @@ public:
 class NumericFormatter : public FormatterBase
 {
 private:
-#ifdef _SV_FIELD_CXX
     void                    ImplInit();
-#endif
 
 protected:
     long                    mnFieldValue;
@@ -233,8 +219,6 @@ protected:
     USHORT                  mnDumym2;
     BOOL                    mbThousandSep;
     BOOL                    mbShowTrailingZeros;
-    BYTE                    mbDummy2;
-    BYTE                    mbDummy3;
 
     // Eigentlich nur am entsprechenden Feld einstellbar (fuer Interaktion),
     // wird aber in allen Verschiedenen Ableitungen benoetigt
@@ -255,12 +239,10 @@ protected:
     void                    FieldFirst();
     void                    FieldLast();
 
-#ifdef _SV_FIELD_CXX
     void                    ImplLoadRes( const ResId& rResId );
     BOOL                    ImplNumericReformat( const XubString& rStr, double& rValue, XubString& rOutStr );
     void                    ImplNewFieldValue( long nNewValue );
     void                    ImplSetUserValue( long nNewValue, Selection* pNewSelection = NULL );
-#endif
 
 public:
                             ~NumericFormatter();
@@ -308,9 +290,7 @@ public:
 class MetricFormatter : public NumericFormatter
 {
 private:
-#ifdef _SV_FIELD_CXX
     void                    ImplInit();
-#endif
 
 protected:
     XubString               maCustomUnitText;
@@ -324,10 +304,8 @@ protected:
 
     virtual XubString       CreateFieldText( long nValue ) const;
 
-#ifdef _SV_FIELD_CXX
     void                    ImplLoadRes( const ResId& rResId );
     BOOL                    ImplMetricReformat( const XubString& rStr, double& rValue, XubString& rOutStr );
-#endif
 
 public:
                             ~MetricFormatter();
@@ -368,23 +346,13 @@ class CurrencyFormatter : public Numeric
 {
 private:
     String                  maCurrencySymbol;
-    BOOL                    mbDummy1;
-    BOOL                    mbDummy2;
-    BYTE                    mbDummy3;
-    BYTE                    mbDummy4;
 
-#ifdef _SV_FIELD_CXX
     void                    ImplInit();
-#endif
 
 protected:
                             CurrencyFormatter();
-
     virtual XubString       CreateFieldText( long nValue ) const;
-
-#ifdef _SV_FIELD_CXX
     BOOL                    ImplCurrencyReformat( const XubString& rStr, XubString& rOutStr );
-#endif
 
 public:
                             ~CurrencyFormatter();
@@ -417,19 +385,13 @@ private:
     BOOL                    mbShowDateCentury;
     USHORT                  mnDateFormat;
     ULONG                   mnExtDateFormat;
-    BOOL                    mbDummy1;
-    BOOL                    mbDummy2;
-    BYTE                    mbDummy3;
-    BYTE                    mbDummy4;
+    BOOL                    mbEnforceValidValue;
 
-#ifdef _SV_FIELD2_CXX
     void                    ImplInit();
-#endif
 
 protected:
                             DateFormatter();
 
-#ifdef _SV_FIELD2_CXX
     void                    ImplLoadRes( const ResId& rResId );
     const Date&             ImplGetFieldDate() const    { return maFieldDate; }
     BOOL                    ImplDateReformat( const XubString& rStr, XubString& rOutStr,
@@ -440,7 +402,8 @@ protected:
                                                const AllSettings& rSettings ) const;
     void                    ImplNewFieldValue( const Date& rDate );
     CalendarWrapper&        GetCalendarWrapper() const;
-#endif
+
+    BOOL                    ImplAllowMalformedInput() const;
 
 public:
                             ~DateFormatter();
@@ -450,11 +413,6 @@ public:
 
     virtual void            SetLocale( const ::com::sun::star::lang::Locale& rLocale );
 
-#if SUPD < 651
-    // MT 11/01: Seems that nobody uses them, I only want to use the ExtDateFormat now ( ## )
-    void                    SetDateFormat( DateFormat eFormat );
-    DateFormat              GetDateFormat() const;
-#endif
 
     void                    SetExtDateFormat( ExtDateFieldFormat eFormat );
     ExtDateFieldFormat      GetExtDateFormat( BOOL bResolveSystemFormat = FALSE ) const;
@@ -489,6 +447,23 @@ public:
 
     static void             ExpandCentury( Date& rDate );
     static void             ExpandCentury( Date& rDate, USHORT nTwoDigitYearStart );
+
+    static Date             GetInvalidDate() { return Date( 0, 0, 0 ); }
+
+    /** enables or disables the enforcement of valid values
+
+        If this is set to <TRUE/> (which is the default), then GetDate will always return a valid
+        date, no matter whether the current text can really be interpreted as date. (Note: this
+        is the compatible bahavior).
+
+        If this is set to <FALSE/>, the GetDate will return GetInvalidDate, in case the current text
+        cannot be interpreted as date.
+
+        In addition, if this is set to <FALSE/>, the text in the field will <em>not</em> be corrected
+        when the control loses the focus - instead, the invalid input will be preserved.
+    */
+    void                    EnforceValidValue( BOOL _bEnforce ) { mbEnforceValidValue = _bEnforce; }
+    inline BOOL             IsEnforceValidValue( ) const { return mbEnforceValidValue; }
 };
 
 
@@ -507,27 +482,20 @@ private:
     USHORT                  mnTimeFormat;
     BOOL                    mbDuration;
     BOOL                    mbEmptyTime;
-    ULONG                   mnDummy1;
-    BOOL                    mbDummy1;
-    BOOL                    mbDummy2;
-    BYTE                    mbDummy3;
-    BYTE                    mbDummy4;
+    BOOL                    mbEnforceValidValue;
 
-#ifdef _SV_FIELD2_CXX
     void                    ImplInit();
-#endif
 
 protected:
     Time                    maFieldTime;
 
                             TimeFormatter();
 
-#ifdef _SV_FIELD2_CXX
     void                    ImplLoadRes( const ResId& rResId );
     BOOL                    ImplTimeReformat( const XubString& rStr, XubString& rOutStr );
     void                    ImplNewFieldValue( const Time& rTime );
     void                    ImplSetUserTime( const Time& rNewTime, Selection* pNewSelection = NULL );
-#endif
+    BOOL                    ImplAllowMalformedInput() const;
 
 public:
                             ~TimeFormatter();
@@ -557,6 +525,23 @@ public:
     void                    SetEmptyTime() { FormatterBase::SetEmptyFieldValue(); }
     BOOL                    IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); }
     Time                    GetCorrectedTime() const { return maCorrectedTime; }
+
+    static Time             GetInvalidTime() { return Time( 99, 99, 99 ); }
+
+    /** enables or disables the enforcement of valid values
+
+        If this is set to <TRUE/> (which is the default), then GetTime will always return a valid
+        time, no matter whether the current text can really be interpreted as time. (Note: this
+        is the compatible bahavior).
+
+        If this is set to <FALSE/>, the GetTime will return GetInvalidTime, in case the current text
+        cannot be interpreted as time.
+
+        In addition, if this is set to <FALSE/>, the text in the field will <em>not</em> be corrected
+        when the control loses the focus - instead, the invalid input will be preserved.
+    */
+    void                    EnforceValidValue( BOOL _bEnforce ) { mbEnforceValidValue = _bEnforce; }
+    inline BOOL             IsEnforceValidValue( ) const { return mbEnforceValidValue; }
 };
 
 
@@ -583,10 +568,8 @@ public:
 
 class NumericField : public SpinField, public NumericFormatter
 {
-#ifdef _SV_FIELD_CXX
 protected:
     void                    ImplLoadRes( const ResId& rResId );
-#endif
 
 public:
                             NumericField( Window* pParent, WinBits nWinStyle );
@@ -612,10 +595,8 @@ public:
 
 class MetricField : public SpinField, public MetricFormatter
 {
-#ifdef _SV_FIELD_CXX
 protected:
     void                    ImplLoadRes( const ResId& rResId );
-#endif
 
 public:
                             MetricField( Window* pParent, WinBits nWinStyle );
@@ -663,10 +644,8 @@ public:
 
 class CurrencyField : public SpinField, public CurrencyFormatter
 {
-#ifdef _SV_FIELD_CXX
 protected:
     void                    ImplLoadRes( const ResId& rResId );
-#endif
 
 public:
                             CurrencyField( Window* pParent, WinBits nWinStyle );
@@ -696,11 +675,9 @@ private:
     Date                    maFirst;
     Date                    maLast;
 
-#ifdef _SV_FIELD2_CXX
 protected:
     void                    ImplDateSpinArea( BOOL bUp );
     void                    ImplLoadRes( const ResId& rResId );
-#endif
 
 public:
                             DateField( Window* pParent, WinBits nWinStyle );
@@ -739,11 +716,9 @@ private:
     Time                    maFirst;
     Time                    maLast;
 
-#ifdef _SV_FIELD2_CXX
 protected:
     void                    ImplTimeSpinArea( BOOL bUp );
     void                    ImplLoadRes( const ResId& rResId );
-#endif
 
 public:
                             TimeField( Window* pParent, WinBits nWinStyle );
Index: vcl/inc/fixbrd.hxx
===================================================================
--- vcl/inc/fixbrd.hxx.orig	2004-09-12 14:26:21.680976456 +0200
+++ vcl/inc/fixbrd.hxx	2004-09-12 14:54:44.800063000 +0200
@@ -91,18 +91,13 @@ class FixedBorder : public Control
 private:
 	USHORT			mnType;
 	BOOL			mbTransparent;
-	BOOL			mbDummy1;
 
-#if _SOLAR__PRIVATE
-#ifdef _SV_FIXBRD_CXX
 private:
 	void			ImplInit( Window* pParent, WinBits nStyle );
 	WinBits 		ImplInitStyle( WinBits nStyle );
 	void			ImplInitSettings();
 	void			ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
 							  const Point& rPos, const Size& rSize );
-#endif
-#endif
 
 public:
 					FixedBorder( Window* pParent, WinBits nStyle = 0 );
Index: vcl/inc/fixed.hxx
===================================================================
--- vcl/inc/fixed.hxx.orig	2004-09-12 14:26:21.681976304 +0200
+++ vcl/inc/fixed.hxx	2004-09-12 14:54:44.801062848 +0200
@@ -84,14 +84,12 @@ class UserDrawEvent;
 class FixedText : public Control
 {
 #if _SOLAR__PRIVATE
-#ifdef _SV_FIXED_CXX
 private:
     void            ImplInit( Window* pParent, WinBits nStyle );
     WinBits         ImplInitStyle( WinBits nStyle );
     void            ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
     void            ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
                               const Point& rPos, const Size& rSize, bool bFillLayout = false ) const;
-#endif
 public:
     static USHORT   ImplGetTextStyle( WinBits nWinBits );
 #endif
@@ -116,17 +114,15 @@ public:
 
 class FixedLine : public Control
 {
-#if _SOLAR__PRIVATE
-#ifdef _SV_FIXED_CXX
 private:
     void            ImplInit( Window* pParent, WinBits nStyle );
     WinBits         ImplInitStyle( WinBits nStyle );
     void            ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
     void 			ImplDraw( bool bLayout = false );
-#endif
-#endif
+
 protected:
-    virtual void  FillLayoutData() const;
+    virtual void	FillLayoutData() const;
+
 public:
                     FixedLine( Window* pParent, WinBits nStyle = WB_HORZ );
                     FixedLine( Window* pParent, const ResId& rResId );
@@ -148,19 +144,14 @@ private:
     Bitmap          maBitmap;
     Bitmap          maBitmapHC;
 
-#if _SOLAR__PRIVATE
-#ifdef _SV_FIXED_CXX
-private:
     void            ImplInit( Window* pParent, WinBits nStyle );
     WinBits         ImplInitStyle( WinBits nStyle );
     void            ImplInitSettings();
     void            ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
                               const Point& rPos, const Size& rSize );
-#endif
 
 protected:
     void            ImplLoadRes( const ResId& rResId );
-#endif
 
 public:
                     FixedBitmap( Window* pParent, WinBits nStyle = 0 );
@@ -190,19 +181,15 @@ private:
     Image           maImageHC;
     BOOL            mbInUserDraw;
 
-#if _SOLAR__PRIVATE
-#ifdef _SV_FIXED_CXX
 private:
     void            ImplInit( Window* pParent, WinBits nStyle );
     WinBits         ImplInitStyle( WinBits nStyle );
     void            ImplInitSettings();
     void            ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
                               const Point& rPos, const Size& rSize );
-#endif
 
 protected:
     void            ImplLoadRes( const ResId& rResId );
-#endif
 
 public:
                     FixedImage( Window* pParent, WinBits nStyle = 0 );
Index: vcl/inc/floatwin.hxx
===================================================================
--- vcl/inc/floatwin.hxx.orig	2004-09-12 14:26:21.682976152 +0200
+++ vcl/inc/floatwin.hxx	2004-09-12 14:54:44.802062696 +0200
@@ -114,7 +114,6 @@ private:
 	FloatingWindow* mpNextFloat;
 	Window* 		mpFirstPopupModeWin;
 	ToolBox*		mpBox;
-	void*			mpDummy;
 	Rectangle		maFloatRect;
 	ULONG			mnPostId;
 	ULONG			mnPopupModeFlags;
@@ -131,10 +130,8 @@ private:
 	Link			maPopupModeEndHdl;
 
 #if _SOLAR__PRIVATE
-#ifdef _SV_FLOATWIN_CXX
 	void			ImplCallPopupModeEnd();
 					DECL_LINK( ImplEndPopupModeHdl, void* );
-#endif
 
 protected:
 	void			ImplInit( Window* pParent, WinBits nStyle );
Index: vcl/inc/fntstyle.hxx
===================================================================
--- vcl/inc/fntstyle.hxx.orig	2004-09-12 14:26:21.682976152 +0200
+++ vcl/inc/fntstyle.hxx	2004-09-12 14:54:44.802062696 +0200
@@ -62,6 +62,7 @@
 #ifndef _VCL_FNTSTYLE_HXX
 #define _VCL_FNTSTYLE_HXX
 
+#include <tools/solar.h>
 #include <sal/types.h>
 
 // --------------
Index: vcl/inc/font.hxx
===================================================================
--- vcl/inc/font.hxx.orig	2004-09-12 14:26:21.684975848 +0200
+++ vcl/inc/font.hxx	2004-09-12 14:54:44.803062544 +0200
@@ -71,8 +71,8 @@
 #ifndef _TOOLS_LANG_HXX
 #include <tools/lang.hxx>
 #endif
-#ifndef _SV_COLOR_HXX
-#include <color.hxx>
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
 #endif
 #ifndef _VCL_VCLENUM_HXX
 #include <vclenum.hxx>
@@ -81,12 +81,6 @@
 #include <fntstyle.hxx>
 #endif
 
-#ifdef SMART_UNO_GENERATION
-class Font_Type;
-class Font_Size;
-class Font_Attribs;
-#endif
-
 class SvStream;
 #define FontAlign TextAlign
 
@@ -226,18 +220,6 @@ public:
 
 	friend SvStream&	operator>>( SvStream& rIStm, Font& rFont );
 	friend SvStream&	operator<<( SvStream& rOStm, const Font& rFont );
-
-#ifdef SMART_UNO_GENERATION
-	void				getType( Font_Type& ) const;
-	void				setType( const Font_Type& );
-
-	void				getSize( Font_Size& ) const;
-	void				setSize( const Font_Size& );
-
-	void				getAttribs( Font_Attribs& ) const;
-	void				setAttribs( const Font_Attribs& );
-#endif
-
 };
 
 #ifndef NOOLDSV
Index: vcl/inc/fontcfg.hxx
===================================================================
--- vcl/inc/fontcfg.hxx.orig	2004-09-12 14:26:21.685975696 +0200
+++ vcl/inc/fontcfg.hxx	2004-09-12 14:54:44.806062088 +0200
@@ -66,43 +66,70 @@
 #ifndef _UTL_CONFIGITEM_HXX_
 #include <unotools/configitem.hxx>
 #endif
-#ifndef _LANG_HXX
-#include <tools/lang.hxx>
-#endif
 #ifndef _STRING_HXX
 #include <tools/string.hxx>
 #endif
 #ifndef _VCL_ENUM_HXX
 #include <vclenum.hxx>
 #endif
+#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
+#include <com/sun/star/lang/Locale.hpp>
+#endif
 
-#include <map>
 #include <hash_map>
 #include <vector>
 
+namespace com {
+namespace sun {
+namespace star {
+namespace lang {
+
+// equality operator needed for hash_map;
+// (-> why does this need to be in the namespace of Locale ? g++ fails to compile else)
+inline bool operator==( const com::sun::star::lang::Locale& rLeft, const com::sun::star::lang::Locale& rRight )
+{
+    return
+        rLeft.Language.equals( rRight.Language ) &&
+        rLeft.Country.equals( rRight.Country )  &&
+        rLeft.Variant.equals( rRight.Variant )
+        ;
+}
+}}}}
+
 namespace vcl
 {
 
+struct LocaleHash
+{
+    size_t operator()( const com::sun::star::lang::Locale& rLocale ) const
+    {
+        return
+            (size_t)rLocale.Language.hashCode() ^
+            (size_t)rLocale.Country.hashCode()  ^
+            (size_t)rLocale.Variant.hashCode();
+    }
+};
+
 class DefaultFontConfigItem : public ::utl::ConfigItem
 {
 
-    ::std::map< int, ::std::map< int, ::rtl::OUString > >		m_aDefaults;
+    std::hash_map< com::sun::star::lang::Locale , std::hash_map< int, rtl::OUString >, vcl::LocaleHash >		m_aDefaults;
 
-    virtual void Notify( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rPropertyNames );
+    virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames );
     virtual void Commit();
 
     void getValues();
-    static int getKeyType( const ::rtl::OUString& rKey );
+    static int getKeyType( const rtl::OUString& rKey );
     DefaultFontConfigItem();
 public:
     virtual ~DefaultFontConfigItem();
 
     static DefaultFontConfigItem* get();
 
-    const ::rtl::OUString& getDefaultFont( int nLanguage, int nType ) const;
-    const ::rtl::OUString& getUserInterfaceFont( int nLanguage = LANGUAGE_SYSTEM ) const;
+    const rtl::OUString& getDefaultFont( const com::sun::star::lang::Locale& rLocale, int nType ) const;
+    const rtl::OUString& getUserInterfaceFont( const com::sun::star::lang::Locale& rLocale ) const;
 
-    void setDefaultFont( int nLanguage, int nType, const ::rtl::OUString& rName );
+    void setDefaultFont( const com::sun::star::lang::Locale& rLocale, int nType, const rtl::OUString& rName );
 };
 
 
@@ -170,13 +197,13 @@ public:
     struct FontNameAttr
     {
         String								Name;
-        ::std::vector< String >				Substitutions;
-        ::std::vector< String >				MSSubstitutions;
-        ::std::vector< String >				PSSubstitutions;
-        ::std::vector< String >				HTMLSubstitutions;
-        FontWeight							Weight;
+        std::vector< String >			Substitutions;
+        std::vector< String >			MSSubstitutions;
+        std::vector< String >			PSSubstitutions;
+        std::vector< String >			HTMLSubstitutions;
+        FontWeight						Weight;
         FontWidth							Width;
-        unsigned long						Type; // bitfield of IMPL_FONT_ATTR_*
+        unsigned long					Type; // bitfield of IMPL_FONT_ATTR_*
     };
 private:
 
@@ -184,9 +211,9 @@ private:
     // searches on the substitutes are done with Name as key, where
     // a minimal match is sufficient (that is e.g. "Thorndale" will match
     // "Thorndale BlaBlub"). Also names must be lower case.
-    ::std::map< int, ::std::vector< FontNameAttr > > m_aSubstitutions;
+    std::hash_map< com::sun::star::lang::Locale, std::vector< FontNameAttr >, vcl::LocaleHash > m_aSubstitutions;
 
-    virtual void Notify( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rPropertyNames );
+    virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames );
     virtual void Commit();
 
     void getValues();
@@ -196,17 +223,23 @@ public:
 
     static FontSubstConfigItem* get();
 
-    const FontNameAttr* getSubstInfo( const String& rFontName, int nLanguage = LANGUAGE_ENGLISH ) const;
+    const FontNameAttr* getSubstInfo(
+                                     const String& rFontName,
+                                     const com::sun::star::lang::Locale& rLocale =
+                                     com::sun::star::lang::Locale( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "en" ) ),
+                                                                   rtl::OUString(),
+                                                                   rtl::OUString() )
+                                     ) const;
     static void getMapName( const String& rOrgName, String& rShortName, String& rFamilyName, FontWeight& rWeight, FontWidth& rWidth, unsigned long& rType );
 };
 
 class SettingsConfigItem : public ::utl::ConfigItem
 {
 
-    ::std::hash_map< ::rtl::OUString, ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >, ::rtl::OUStringHash >
+    std::hash_map< rtl::OUString, std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >, rtl::OUStringHash >
     			m_aSettings;
 
-    virtual void Notify( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rPropertyNames );
+    virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames );
     virtual void Commit();
 
     void getValues();
@@ -216,8 +249,8 @@ public:
 
     static SettingsConfigItem* get();
 
-    const ::rtl::OUString& getValue( const ::rtl::OUString& rGroup, const ::rtl::OUString& rKey ) const;
-    void setValue( const ::rtl::OUString& rGroup, const ::rtl::OUString& rKey, const ::rtl::OUString& rValue );
+    const rtl::OUString& getValue( const rtl::OUString& rGroup, const rtl::OUString& rKey ) const;
+    void setValue( const rtl::OUString& rGroup, const rtl::OUString& rKey, const rtl::OUString& rValue );
 };
 
 
Index: vcl/inc/gdimtf.hxx
===================================================================
--- vcl/inc/gdimtf.hxx.orig	2004-09-12 14:26:21.686975544 +0200
+++ vcl/inc/gdimtf.hxx	2004-09-12 14:54:44.807061936 +0200
@@ -98,6 +98,7 @@ class Gradient;
 #ifndef METAFILE_END
 #define METAFILE_END					GDI_METAFILE_END
 #endif
+
 #ifndef METAFILE_LABEL_NOTFOUND
 #define METAFILE_LABEL_NOTFOUND			GDI_METAFILE_LABEL_NOTFOUND
 #endif
@@ -136,11 +137,7 @@ typedef BitmapEx (*BmpExchangeFnc)( cons
 // - GDIMetaFile -
 // ---------------
 
-#ifndef MAC
 class GDIMetaFile : protected List
-#else
-class GDIMetaFile : public List
-#endif
 {
 private:
 
@@ -191,8 +188,8 @@ protected:
 
 public:
                     GDIMetaFile();
-                    GDIMetaFile( const GDIMetaFile& rMtf );
-                    ~GDIMetaFile();
+					GDIMetaFile( const GDIMetaFile& rMtf );
+    virtual			~GDIMetaFile();
 
     GDIMetaFile&    operator=( const GDIMetaFile& rMtf );
 	BOOL			operator==( const GDIMetaFile& rMtf ) const;
Index: vcl/inc/glyphcache.hxx
===================================================================
--- vcl/inc/glyphcache.hxx.orig	2004-09-12 14:46:23.370291912 +0200
+++ vcl/inc/glyphcache.hxx	2004-09-12 14:58:34.432153616 +0200
@@ -91,14 +92,17 @@ bool operator==( const ImplFontSelectDat
 
 // =======================================================================
 
+namespace std {
 template<>
-struct std::hash<ImplFontSelectData> 
+struct hash<ImplFontSelectData> 
 {
     size_t operator()( const ImplFontSelectData& ) const;
 };
 
+}
+
 typedef std::map< sal_Unicode, std::map< sal_Unicode, int > > unicodeKernMap;
 typedef std::map< int, std::map< int, int > > glyphKernMap;
 
 //--------
 
@@ -124,7 +131,7 @@ public:
     void                        RemoveFont( const ImplFontData* );
 
 private:
-friend ServerFont;
+    friend class ServerFont;
     // used by ServerFont class only
     void                        AddedGlyph( ServerFont& rServerFont, GlyphData& rGlyphData );
     void                        RemovingGlyph( ServerFont& rSF, GlyphData& rGD, int nGlyphIndex );
@@ -162,7 +169,7 @@ public:
     long                    GetCharWidth() const { return mnAdvanceWidth; }
 
 protected:
-friend class GlyphData;
+    friend class GlyphData;
     void                    SetOffset( int nX, int nY ) { maOffset = Point( nX, nY); }
     void                    SetDelta( int nX, int nY )  { maDelta = Point( nX, nY); }
     void                    SetSize( const Size& s )    { maSize = s; }
Index: vcl/inc/gradient.hxx
===================================================================
--- vcl/inc/gradient.hxx.orig	2004-09-12 14:26:21.688975240 +0200
+++ vcl/inc/gradient.hxx	2004-09-12 14:54:44.810061480 +0200
@@ -62,7 +62,10 @@
 #ifndef _SV_GRADIENT_HXX
 #define _SV_GRADIENT_HXX
 
-#include <color.hxx>
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
+#endif
+
 #include <vclenum.hxx>
 
 // ------------------
@@ -160,29 +163,6 @@ public:
 
     friend SvStream& operator>>( SvStream& rIStm, Gradient& rGradient );
     friend SvStream& operator<<( SvStream& rOStm, const Gradient& rGradient );
-
-#ifdef SMART_UNO_GENERATION
-	GradientStyle	getStyle() const				{ return GetStyle(); }
-	void 			setStyle( GradientStyle e ) 	{ SetStyle( e ); }
-	long 			getStartColor() const			{ return GetStartColor().GetColor(); }
-	void 			setStartColor( long n ) 		{ SetStartColor( Color( n ) ); }
-	long 			getEndColor() const				{ return GetEndColor().GetColor(); }
-	void 			setEndColor( long n ) 			{ SetEndColor( Color( n ) ); }
-	USHORT 			getAngle() const				{ return GetAngle(); }
-	void 			setAngle( USHORT n )			{ SetAngle( n ); }
-	USHORT			getBorder() const				{ return GetBorder(); }
-	void 			setBorder( USHORT n )			{ SetBorder( n ); }
-	USHORT			getXOffset() const				{ return GetOfsX(); }
-	void 			setXOffset( USHORT n )			{ SetOfsX( n ); }
-	USHORT			getYOffset() const				{ return GetOfsY(); }
-	void 			setYOffset( USHORT n )			{ SetOfsY( n ); }
-	USHORT			getStartIntensity() const		{ return GetStartIntensity(); }
-	void 			setStartIntensity( USHORT n )	{ SetStartIntensity( n ); }
-	USHORT			getEndIntensity() const			{ return GetEndIntensity(); }
-	void 			setEndIntensity( USHORT n )		{ SetEndIntensity( n ); }
-	USHORT			getStepCount() const			{ return GetSteps(); }
-	void 			setStepCount( USHORT n )		{ SetSteps( n ); }
-#endif
 };
 
 #endif  // _SV_GRADIENT_HXX
Index: vcl/inc/graph.hxx
===================================================================
--- vcl/inc/graph.hxx.orig	2004-09-12 14:26:21.689975088 +0200
+++ vcl/inc/graph.hxx	2004-09-12 14:54:44.811061328 +0200
@@ -143,6 +143,8 @@ public:
     Bitmap              GetBitmap( const Size* pSizePixel ) const;
     BitmapEx            GetBitmapEx() const;
     BitmapEx            GetBitmapEx( const Size* pSizePixel ) const;
+    Bitmap              GetUnlimitedBitmap( const Size* pSizePixel ) const;
+    BitmapEx            GetUnlimitedBitmapEx( const Size* pSizePixel ) const;
     Animation           GetAnimation() const;
     const GDIMetaFile&  GetGDIMetaFile() const;
 
Index: vcl/inc/group.hxx
===================================================================
--- vcl/inc/group.hxx.orig	2004-09-12 14:26:21.690974936 +0200
+++ vcl/inc/group.hxx	2004-09-12 14:54:44.811061328 +0200
@@ -75,16 +75,15 @@
 
 class GroupBox : public Control
 {
-#ifdef _SV_GROUP_CXX
 private:
     void            ImplInit( Window* pParent, WinBits nStyle );
     WinBits         ImplInitStyle( WinBits nStyle );
     void            ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
     void            ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
                               const Point& rPos, const Size& rSize, bool bLayout = false );
-#endif
 
-    virtual void FillLayoutData() const;
+    virtual void	FillLayoutData() const;
+
 public:
                     GroupBox( Window* pParent, WinBits nStyle = 0 );
                     GroupBox( Window* pParent, const ResId& rResId );
Index: vcl/inc/hatch.hxx
===================================================================
--- vcl/inc/hatch.hxx.orig	2004-09-12 14:26:21.690974936 +0200
+++ vcl/inc/hatch.hxx	2004-09-12 14:54:44.812061176 +0200
@@ -62,7 +62,10 @@
 #ifndef _SV_HATCH_HXX
 #define _SV_HATCH_HXX
 
-#include <color.hxx>
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
+#endif
+
 #include <vclenum.hxx>
 
 // --------------
@@ -77,7 +80,6 @@ struct ImplHatch
     Color				maColor;
     HatchStyle			meStyle;
     long				mnDistance;
-	long				mnDummy;
     USHORT				mnAngle;
 
 						ImplHatch();
@@ -124,22 +126,6 @@ public:
 
     friend SvStream& operator>>( SvStream& rIStm, Hatch& rHatch );
     friend SvStream& operator<<( SvStream& rOStm, const Hatch& rHatch );
-
-#ifdef SMART_UNO_GENERATION
-
-	HatchStyle		getStyle() const { return GetStyle(); }
-	void 			setStyle( HatchStyle eStyle ) { SetStyle( eStyle ); }
-
-	long 			getColor() const { return GetColor().GetColor(); }
-	void 			setColor( long nColor ) { SetColor( Color( nColor ) ); }
-
-	long			getDistance() const { return GetDistance(); }
-	void 			setDistance( ULONG nDistance ) { SetDistance( nDistance ); }
-
-	USHORT 			getAngle() const { return GetAngle(); }
-	void 			setAngle( USHORT n ) { SetAngle( n ); }
-
-#endif
 };
 
 #endif  // _SV_HATCH_HXX
Index: vcl/inc/help.hxx
===================================================================
--- vcl/inc/help.hxx.orig	2004-09-12 14:26:21.691974784 +0200
+++ vcl/inc/help.hxx	2004-09-12 14:54:44.812061176 +0200
@@ -103,6 +103,7 @@ private:
 
 public:
 						Help();
+	virtual				~Help();
 
 	void				SetHelpFile( const String& rFileName ) { maHelpFile = rFileName; }
 	const String&		GetHelpFile() const { return maHelpFile; }
Index: vcl/inc/ilstbox.hxx
===================================================================
--- vcl/inc/ilstbox.hxx.orig	2004-09-12 14:26:21.693974480 +0200
+++ vcl/inc/ilstbox.hxx	2004-09-12 14:54:44.814060872 +0200
@@ -244,7 +244,7 @@ private:
 	USHORT			mnBorder;		 // Abstand Rahmen - Text
 	USHORT			mnTextHeight;	 // Texthoehe
 
-	USHORT			mnSelectModifier;	// Modifiers 
+	USHORT			mnSelectModifier;	// Modifiers
 
     BOOL            mbHasFocusRect;
 
@@ -261,8 +261,8 @@ private:
 					mbGrabFocus:			1,  // Focus bei MBDown grabben
 					mbUserDrawEnabled:		1,	// UserDraw possible
 					mbInUserDraw:			1,	// In UserDraw
-					mbReadOnly:				1;	// ReadOnly
-
+					mbReadOnly:				1,	// ReadOnly
+					mbMirroring:			1;	// pb: #106948# explicit mirroring for calc
 
 	Link			maScrollHdl;
 	Link			maSelectHdl;
@@ -273,7 +273,7 @@ private:
 
 protected:
 	DECL_LINK(		SearchStringTimeout, Timer* );
-	
+
 	virtual void	KeyInput( const KeyEvent& rKEvt );
 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
 	virtual void	MouseMove( const MouseEvent& rMEvt );
@@ -293,7 +293,7 @@ protected:
     void            ImplShowFocusRect();
     void            ImplHideFocusRect();
 
-	
+
 	virtual void	StateChanged( StateChangedType nType );
 	virtual void	DataChanged( const DataChangedEvent& rDCEvt );
 
@@ -316,6 +316,7 @@ public:
 
 	void			SelectEntry( USHORT nPos, BOOL bSelect );
 	void			DeselectAll();
+    USHORT			GetEntryPosForPoint( const Point& rPoint ) const;
 
 	BOOL			ProcessKeyInput( const KeyEvent& rKEvt );
 
@@ -342,13 +343,13 @@ public:
 
 	void			EnableUserDraw( BOOL bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
 	BOOL			IsUserDrawEnabled() const 	{ return mbUserDrawEnabled; }
-	
+
 	void			EnableMultiSelection( BOOL bMulti, BOOL bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; }
 	BOOL			IsMultiSelectionEnabled() const 	{ return mbMulti; }
-	
+
 	void			SetMultiSelectionSimpleMode( BOOL bSimple )	{ mbSimpleMode = bSimple; }
 	BOOL			IsMultiSelectionSimpleMode() const 			{ return mbSimpleMode; }
-	
+
 	void			EnableMouseMoveSelect( BOOL bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; }
 	BOOL			IsMouseMoveSelectEnabled() const 	{ return mbMouseMoveSelect; }
 	BOOL			IsMouseMoveSelect() const 	{ return mbMouseMoveSelect||mbStackMode; }
@@ -372,7 +373,7 @@ public:
 	const Link& 	GetUserDrawHdl() const				{ return maUserDrawHdl; }
 	void			SetMRUChangedHdl( const Link& rLink )	{ maMRUChangedHdl = rLink; }
 	const Link& 	GetMRUChangedHdl() const				{ return maMRUChangedHdl; }
-					
+
 	BOOL			IsSelectionChanged() const { return mbSelectionChanged; }
 	USHORT			GetSelectModifier() const { return mnSelectModifier; }
 
@@ -381,8 +382,11 @@ public:
 	void			SetReadOnly( BOOL bReadOnly ) 	{ mbReadOnly = bReadOnly; }
 	BOOL			IsReadOnly() const 				{ return mbReadOnly; }
 
-	
 	void			ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+
+	// pb: #106948# explicit mirroring for calc
+	inline void		EnableMirroring()		{ mbMirroring = TRUE; }
+	inline BOOL		IsMirroring() const { return mbMirroring; }
 };
 
 // ---------------
@@ -422,7 +426,7 @@ public:
 
 	const ImplEntryList*	GetEntryList() const			{ return maLBWindow.GetEntryList(); }
 	ImplListBoxWindow* 		GetMainWindow() 				{ return &maLBWindow; }
-	
+
 	virtual void	Resize();
     virtual const Wallpaper& GetDisplayBackground() const;
     virtual Window*     GetPreferredKeyInputWindow();
@@ -441,7 +445,7 @@ public:
 
 	BOOL			ProcessKeyInput( const KeyEvent& rKEvt )	{ return maLBWindow.ProcessKeyInput( rKEvt ); }
 	BOOL			HandleWheelAsCursorTravel( const CommandEvent& rCEvt );
-	
+
 	void			SetSeparatorPos( USHORT n )		{ maLBWindow.SetSeparatorPos( n ); }
 	USHORT			GetSeparatorPos() const			{ return maLBWindow.GetSeparatorPos(); }
 
@@ -459,7 +463,7 @@ public:
 
 	void			EnableMultiSelection( BOOL bMulti, BOOL bStackMode ) { maLBWindow.EnableMultiSelection( bMulti, bStackMode ); }
 	BOOL			IsMultiSelectionEnabled() const 	{ return maLBWindow.IsMultiSelectionEnabled(); }
-	
+
 	void			SetMultiSelectionSimpleMode( BOOL bSimple ) { maLBWindow.SetMultiSelectionSimpleMode( bSimple ); }
 	BOOL			IsMultiSelectionSimpleMode() const 	{ return maLBWindow.IsMultiSelectionSimpleMode(); }
 
@@ -481,7 +485,7 @@ public:
 	const Link& 	GetDoubleClickHdl() const				{ return maLBWindow.GetDoubleClickHdl(); }
 	void			SetUserDrawHdl( const Link& rLink )	{ maLBWindow.SetUserDrawHdl( rLink ); }
 	const Link& 	GetUserDrawHdl() const				{ return maLBWindow.GetUserDrawHdl(); }
-	
+
 	void			SetSelectionChangedHdl( const Link& rLnk )	{ maLBWindow.GetEntryList()->SetSelectionChangedHdl( rLnk ); }
 	void			SetCallSelectionChangedHdl( BOOL bCall )	{ maLBWindow.GetEntryList()->SetCallSelectionChangedHdl( bCall ); }
 	BOOL			IsSelectionChanged() const 					{ return maLBWindow.IsSelectionChanged(); }
@@ -493,6 +497,9 @@ public:
 	USHORT			GetMaxMRUCount() const						{ return maLBWindow.GetEntryList()->GetMaxMRUCount(); }
     USHORT			GetDisplayLineCount() const
     { return maLBWindow.GetDisplayLineCount(); }
+
+	// pb: #106948# explicit mirroring for calc
+	inline void		EnableMirroring()	{ maLBWindow.EnableMirroring(); }
 };
 
 // -----------------------------
@@ -535,6 +542,8 @@ public:
 	USHORT			GetDropDownLineCount() const { return mnDDLineCount; }
 
     USHORT          GetPopupModeStartSaveSelection() const { return mnPopupModeStartSaveSelection; }
+
+    virtual void	Resize();
 };
 
 // -----------
@@ -544,15 +553,15 @@ public:
 class ImplWin : public Control
 {
 private:
-	
+
 	USHORT			mnItemPos;	// wegen UserDraw muss ich wissen, welches Item ich darstelle.
 	XubString		maString;
 	Image			maImage;
 	Image			maImageHC;
-	
+
 	Rectangle		maFocusRect;
 	Size			maUserItemSize;
-	
+
 	Link			maMBDownHdl;
 	Link			maUserDrawHdl;
 
@@ -573,10 +582,11 @@ public:
 	virtual void	Resize();
 	virtual void	GetFocus();
 	virtual void	LoseFocus();
+    virtual long    PreNotify( NotifyEvent& rNEvt );
 
 	USHORT			GetItemPos() const { return mnItemPos; }
 	void			SetItemPos( USHORT n ) { mnItemPos = n; }
-	
+
 	const XubString& GetString() const { return maString; }
 	void			SetString( const XubString& rStr ) { maString = rStr; }
 
@@ -590,16 +600,16 @@ public:
 	virtual void	MBDown();
 	void			SetMBDownHdl( const Link& rLink ) { maMBDownHdl = rLink; }
 	const Link& 	GetMBDownHdl() const { return maMBDownHdl; }
-	
+
 	void			SetUserDrawHdl( const Link& rLink )	{ maUserDrawHdl = rLink; }
 	const Link& 	GetUserDrawHdl() const				{ return maUserDrawHdl; }
-	
+
 	void			SetUserItemSize( const Size& rSz )	{ maUserItemSize = rSz; }
 	const Size&		GetUserItemSize() const				{ return maUserItemSize; }
 
 	void			EnableUserDraw( BOOL bUserDraw ) 	{ mbUserDrawEnabled = bUserDraw; }
 	BOOL			IsUserDrawEnabled() const 			{ return mbUserDrawEnabled; }
-	
+
 	void 			DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE, bool bLayout = false );
 };
 
Index: vcl/inc/imgcons.hxx
===================================================================
--- vcl/inc/imgcons.hxx.orig	2004-09-12 14:26:21.694974328 +0200
+++ vcl/inc/imgcons.hxx	2004-09-12 14:54:44.815060720 +0200
@@ -85,7 +85,6 @@ private:
 	Bitmap				maBitmap;
 	Bitmap				maMask;
 	Rectangle			maChangedRect;
-	Rectangle			maDummyRect;
 	Size				maSize;
 	ImplColorMapper*	mpMapper;
 	Color*				mpPal;
@@ -94,10 +93,6 @@ private:
 	ULONG				mnFormat;
 	ULONG				mnStatus;
 	BOOL				mbTrans;
-	long				mnDummy1;
-	long				mnDummy2;
-	BOOL				mbDummy1;
-	BOOL				mbDummy2;
 						
 protected:				
 						
Index: vcl/inc/imgctrl.hxx
===================================================================
--- vcl/inc/imgctrl.hxx.orig	2004-09-12 14:26:21.695974176 +0200
+++ vcl/inc/imgctrl.hxx	2004-09-12 14:54:44.816060568 +0200
@@ -74,7 +74,7 @@ class ImageControl : public FixedImage
 private:
 	BitmapEx		maBmp;
 	BitmapEx		maBmpHC;
-	ULONG			mnDummy1_mbScaleImage;  // Change member in next full update!
+	BOOL			mbScaleImage;
 
 public:
 					ImageControl( Window* pParent, WinBits nStyle = 0 );
Index: vcl/inc/impbmp.hxx
===================================================================
--- vcl/inc/impbmp.hxx.orig	2004-09-12 14:26:21.696974024 +0200
+++ vcl/inc/impbmp.hxx	2004-09-12 14:54:44.816060568 +0200
@@ -92,11 +92,7 @@ private:
     ULONG				mnRefCount;
 	ULONG				mnChecksum;
 	RMBitmap*			mpRMBitmap;
-#ifndef REMOTE_APPSERVER
     SalBitmap*			mpSalBitmap;
-#else
-    ImplServerBitmap*   mpSalBitmap;
-#endif
 
 public:
 
@@ -107,41 +103,8 @@ public:
 
 public:
 
-#ifndef REMOTE_APPSERVER
 	void				ImplSetSalBitmap( SalBitmap* pSalBitmap );
     SalBitmap*			ImplGetSalBitmap() const { return mpSalBitmap; }
-#else
-    void            	ImplSetSalBitmap( ImplServerBitmap* pSalBitmap );
-    ImplServerBitmap*	ImplGetSalBitmap() const { return mpSalBitmap; }
-
-	RMBitmap*			ImplGetRemoteBmp();
-
-	void				ImplCreateRemoteBmp( const Bitmap& rBitmap );
-	void				ImplCreateRemoteBmp( const Bitmap& rBitmap, 
-											 OutputDevice* pOut,
-											 const Point& rPt, const Size& rSz );
-	
-	void				ImplReleaseRemoteBmp();
-
-	void				ImplDrawRemoteBmp( OutputDevice* pOut,
-								const Point& rSrcPt, const Size& rSrcSz,
-								const Point& rDestPt, const Size& rDestSz );
-	void				ImplDrawRemoteBmpEx( OutputDevice* pOut,
-								const Point& rSrcPt, const Size& rSrcSz,
-								const Point& rDestPt, const Size& rDestSz,
-								const Bitmap& rMask );
-	void				ImplDrawRemoteBmpAlpha( OutputDevice* pOut,
-								const Point& rSrcPt, const Size& rSrcSz,
-								const Point& rDestPt, const Size& rDestSz,
-								const AlphaMask& rAlpha );
-	void				ImplDrawRemoteBmpMask( OutputDevice* pOut,
-								const Point& rSrcPt, const Size& rSrcSz,
-								const Point& rDestPt, const Size& rDestSz,
-								const Color& rColor );
-
-	BOOL				ImplIsGetPrepared() const;
-	void				ImplResolveGet();
-#endif
 
 public:
 
Index: vcl/inc/impgraph.hxx
===================================================================
--- vcl/inc/impgraph.hxx.orig	2004-09-12 14:26:21.697973872 +0200
+++ vcl/inc/impgraph.hxx	2004-09-12 14:54:44.817060416 +0200
@@ -144,8 +144,8 @@ private:
 	BOOL				ImplIsAlpha() const;
 	BOOL				ImplIsAnimated() const;
 
-	Bitmap				ImplGetBitmap( const Size* pSizePixel ) const;
-	BitmapEx			ImplGetBitmapEx( const Size* pSizePixel ) const;
+	Bitmap				ImplGetBitmap( const Size* pSizePixel, BOOL bUnlimited ) const;
+	BitmapEx			ImplGetBitmapEx( const Size* pSizePixel, BOOL bUnlimited ) const;
 	Animation			ImplGetAnimation() const;
 	const GDIMetaFile&	ImplGetGDIMetaFile() const;
 
Index: vcl/inc/jobset.h
===================================================================
--- vcl/inc/jobset.h.orig	2004-09-12 14:26:21.697973872 +0200
+++ vcl/inc/jobset.h	2004-09-12 14:54:44.817060416 +0200
@@ -72,7 +72,7 @@
 #ifndef _SV_PRNTYPES_HXX
 #include <prntypes.hxx>
 #endif
-#ifndef __SGI_STL_HASH_MAP
+#ifndef _STLP_HASH_MAP
 #include <hash_map>
 #endif
 #ifndef _RTL_USTRING_
Index: vcl/inc/jobset.hxx
===================================================================
--- vcl/inc/jobset.hxx.orig	2004-09-12 14:26:21.698973720 +0200
+++ vcl/inc/jobset.hxx	2004-09-12 14:54:44.818060264 +0200
@@ -75,10 +75,6 @@
 class SvStream;
 struct ImplJobSetup;
 
-#ifdef REMOTE_APPSERVER
-namespace com { namespace sun { namespace star { namespace portal { namespace client { struct RmJobSetup; } } } } }
-#endif
-
 // ------------
 // - JobSetup -
 // ------------
@@ -115,10 +111,6 @@ public:
 	
 
 	JobSetup&			operator=( const JobSetup& rJob );
-#ifdef REMOTE_APPSERVER
-    JobSetup&			operator=( const ::com::sun::star::portal::client::RmJobSetup& );
-    void				SetRmJobSetup( ::com::sun::star::portal::client::RmJobSetup& ) const;
-#endif
 
 	BOOL				operator==( const JobSetup& rJobSetup ) const;
 	BOOL				operator!=( const JobSetup& rJobSetup ) const
Index: vcl/inc/keycod.hxx
===================================================================
--- vcl/inc/keycod.hxx.orig	2004-09-12 14:26:21.699973568 +0200
+++ vcl/inc/keycod.hxx	2004-09-12 14:54:44.818060264 +0200
@@ -69,8 +69,8 @@
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
-#ifndef _SV_RESID_HXX
-#include <resid.hxx>
+#ifndef _TOOLS_RESID_HXX
+#include <tools/resid.hxx>
 #endif
 #ifndef _SV_KEYCODES_HXX
 #include <keycodes.hxx>
Index: vcl/inc/keycodes.hxx
===================================================================
--- vcl/inc/keycodes.hxx.orig	2004-09-12 14:26:21.700973416 +0200
+++ vcl/inc/keycodes.hxx	2004-09-12 14:54:44.819060112 +0200
@@ -70,7 +70,7 @@
 // - KeyCode-Types -
 // -----------------
 
-// By changes you must also change: tools/vclrsc.hxx
+// By changes you must also change: rsc/vclrsc.hxx
 
 // Key-Gruppen
 #define KEYGROUP_NUM	((USHORT)0x0100)
@@ -186,6 +186,7 @@
 #define KEY_MENU		((USHORT)(KEYGROUP_MISC+26))
 #define KEY_HELP		((USHORT)(KEYGROUP_MISC+27))
 #define KEY_HANGUL_HANJA ((USHORT)(KEYGROUP_MISC+28))
+#define KEY_DECIMAL     ((USHORT)(KEYGROUP_MISC+29))
 
 #define KEY_CODE		((USHORT)0x0FFF)
 
Index: vcl/inc/lineinfo.hxx
===================================================================
--- vcl/inc/lineinfo.hxx.orig	2004-09-12 14:26:21.701973264 +0200
+++ vcl/inc/lineinfo.hxx	2004-09-12 14:54:44.819060112 +0200
@@ -140,31 +140,6 @@ public:
 
     friend SvStream& operator>>( SvStream& rIStm, LineInfo& rLineInfo );
     friend SvStream& operator<<( SvStream& rOStm, const LineInfo& rLineInfo );
-
-#ifdef SMART_UNO_GENERATION
-
-	LineStyle		getStyle() const { return GetStyle(); }
-	void 			setStyle( LineStyle eStyle ) { SetStyle( eStyle ); }
-
-	long			getWidth() const { return GetWidth(); }
-	void 			setWidth( ULONG nDistance ) { SetWidth( nWidth ); }
-
-	USORT			getDashCount const { return GetDashCount(); }
-	void			setDashCount( USHORT nDashCount ) { SetDashCount( nDashCount ); }
-
-	long			getDashLen() const { return GetDashLen(); }
-	void			setDashLen( long nDashLen ) { SetDashLen( nDashLen ); }
-
-	USHORT			getDotCount() const { return GetDotCount(); }
-	void			setDotCount( USHORT nDotCount ) { SetDotCount( nDotCount ); }
-
-	long			getDotLen() const { GetDotLen(); }
-	void			setDotLen( long nDotLen ) { SetDotLen( nDotLen ); }
-
-	long			getDistance() const { return GetDistance(); }
-	void			setDistance( long nDistance ) { SetDistance( nDistance ); }
-
-#endif
 };
 
 #endif  // _SV_LINEINFO_HXX
Index: vcl/inc/longcurr.hxx
===================================================================
--- vcl/inc/longcurr.hxx.orig	2004-09-12 14:26:21.702973112 +0200
+++ vcl/inc/longcurr.hxx	2004-09-12 14:54:44.820059960 +0200
@@ -77,12 +77,9 @@ class LocaleDataWrapper;
 
 class LongCurrencyFormatter : public FormatterBase
 {
-#if _SOLAR__PRIVATE
-#ifdef VCL_LONGCURR_CXX
-	friend BOOL ImplLongCurrencyReformat( const XubString&, BigInt, BigInt, USHORT, const LocaleDataWrapper&, XubString&, LongCurrencyFormatter& );
+private:
+	friend BOOL				ImplLongCurrencyReformat( const XubString&, BigInt, BigInt, USHORT, const LocaleDataWrapper&, XubString&, LongCurrencyFormatter& );
 	void					ImpInit();
-#endif
-#endif
 
 protected:
 	BigInt					mnFieldValue;
@@ -95,9 +92,6 @@ protected:
 	USHORT                  mnDecimalDigits;
     BOOL                    mbThousandSep;
 
-    ULONG                   mnDummy;
-    BOOL                    mbDummy;
-
 							LongCurrencyFormatter();
 	void					ImplLoadRes( const ResId& rResId );
 
@@ -141,10 +135,8 @@ public:
 class LongCurrencyField : public SpinField, public LongCurrencyFormatter
 {
 #if _SOLAR__PRIVATE
-#ifdef VCL_LONGCURR_CXX
 	friend void ImplNewLongCurrencyFieldValue( LongCurrencyField*, BigInt );
 #endif
-#endif
 
 private:
 	BigInt			mnSpinSize;
Index: vcl/inc/lstbox.hxx
===================================================================
--- vcl/inc/lstbox.hxx.orig	2004-09-12 14:26:21.703972960 +0200
+++ vcl/inc/lstbox.hxx	2004-09-12 14:54:44.821059808 +0200
@@ -232,6 +232,9 @@ public:
 	USHORT			GetMaxMRUCount() const;
 
     USHORT			GetDisplayLineCount() const;
+
+	void			EnableMirroring();
+
 };
 
 
Index: vcl/inc/mapmod.hxx
===================================================================
--- vcl/inc/mapmod.hxx.orig	2004-09-12 14:26:21.704972808 +0200
+++ vcl/inc/mapmod.hxx	2004-09-12 14:54:44.821059808 +0200
@@ -72,8 +72,8 @@
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
-#ifndef _SV_RESID_HXX
-#include <resid.hxx>
+#ifndef _TOOLS_RESID_HXX
+#include <tools/resid.hxx>
 #endif
 #ifndef _VCL_MAPUNIT_HXX
 #include <mapunit.hxx>
@@ -101,11 +101,9 @@ private:
 	friend SvStream& operator>>( SvStream& rIStm, ImplMapMode& rMapMode );
 	friend SvStream& operator<<( SvStream& rOStm, const ImplMapMode& rMapMode );
 
-#ifdef _SV_MAPMOD_CXX
 public:
 					ImplMapMode();
 					ImplMapMode( const ImplMapMode& rImpMapMode );
-#endif
 };
 
 // -----------
@@ -119,9 +117,7 @@ class MapMode
 private:
 	ImplMapMode*	mpImplMapMode;
 
-#ifdef _SV_MAPMOD_CXX
 	void			ImplMakeUnique();
-#endif
 
 public:
 					MapMode();
Index: vcl/inc/menu.hxx
===================================================================
--- vcl/inc/menu.hxx.orig	2004-09-12 14:26:21.706972504 +0200
+++ vcl/inc/menu.hxx	2004-09-12 14:54:44.823059504 +0200
@@ -66,20 +66,20 @@
 #include <sv.h>
 #endif
 
-#ifndef _SV_RC_HXX
-#include <rc.hxx>
+#ifndef _TOOLS_RC_HXX
+#include <tools/rc.hxx>
 #endif
 
-#ifndef _SV_RESID_HXX
-#include <resid.hxx>
+#ifndef _TOOLS_RESID_HXX
+#include <tools/resid.hxx>
 #endif
 
 #ifndef _SV_BITMAPEX_HXX
 #include <bitmapex.hxx>
 #endif
 
-#ifndef _SV_COLOR_HXX
-#include <color.hxx>
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
 #endif
 
 #ifndef _VCL_VCLEVENT_HXX
@@ -104,6 +104,8 @@ class AppBarWindow;
 class MenuFloatingWindow;
 class Window;
 class AccessObjectRef;
+class SalMenu;
+struct SystemMenuData;
 
 namespace com {
 namespace sun {
@@ -126,11 +128,11 @@ namespace vcl { struct MenuLayoutData; }
 #define POPUPMENU_EXECUTE_LEFT	((USHORT)0x0004)
 #define POPUPMENU_EXECUTE_RIGHT ((USHORT)0x0008)
 
-// By changes you must also change: tools/vclrsc.hxx
+// By changes you must also change: rsc/vclrsc.hxx
 enum MenuItemType { MENUITEM_DONTKNOW, MENUITEM_STRING, MENUITEM_IMAGE,
 					MENUITEM_STRINGIMAGE, MENUITEM_SEPARATOR };
 
-// By changes you must also change: tools/vclrsc.hxx
+// By changes you must also change: rsc/vclrsc.hxx
 typedef USHORT MenuItemBits;
 #define MIB_CHECKABLE			((MenuItemBits)0x0001)
 #define MIB_RADIOCHECK			((MenuItemBits)0x0002)
@@ -151,12 +153,10 @@ struct MenuLogo
 	BitmapEx	aBitmap;
 	Color		aStartColor;
 	Color		aEndColor;
-	ULONG		nDummy;
 };
 
 class Menu : public Resource
 {
-	friend class AccessObject;
 	friend class MenuBar;
 	friend class MenuBarWindow;
 	friend class MenuFloatingWindow;
@@ -164,6 +164,7 @@ class Menu : public Resource
 	friend class SystemWindow;
 
 private:
+	void*				pMenuData_NotUsedYet;
 	MenuItemList*		pItemList;			// Liste mit den MenuItems
 	MenuLogo*			pLogo;
 	Menu*				pStartedFrom;
@@ -180,7 +181,7 @@ private:
 	XubString			aTitleText; 		// PopupMenu-Text
 
 	ULONG				nEventId;
-	ULONG				nDummy;
+	USHORT				mnHighlightedItemPos; // for native menues: keeps track of the highlighted item 
 	USHORT				nMenuFlags;
 	USHORT				nDefaultItem;		// Id vom Default-Item
 	USHORT				nSelectedId;
@@ -197,16 +198,14 @@ private:
 
     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxAccessible;
 	mutable vcl::MenuLayoutData* mpLayoutData;
-	void*				mpDummy;
-	long				mnDummy;
-	BOOL				mbDummy;
+	SalMenu*			mpSalMenu;
 
 protected:
-#ifdef _SV_MENU_CXX
 	void				ImplInit();
 	void				ImplLoadRes( const ResId& rResId );
 	Menu*				ImplGetStartMenu();
 	Menu*				ImplFindSelectMenu();
+	Menu*				ImplFindMenu( USHORT nId );
 	Size				ImplCalcSize( Window* pWin );
 	BOOL				ImplIsVisible( USHORT nPos ) const;
 	USHORT				ImplGetVisibleItemCount() const;
@@ -220,11 +219,16 @@ protected:
 						DECL_LINK( ImplCallSelect, Menu* );
 
     void				ImplFillLayoutData() const;
+    SalMenu*            ImplGetSalMenu() { return mpSalMenu; }
+    void                ImplSetSalMenu( SalMenu *pMenu );
+
+#if _SOLAR__PRIVATE
 public:
     void				ImplKillLayoutData() const;
 #endif
 
 						Menu();
+						Menu( BOOL bMenuBar );
 	Window* 			ImplGetWindow() const { return pWindow; }
 
 public:
@@ -315,7 +319,10 @@ public:
 	void				SetTipHelpText( USHORT nItemId, const XubString& rString );
 	const XubString&	GetTipHelpText( USHORT nItemId ) const;
 
-	void				SetHelpId( USHORT nItemId, ULONG nHelpId );
+    void                SetHelpCommand( USHORT nItemId, const XubString& rString );
+    const XubString&    GetHelpCommand( USHORT nItemId ) const;
+    
+    void				SetHelpId( USHORT nItemId, ULONG nHelpId );
 	ULONG				GetHelpId( USHORT nItemId ) const;
 
 	void				SetActivateHdl( const Link& rLink ) 	{ aActivateHdl = rLink; }
@@ -347,6 +354,9 @@ public:
 	// Fuer Menu-'Funktionen'
 	MenuItemList*		GetItemList() const 					{ return pItemList; }
 
+    // returns the system's menu handle if native menues are supported
+    // pData must point to a SystemMenuData structure
+    BOOL                GetSystemMenuData( SystemMenuData* pData ) const;
 
     // accessibility helpers
 
@@ -393,14 +403,13 @@ public:
 
 class MenuBar : public Menu
 {
-	void*				pDummy;
 	Link				maCloserHdl;
 	Link				maFloatHdl;
 	Link				maHideHdl;
 	BOOL				mbCloserVisible;
 	BOOL				mbFloatBtnVisible;
 	BOOL				mbHideBtnVisible;
-	BOOL				mbDummy1;
+	BOOL				mbDisplayable;
 
 #if _SOLAR__PRIVATE
 	friend class Application;
@@ -431,6 +440,10 @@ public:
 	void				ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide );
 
 	void				SelectEntry( USHORT nId );
+    BOOL                HandleMenuActivateEvent( Menu *pMenu ) const;
+    BOOL                HandleMenuDeActivateEvent( Menu *pMenu ) const;
+    BOOL                HandleMenuHighlightEvent( Menu *pMenu, USHORT nEventId ) const;
+    BOOL                HandleMenuCommandEvent( Menu *pMenu, USHORT nEventId ) const;
 
 	void				SetCloserHdl( const Link& rLink )			{ maCloserHdl = rLink; }
 	const Link& 		GetCloserHdl() const						{ return maCloserHdl; }
@@ -438,6 +451,14 @@ public:
 	const Link& 		GetFloatButtonClickHdl() const				{ return maFloatHdl; }
 	void				SetHideButtonClickHdl( const Link& rLink )	{ maHideHdl = rLink; }
 	const Link& 		GetHideButtonClickHdl() const				{ return maHideHdl; }
+
+    //  - by default a menubar is displayable
+    //  - if a menubar is not displayable, its MenuBarWindow will never be shown
+    //    and it will be hidden if it was visible before
+    //  - note: if a menubar is diplayable, this does not necessarily mean that it is currently visible
+    void                SetDisplayable( BOOL bDisplayable );
+    BOOL                IsDisplayable() const                       { return mbDisplayable; }
+
 };
 
 inline MenuBar& MenuBar::operator =( const MenuBar& rMenu )
Index: vcl/inc/menubtn.hxx
===================================================================
--- vcl/inc/menubtn.hxx.orig	2004-09-12 14:26:21.707972352 +0200
+++ vcl/inc/menubtn.hxx	2004-09-12 14:54:44.823059504 +0200
@@ -86,7 +86,6 @@ class MenuButton : public PushButton
 {
 private:
 	Rectangle		maFocusRect;
-	void*			mpDummy;
 	Timer*			mpMenuTimer;
 	PopupMenu*		mpOwnMenu;
 	PopupMenu*		mpMenu;
@@ -95,11 +94,9 @@ private:
 	Link			maActivateHdl;
 	Link			maSelectHdl;
 
-#ifdef _SV_MENUBTN_CXX
 	void			ImplInitData();
 	void			ImplExecuteMenu();
 					DECL_LINK( ImplMenuTimeoutHdl, Timer* );
-#endif
 
 protected:
 	void			ImplInit( Window* pParent, WinBits nStyle );
Index: vcl/inc/metaact.hxx
===================================================================
--- vcl/inc/metaact.hxx.orig	2004-09-12 14:26:21.709972048 +0200
+++ vcl/inc/metaact.hxx	2004-09-12 14:54:44.825059200 +0200
@@ -74,8 +74,8 @@
 #ifndef _SV_FONT_HXX
 #include <font.hxx>
 #endif
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#ifndef _TL_POLY_HXX
+#include <tools/poly.hxx>
 #endif
 #ifndef _SV_BITMAP_HXX
 #include <bitmap.hxx>
@@ -575,7 +575,7 @@ private:
 
 	Point				maStartPt;
 	XubString			maStr;
-	long*				mpDXAry;
+	sal_Int32*			mpDXAry;
 	USHORT				mnIndex;
 	USHORT				mnLen;
 
@@ -586,7 +586,7 @@ public:
 						MetaTextArrayAction( const MetaTextArrayAction& rAction );
 						MetaTextArrayAction( const Point& rStartPt,
 											 const XubString& rStr,
-											 const long* pDXAry,
+											 const sal_Int32* pDXAry,
 											 USHORT nIndex,
 											 USHORT nLen );
 	virtual 			~MetaTextArrayAction();
@@ -605,7 +605,7 @@ public:
 	const XubString&	GetText() const { return maStr; }
 	USHORT				GetIndex() const { return mnIndex; }
 	USHORT				GetLen() const { return mnLen; }
-	long*				GetDXArray() const { return mpDXAry; }
+	sal_Int32*			GetDXArray() const { return mpDXAry; }
 };
 
 // -------------------------
Index: vcl/inc/msgbox.hxx
===================================================================
--- vcl/inc/msgbox.hxx.orig	2004-09-12 14:26:21.710971896 +0200
+++ vcl/inc/msgbox.hxx	2004-09-12 14:54:44.826059048 +0200
@@ -118,12 +118,9 @@ protected:
     XubString           maCheckBoxText;
     BOOL                mbCheck;
 
-#ifdef _SV_MSGBOX_CXX
-private:
 	void				ImplInitData();
 	void				ImplInitButtons();
 	void				ImplPosControls();
-#endif
 
 protected:
 	void				ImplLoadRes( const ResId& rResId );
@@ -159,10 +156,8 @@ public:
 
 class InfoBox : public MessBox
 {
-#ifdef _SV_MSGBOX_CXX
 private:
 	void				ImplInitData();
-#endif
 
 public:
 						InfoBox( Window* pParent, const XubString& rMessage );
@@ -177,10 +172,8 @@ public:
 
 class WarningBox : public MessBox
 {
-#ifdef _SV_MSGBOX_CXX
 private:
 	void				ImplInitData();
-#endif
 
 public:
 						WarningBox( Window* pParent, WinBits nStyle,
@@ -198,10 +191,8 @@ public:
 
 class ErrorBox : public MessBox
 {
-#ifdef _SV_MSGBOX_CXX
 private:
 	void				ImplInitData();
-#endif
 
 public:
 						ErrorBox( Window* pParent, WinBits nStyle,
@@ -217,10 +208,8 @@ public:
 
 class QueryBox : public MessBox
 {
-#ifdef _SV_MSGBOX_CXX
 private:
 	void				ImplInitData();
-#endif
 
 public:
 						QueryBox( Window* pParent, WinBits nStyle,
Index: vcl/inc/opengl.hxx
===================================================================
--- vcl/inc/opengl.hxx.orig	2004-09-12 14:26:21.711971744 +0200
+++ vcl/inc/opengl.hxx	2004-09-12 14:54:44.827058896 +0200
@@ -80,22 +80,13 @@ class RmOpenGL;
 class OpenGL
 {
 	static BOOL     mbNoOGL;
-private:
 
+private:
 	OutputDevice*	mpOutDev;
-#ifndef REMOTE_APPSERVER
 	SalOpenGL*		mpOGL;
-#else
-	RmOpenGL*		mpOGL;
-#endif
 
-#if _SOLAR__PRIVATE
-#ifdef _SV_OPENGL_CXX
-private:
 	void			ImplInit();
 	BOOL			ImplInitFncPointers();
-#endif
-#endif // __PRIVATE
 
 public:
 					OpenGL( OutputDevice* pOutDev );
Index: vcl/inc/outdata.hxx
===================================================================
--- vcl/inc/outdata.hxx.orig	2004-09-12 14:26:21.712971592 +0200
+++ vcl/inc/outdata.hxx	2004-09-12 14:54:44.827058896 +0200
@@ -66,8 +66,8 @@
 #include <sv.h>
 #endif
 
-#ifndef _SV_COLOR_HXX
-#include <color.hxx>
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
 #endif
 
 #ifndef _SV_SALGTYPE_HXX
@@ -78,12 +78,10 @@
 // - Hilfemethoden -
 // -----------------
 
-#ifndef REMOTE_APPSERVER
 inline SalColor ImplColorToSal( Color aColor )
 {
 	return MAKE_SALCOLOR( aColor.GetRed(), aColor.GetGreen(), aColor.GetBlue() );
 }
-#endif
 
 inline int ImplIsColorTransparent( Color aColor )
 {
Index: vcl/inc/outdev.h
===================================================================
--- vcl/inc/outdev.h.orig	2004-09-12 14:26:21.713971440 +0200
+++ vcl/inc/outdev.h	2004-09-12 14:54:44.828058744 +0200
@@ -263,7 +263,6 @@ private:
     ImplFontEntry*      mpFirstEntry;
     USHORT              mnRef0Count;
     BOOL                mbPrinter;
-    BOOL                mbDummy;
 
 public:
                         ImplFontCache( BOOL bPrinter );
Index: vcl/inc/outdev.hxx
===================================================================
--- vcl/inc/outdev.hxx.orig	2004-09-12 14:26:21.717970832 +0200
+++ vcl/inc/outdev.hxx	2004-09-12 14:54:44.832058136 +0200
@@ -71,11 +71,11 @@
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
-#ifndef _SV_RC_HXX
-#include <rc.hxx>
+#ifndef _TOOLS_RC_HXX
+#include <tools/rc.hxx>
 #endif
-#ifndef _SV_COLOR_HXX
-#include <color.hxx>
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
 #endif
 #ifndef _SV_FONT_HXX
 #include <font.hxx>
@@ -92,8 +92,8 @@
 #ifndef _SV_SETTINGS_HXX
 #include <settings.hxx>
 #endif
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#ifndef _TL_POLY_HXX
+#include <tools/poly.hxx>
 #endif
 
 #include <vector>
@@ -108,7 +108,6 @@ class ImplGetDevFontList;
 class ImplGetDevSizeList;
 class ImplMultiTextLineInfo;
 class SalGraphics;
-class ImplServerGraphics;
 class Gradient;
 class Hatch;
 class Bitmap;
@@ -147,6 +146,9 @@ typedef std::vector< Rectangle > MetricV
 
 namespace vcl { class PDFWriterImpl; }
 
+#define OUTDEV_BUFFER_SIZE  128
+
+
 // ---------------------
 // - OutputDevice-Data -
 // ---------------------
@@ -196,7 +198,9 @@ struct KerningPair
 #define PUSH_TEXTALIGN                  ((USHORT)0x0100)
 #define PUSH_REFPOINT                   ((USHORT)0x0200)
 #define PUSH_TEXTLINECOLOR              ((USHORT)0x0400)
-#define PUSH_ALLTEXT                    (PUSH_TEXTCOLOR | PUSH_TEXTFILLCOLOR | PUSH_TEXTLINECOLOR | PUSH_TEXTALIGN)
+#define PUSH_TEXTLAYOUTMODE             ((USHORT)0x0800)
+#define PUSH_TEXTLANGUAGE               ((USHORT)0x1000)
+#define PUSH_ALLTEXT                    (PUSH_TEXTCOLOR | PUSH_TEXTFILLCOLOR | PUSH_TEXTLINECOLOR | PUSH_TEXTALIGN | PUSH_TEXTLAYOUTMODE | PUSH_TEXTLANGUAGE)
 #define PUSH_ALLFONT                    (PUSH_ALLTEXT | PUSH_FONT)
 #define PUSH_ALL                        ((USHORT)0xFFFF)
 
@@ -224,10 +228,11 @@ struct KerningPair
 #define IMAGE_DRAW_DISABLE              ((USHORT)0x0001)
 #define IMAGE_DRAW_HIGHLIGHT            ((USHORT)0x0002)
 #define IMAGE_DRAW_DEACTIVE             ((USHORT)0x0004)
-#define IMAGE_DRAW_COLORTRANSFORM       ((USHORT)0x0008)
+#define IMAGE_DRAW_COLORTRANSFORM      	((USHORT)0x0008)
 #define IMAGE_DRAW_SEMITRANSPARENT      ((USHORT)0x0010)
+#define IMAGE_DRAW_MONOCHROME_BLACK  	((USHORT)0x0020)
+#define IMAGE_DRAW_MONOCHROME_WHITE  	((USHORT)0x0040)
 #define IMAGE_DRAW_3DLOOK               0
-
 #define IMAGE_DRAW_BTNLOOK              0
 
 // WaveLine
@@ -327,20 +332,24 @@ enum OutDevViewType { OUTDEV_VIEWTYPE_DO
 
 class OutputDevice : public Resource
 {
-    friend class Window;
-    friend class VirtualDevice;
-    friend class Printer;
-    friend class ImplQPrinter;
-    friend class OpenGL;
-    friend class ::vcl::PDFWriterImpl;
-    friend class SalGraphicsLayout;
+	friend class Application;
+	friend class Bitmap;
+	friend class ImplImageBmp;
+	friend class ImplQPrinter;
+	friend class OpenGL;
+	friend class Printer;
+	friend class RMBitmap;
+	friend class RMBitmapEx;
+	friend class SalGraphicsLayout;
+	friend class System;
+	friend class VirtualDevice;
+	friend class Window;
+	friend class WorkWindow;
+	friend class vcl::PDFWriterImpl;
+	friend const char* ImplDbgCheckOutputDevice( const void* pObj );
 
 private:
-#ifndef REMOTE_APPSERVER
     mutable SalGraphics*        mpGraphics;
-#else
-    mutable ImplServerGraphics* mpGraphics;
-#endif
     mutable OutputDevice*       mpPrevGraphics;
     mutable OutputDevice*       mpNextGraphics;
     GDIMetaFile*        mpMetaFile;
@@ -354,7 +363,10 @@ private:
     List*               mpUnoGraphicsList;
     OutDev3D*           mp3DContext;
     vcl::PDFWriterImpl* mpPDFWriter;
-    void*               mpDummy1;
+
+    // TEMP TEMP TEMP
+    VirtualDevice*      mpAlphaVDev;
+
     /// Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset)
     long				mnOutOffOrigX;
     /// Additional output offset in _logical_ coordinates, applied in PixelToLogic (used by SetPixelOffset/GetPixelOffset)
@@ -369,8 +381,8 @@ private:
     long                mnOutOffY;
     long                mnOutWidth;
     long                mnOutHeight;
-    long                mnDPIX;
-    long                mnDPIY;
+    sal_Int32           mnDPIX;
+    sal_Int32           mnDPIY;
     /// Output offset for text alignment in pixel
     long                mnTextOffX;
     /// Output offset for text alignment in pixel
@@ -379,7 +391,6 @@ private:
     long                mnEmphasisDescent;
     ULONG               mnDrawMode;
     ULONG               mnTextLayoutMode;
-    long                mnDummy1;
     ImplMapRes          maMapRes;
     ImplThresholdRes    maThresRes;
     OutDevType          meOutDevType;
@@ -389,7 +400,6 @@ private:
     Color               maFillColor;
     Font                maFont;
     Color               maTextColor;
-    Color               maTextFillColorDummy; // For compatibility to SV we work with the font fill color
     Color               maTextLineColor;
     TextAlign           meTextAlign;
     RasterOp            meRasterOp;
@@ -399,8 +409,6 @@ private:
     Point               maRefPoint;
     USHORT              mnAntialiasing;
     LanguageType        meTextLanguage;
-    USHORT              mnDummy3;
-    USHORT              mnDummy4;
     mutable BOOL       mbMap:1,
                         mbMapIsDefault:1,
                         mbClipRegion:1,
@@ -421,12 +429,121 @@ private:
                         mbTextLines:1,
                         mbTextSpecial:1,
                         mbRefPoint:1,
-                        mbEnableRTL:1,
-                        mbDummy2:1,
-                        mbDummy3:1;
+                        mbEnableRTL:1;
 
 #if _SOLAR__PRIVATE
-#include <outdev.imp>
+public:
+	sal_Int32			ImplGetDPIX() const { return mnDPIX; }
+	sal_Int32			ImplGetDPIY() const { return mnDPIY; }
+	int 				ImplGetGraphics() const;
+	void				ImplReleaseGraphics( BOOL bRelease = TRUE );
+    BOOL                ImplHasMirroredGraphics();
+    void                ImplReMirror( Point &rPoint ) const;
+    void                ImplReMirror( Rectangle &rRect ) const;
+    void                ImplReMirror( Region &rRegion ) const;
+	void				ImplInitOutDevData();
+	void				ImplDeInitOutDevData();
+	void				ImplInitLineColor();
+	void				ImplInitFillColor();
+	int 				ImplNewFont();
+	void				ImplInitFont();
+	void				ImplInitTextColor();
+	void				ImplInitKerningPairs( ImplKernPairData* pKernPairs = 0, long nKernPairs = 0 );
+	void				ImplInitClipRegion();
+	static BOOL 		ImplSelectClipRegion( SalGraphics* pGraphics, const Region& rRegion, OutputDevice *pOutDev );
+	void				ImplSetClipRegion( const Region* pRegion );
+
+    SalLayout*          ImplLayout( const String& rOrigStr, xub_StrLen nIndex,
+                            xub_StrLen nLen, const Point& rLogicPos = Point(0,0),
+                            long nLogicWidth=0, const sal_Int32* pLogicDXArray=NULL ) const;
+    long                ImplGetTextWidth( const SalLayout& ) const;
+    void                ImplDrawTextBackground( const SalLayout& );
+    void                ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontUnderline eUnderline, BOOL bWordLine, BOOL bUnderlineAbove );
+    bool                ImplDrawRotateText( SalLayout& );
+    void                ImplDrawTextDirect( SalLayout&, BOOL bTextLines );
+    void                ImplDrawSpecialText( SalLayout& );
+    void                ImplDrawText( SalLayout& );
+    Rectangle           ImplGetTextBoundRect( const SalLayout& );
+	void				ImplDrawEmphasisMarks( SalLayout& );
+
+    void				ImplDrawTextRect( long nBaseX, long nBaseY, long nX, long nY, long nWidth, long nHeight );
+
+	void				ImplInitTextLineSize();
+	void				ImplInitAboveTextLineSize();
+	void				ImplDrawWaveLine( long nBaseX, long nBaseY, long nStartX, long nStartY, long nWidth, long nHeight, long nLineWidth, short nOrientation, const Color& rColor );
+    void                ImplDrawTextLine( long nBaseX, long nX, long nY, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, BOOL bUnderlineAbove );
+	void				ImplDrawMnemonicLine( long nX, long nY, long nWidth );
+    void				ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine, Rectangle& rRect1, Rectangle& rRect2, long& rYOff, long& rWidth, FontEmphasisMark eEmphasis, long nHeight, short nOrient );
+	void				ImplDrawEmphasisMark( long nBaseX, long nX, long nY, const PolyPolygon& rPolyPoly, BOOL bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
+	long				ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const XubString& rStr, USHORT nStyle ) const;
+    void				ImplInitFontList() const;
+	void				ImplUpdateFontData( BOOL bNewFontLists );
+	static void 		ImplUpdateAllFontData( BOOL bNewFontLists );
+	long				ImplLogicXToDevicePixel( long nX ) const;
+	long				ImplLogicYToDevicePixel( long nY ) const;
+	long				ImplLogicWidthToDevicePixel( long nWidth ) const;
+	long				ImplLogicHeightToDevicePixel( long nHeight ) const;
+	long				ImplDevicePixelToLogicWidth( long nWidth ) const;
+	long				ImplDevicePixelToLogicHeight( long nHeight ) const;
+	Point				ImplLogicToDevicePixel( const Point& rLogicPt ) const;
+	Size				ImplLogicToDevicePixel( const Size& rLogicSize ) const;
+	Rectangle			ImplLogicToDevicePixel( const Rectangle& rLogicRect ) const;
+	Polygon 			ImplLogicToDevicePixel( const Polygon& rLogicPoly ) const;
+	PolyPolygon 		ImplLogicToDevicePixel( const PolyPolygon& rLogicPolyPoly ) const;
+	LineInfo			ImplLogicToDevicePixel( const LineInfo& rLineInfo ) const;
+	Rectangle			ImplDevicePixelToLogic( const Rectangle& rLogicRect ) const;
+	Region				ImplPixelToDevicePixel( const Region& rRegion ) const;
+	void				ImplDrawPolygon( const Polygon& rPoly, const PolyPolygon* pClipPolyPoly = NULL );
+	void				ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const PolyPolygon* pClipPolyPoly = NULL );
+	void 				ImplDrawPolyPolygon( USHORT nPoly, const PolyPolygon& rPolyPoly );
+	void				ImplDrawLinearGradient( const Rectangle& rRect, const Gradient& rGradient, BOOL bMtf, const PolyPolygon* pClipPolyPoly );
+	void				ImplDrawComplexGradient( const Rectangle& rRect, const Gradient& rGradient, BOOL bMtf, const PolyPolygon* pClipPolyPoly );
+
+	void				ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, BOOL bMtf );
+	void				ImplCalcHatchValues( const Rectangle& rRect, long nDist, USHORT nAngle10, Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 );
+	void				ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPolyPoly, Point* pPtBuffer, BOOL bMtf );
+
+	void				ImplDrawWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+	void				ImplDrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+	void				ImplDrawBitmapWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+	void				ImplDrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+	void				ImplDraw2ColorFrame( const Rectangle& rRect, const Color& rLeftTopColor, const Color& rRightBottomColor );
+
+	void				ImplDrawOutDevDirect( const OutputDevice* pSrcDev, void* pPosAry );
+	void				ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
+										const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+										const Bitmap& rBitmap, const ULONG nAction );
+	void				ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
+										  const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+										  const BitmapEx& rBitmapEx, const ULONG nAction );
+	void				ImplDrawMask( const Point& rDestPt, const Size& rDestSize,
+									  const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+									  const Bitmap& rBitmap, const Color& rMaskColor,
+									  const ULONG nAction );
+	void				ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
+									   const Point& rDestPt, const Size& rDestSize,
+									   const Point& rSrcPtPixel, const Size& rSrcSizePixel );
+	void				ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask,
+											  const Point& rDestPt, const Size& rDestSize,
+											  const Point& rSrcPtPixel, const Size& rSrcSizePixel );
+	void				ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
+									   const Point& rDestPt, const Size& rDestSize,
+									   const Point& rSrcPtPixel, const Size& rSrcSizePixel );
+	void				ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize,
+										  const OutputDevice& rOutDev, const Region& rRegion );
+	void				ImplGetFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize,
+										 OutputDevice& rOutDev );
+	void				ImplGetFrameBitmap( const Point& rPt, const Size& rSize,
+											Bitmap& rBitmap ) const;
+
+    BOOL				ImplIsRecordLayout() const;
+
+    void         		ImplAddDevFontSubstitute( const XubString& rFontName,
+                                                  const XubString& rReplaceFontName,
+                                                  USHORT nFlags = 0 );
+
+    static FontEmphasisMark ImplGetEmphasisMarkStyle( const Font& rFont );
+    static BOOL ImplIsUnderlineAbove( const Font& );
 #endif
 
 protected:
@@ -459,15 +576,15 @@ public:
                                       xub_StrLen nLen = STRING_LEN ) const;
     long                GetTextHeight() const;
     void                DrawTextArray( const Point& rStartPt, const XubString& rStr,
-                                       const long* pDXAry = NULL,
+                                       const sal_Int32* pDXAry = NULL,
                                        xub_StrLen nIndex = 0,
                                        xub_StrLen nLen = STRING_LEN );
-    long                GetTextArray( const XubString& rStr, long* pDXAry = NULL,
+    long                GetTextArray( const XubString& rStr, sal_Int32* pDXAry = NULL,
                                       xub_StrLen nIndex = 0,
                                       xub_StrLen nLen = STRING_LEN ) const;
-    bool                GetCaretPositions( const XubString&, long* pCaretXArray,
+    bool                GetCaretPositions( const XubString&, sal_Int32* pCaretXArray,
                                       xub_StrLen nIndex, xub_StrLen nLen,
-                                      long* pDXAry = NULL, long nWidth = 0,
+                                      sal_Int32* pDXAry = NULL, long nWidth = 0,
                                       BOOL bCellBreaking = TRUE ) const;
     void                DrawStretchText( const Point& rStartPt, ULONG nWidth,
                                          const XubString& rStr,
@@ -505,10 +622,10 @@ public:
                             xub_StrLen nLen = STRING_LEN ) const;
     BOOL                GetTextOutline( PolyPolygon&,
                             const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
-                            xub_StrLen nLen = STRING_LEN, BOOL bOptimize = TRUE, const ULONG nWidth = 0, const long* pDXArray = NULL ) const;
+                            xub_StrLen nLen = STRING_LEN, BOOL bOptimize = TRUE, const ULONG nWidth = 0, const sal_Int32* pDXArray = NULL ) const;
     BOOL                GetTextOutlines( PolyPolyVector&,
                             const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
-                            xub_StrLen nLen = STRING_LEN, BOOL bOptimize = TRUE, const ULONG nWidth = 0, const long* pDXArray = NULL ) const;
+                            xub_StrLen nLen = STRING_LEN, BOOL bOptimize = TRUE, const ULONG nWidth = 0, const sal_Int32* pDXArray = NULL ) const;
     BOOL				GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex,
                             int nLen, int nBase, MetricVector& rVector );
 
@@ -526,10 +643,52 @@ public:
     void                DrawLine( const Point& rStartPt, const Point& rEndPt );
     void                DrawLine( const Point& rStartPt, const Point& rEndPt,
                                   const LineInfo& rLineInfo );
+
+    /** Render the given polygon as a line stroke
+
+		The given polygon is stroked with the current LineColor, start
+		and end point are not automatically connected
+
+        @see DrawPolygon
+        @see DrawPolyPolygon
+     */
     void                DrawPolyLine( const Polygon& rPoly );
+
+    /** Render the given polygon as a line stroke
+
+		The given polygon is stroked with the current LineColor, start
+		and end point are not automatically connected. The line is
+		rendered according to the specified LineInfo, e.g. supplying a
+		dash pattern, or a line thickness.
+
+        @see DrawPolygon
+        @see DrawPolyPolygon
+     */
     void                DrawPolyLine( const Polygon& rPoly,
                                       const LineInfo& rLineInfo );
+
+    /** Render the given polygon
+
+		The given polygon is stroked with the current LineColor, and
+		filled with the current FillColor. If one of these colors are
+		transparent, the corresponding stroke or fill stays
+		invisible. Start and end point of the polygon are
+		automatically connected.
+
+        @see DrawPolyLine
+     */
     void                DrawPolygon( const Polygon& rPoly );
+
+    /** Render the given poly-polygon
+
+		The given poly-polygon is stroked with the current LineColor,
+		and filled with the current FillColor. If one of these colors
+		are transparent, the corresponding stroke or fill stays
+		invisible. Start and end points of the contained polygons are
+		automatically connected.
+
+        @see DrawPolyLine
+     */
     void                DrawPolyPolygon( const PolyPolygon& rPolyPoly );
     void                DrawRect( const Rectangle& rRect );
     void                DrawRect( const Rectangle& rRect,
@@ -606,17 +765,21 @@ public:
 
     Bitmap              GetBitmap( const Point& rSrcPt, const Size& rSize ) const;
 
-    void                EnableMapMode( BOOL bEnable = TRUE ) { mbMap = (bEnable != 0); }
+    /** Query extended bitmap (with alpha channel, if available).
+     */
+    BitmapEx            GetBitmapEx( const Point& rSrcPt, const Size& rSize ) const;
+
+    void                EnableMapMode( BOOL bEnable = TRUE );
     BOOL                IsMapModeEnabled() const { return mbMap; }
 
     // Enabling/disabling RTL only makes sense for OutputDevices that use a mirroring SalGraphisLayout
     void                EnableRTL( BOOL bEnable = TRUE);
     BOOL                IsRTLEnabled() const { return mbEnableRTL; }
 
-    void                SetConnectMetaFile( GDIMetaFile* pMtf ) { mpMetaFile = pMtf; }
+    void                SetConnectMetaFile( GDIMetaFile* pMtf );
     GDIMetaFile*        GetConnectMetaFile() const { return mpMetaFile; }
 
-    void                EnableOutput( BOOL bEnable = TRUE ) { mbOutput = (bEnable != 0); }
+    void                EnableOutput( BOOL bEnable = TRUE );
     BOOL                IsOutputEnabled() const { return mbOutput; }
     BOOL                IsDeviceOutput() const { return mbDevOutput; }
     BOOL                IsDeviceOutputNecessary() const { return (mbOutput && mbDevOutput); }
@@ -676,7 +839,7 @@ public:
     void                SetFont( const Font& rNewFont );
     const Font&         GetFont() const { return maFont; }
     void                SetTextColor( const Color& rColor );
-    const Color&        GetTextColor() const { return maFont.GetColor(); }
+    const Color&        GetTextColor() const { return maTextColor; }
     void                SetTextFillColor();
     void                SetTextFillColor( const Color& rColor );
 
@@ -689,7 +852,7 @@ public:
     void                SetTextAlign( TextAlign eAlign );
     TextAlign           GetTextAlign() const { return maFont.GetAlign(); }
 
-    void                SetSettings( const AllSettings& rSettings ) { maSettings = rSettings; }
+    void                SetSettings( const AllSettings& rSettings );
     const AllSettings&  GetSettings() const { return maSettings; }
 
 #ifndef NOOLDSV
@@ -811,6 +974,11 @@ public:
 
     Size                GetOutputSizePixel() const
                             { return Size( mnOutWidth, mnOutHeight ); }
+    long				GetOutputWidthPixel() const { return mnOutWidth; }
+    long				GetOutputHeightPixel() const { return mnOutHeight; }
+    long				GetOutOffXPixel() const { return mnOutOffX; }
+    long				GetOutOffYPixel() const { return mnOutOffY; }
+    
     Size                GetOutputSize() const
                             { return PixelToLogic( GetOutputSizePixel() ); }
 
@@ -836,11 +1004,24 @@ public:
 #endif
 
     USHORT              GetBitCount() const;
+
+    /** Query the existence and depth of the alpha channel
+
+    	@return 0, if no alpha channel available, and the bit depth of
+    	the alpha channel otherwise.
+     */
+    USHORT              GetAlphaBitCount() const;
     ULONG               GetColorCount() const;
 
     void                Push( USHORT nFlags = PUSH_ALL );
     void                Pop();
 
+    /** Query availability of alpha channel
+
+    	@return TRUE, if this device has an alpha channel.
+     */
+    BOOL				HasAlpha();
+    
     void                DrawEPS( const Point& rPt, const Size& rSz,
                                  const GfxLink& rGfxLink, GDIMetaFile* pSubst = NULL );
 
Index: vcl/inc/pdfwriter.hxx
===================================================================
--- vcl/inc/pdfwriter.hxx.orig	2004-09-12 14:26:21.718970680 +0200
+++ vcl/inc/pdfwriter.hxx	2004-09-12 14:54:44.833057984 +0200
@@ -73,7 +73,7 @@
 #ifndef _STRING_HXX
 #include <tools/string.hxx>
 #endif
-#ifndef _COLOR_HXX
+#ifndef _TOOLS_COLOR_HXX
 #include <tools/color.hxx>
 #endif
 
@@ -191,7 +191,7 @@ public:
                                       FontUnderline eUnderline,
                                       BOOL bUnderlineAbove = FALSE );
     void				DrawTextArray( const Point& rStartPt, const XubString& rStr,
-                                       const long* pDXAry = NULL,
+                                       const sal_Int32* pDXAry = NULL,
                                        xub_StrLen nIndex = 0,
                                        xub_StrLen nLen = STRING_LEN );
     void				DrawStretchText( const Point& rStartPt, ULONG nWidth,
Index: vcl/inc/pngread.hxx
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ vcl/inc/pngread.hxx	2004-09-12 14:54:44.833057984 +0200
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ *  
+ *
+ *  
+ *
+ *  
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_PNGREAD_HXX
+#define _SV_PNGREAD_HXX
+
+#ifndef _SV_BITMAPEX_HXX
+#include <bitmapex.hxx>
+#endif
+#include <vector>
+
+// -------------
+// - PNGReader -
+// -------------
+
+namespace vcl
+{
+	class PNGReaderImpl;
+
+	class PNGReader
+	{
+		PNGReaderImpl*			mpImpl;
+
+	public:
+
+		/* the PNG chunks are read within the c'tor, so the stream will
+		be positioned at the end of the PNG */
+		PNGReader( SvStream& rStm );
+		~PNGReader();
+	
+		BitmapEx						Read();
+
+		// retrieve every chunk that resides inside the PNG
+		struct ChunkData
+		{
+			sal_uInt32					nType;
+			std::vector< sal_uInt8 >	aData;
+		};
+		const std::vector< ChunkData >&	GetChunks() const;
+	};
+}
+
+#endif // _SV_PNGREAD_HXX
Index: vcl/inc/pngwrite.hxx
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ vcl/inc/pngwrite.hxx	2004-09-12 14:54:44.834057832 +0200
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ *  
+ *
+ *  
+ *
+ *  
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_PNGWRITE_HXX
+#define _SV_PNGWRITE_HXX
+
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
+#include <com/sun/star/uno/Sequence.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _SV_BITMAPEX_HXX
+#include <bitmapex.hxx>
+#endif
+#include <vector>
+
+// -------------
+// - PNGWriter -
+// -------------
+
+namespace vcl
+{
+	class PNGWriterImpl;
+
+	class PNGWriter
+	{
+		PNGWriterImpl*			mpImpl;
+
+	public:
+
+		PNGWriter( const BitmapEx& BmpEx,
+			const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData = NULL );
+		~PNGWriter();
+
+		sal_Bool Write( SvStream& rStm );
+
+		// additional method to be able to modify all chunk before they are stored
+		struct ChunkData
+		{
+			sal_uInt32					nType;
+			std::vector< sal_uInt8 >	aData;
+		};
+		std::vector< ChunkData >& GetChunks();
+	};
+}
+
+#endif // _SV_PNGWRITE_HXX
Index: vcl/inc/print.hxx
===================================================================
--- vcl/inc/print.hxx.orig	2004-09-12 14:26:21.721970224 +0200
+++ vcl/inc/print.hxx	2004-09-12 14:54:44.835057680 +0200
@@ -85,12 +85,9 @@
 #include <tools/stream.hxx>
 #endif
 
-#if defined REMOTE_APPSERVER
-#include <vector>
-#endif
-
 struct SalPrinterInfoQueue;
 class SalInfoPrinter;
+struct SalPrinterQueueInfo;
 class SalPrinter;
 class VirtualDevice;
 class Window;
@@ -101,10 +98,6 @@ namespace com { namespace sun { namespac
 	class Any;
 } } } }
 
-#ifdef REMOTE_APPSERVER
-namespace com { namespace sun { namespace star { namespace portal { namespace client { struct RmJobSetup; } } } } }
-#endif
-
 // -----------------
 // - Printer-Types -
 // -----------------
@@ -268,29 +261,17 @@ class Printer : public OutputDevice
 	friend class ImplQPrinter;
 
 private:
-#ifndef REMOTE_APPSERVER
+	void*						mpPrinterData_NotUsedYet;
 	SalInfoPrinter* 			mpInfoPrinter;
 	SalPrinter* 				mpPrinter;
 	Printer*					mpJobPrinter;
 	SalGraphics*				mpJobGraphics;
-#else
-	RmPrinter*					mpInfoPrinter;
-	RmPrinter*					mpPrinter;
-	void*						mpJobPrinter;
-	void*						mpJobGraphics;
-#endif
 	Printer*					mpPrev;
 	Printer*					mpNext;
 	VirtualDevice*				mpDisplayDev;
 	ImplQPrinter*				mpQPrinter;
 	GDIMetaFile*				mpQMtf;
     PrinterOptions*             mpPrinterOptions;
-#ifndef REMOTE_APPSERVER
-	void*						mpDummy2;
-#else
-    ::std::vector< PrinterPage* >* mpRemotePages;
-#endif
-	void*						mpDummy3;
 	XubString					maPrinterName;
 	XubString					maDriver;
 	XubString					maPrintFile;
@@ -313,18 +294,11 @@ private:
 	BOOL						mbIsQueuePrinter;
 	BOOL						mbUserSetupCompleted;
 	BOOL						mbUserSetupResult;
-	BOOL						mbDummy3;
 	Link						maErrorHdl;
 	Link						maStartPrintHdl;
 	Link						maEndPrintHdl;
 	Link						maPrintPageHdl;
 
-#ifdef REMOTE_APPSERVER
-	DECL_LINK( UserSetupCompleted, ::com::sun::star::uno::Any* );
-#endif
-
-#if _SOLAR__PRIVATE
-#ifdef _SV_PRINT_CXX
 	void						ImplInitData();
 	void						ImplInit( SalPrinterQueueInfo* pInfo );
 	void						ImplInitDisplay( const Window* pWindow );
@@ -333,19 +307,11 @@ private:
 	void						ImplUpdatePageData();
 	void						ImplUpdateFontList();
 	void						ImplFindPaperFormatForUserSize( JobSetup& );
-#endif // _SV_PRINT_CXX
-#ifndef REMOTE_APPSERVER
-
 								DECL_LINK( ImplDestroyPrinterAsync, void* );
+#if _SOLAR__PRIVATE
 public:
-
 	void						ImplEndPrint();
-#else
-public:
-    void PrintRemotePage( ULONG nPage );
-    void GetRemotePageSetup( ULONG nPage, ::com::sun::star::portal::client::RmJobSetup& rSetup );
-#endif // REMOTE_APPSERVER
-#endif // __PRIVATE
+#endif
 
 #ifdef _SPOOLPRINTER_EXT
 public:
Index: vcl/inc/regband.hxx
===================================================================
--- vcl/inc/regband.hxx.orig	2004-09-12 14:26:21.722970072 +0200
+++ vcl/inc/regband.hxx	2004-09-12 14:54:44.836057528 +0200
@@ -65,8 +65,8 @@
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#ifndef _TL_POLY_HXX
+#include <tools/poly.hxx>
 #endif
 
 /* =======================================================================
Index: vcl/inc/region.h
===================================================================
--- vcl/inc/region.h.orig	2004-09-12 14:26:21.722970072 +0200
+++ vcl/inc/region.h	2004-09-12 14:54:44.836057528 +0200
@@ -68,8 +68,8 @@
 #ifndef _SV_REGBAND_HXX
 #include <regband.hxx>
 #endif
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#ifndef _TL_POLY_HXX
+#include <tools/poly.hxx>
 #endif
 
 #ifndef _SV_REGION_HXX
Index: vcl/inc/region.hxx
===================================================================
--- vcl/inc/region.hxx.orig	2004-09-12 14:26:21.728969160 +0200
+++ vcl/inc/region.hxx	2004-09-12 14:54:44.837057376 +0200
@@ -91,11 +91,30 @@ typedef long RegionHandle;
 
 class Region
 {
+	friend class OutputDevice;
+	friend class Window;
+	friend class Bitmap;
+
 private:
-	ImplRegion* 	mpImplRegion;
+	ImplRegion* 		mpImplRegion;
+
+	void				ImplCopyData();
+	void				ImplCreateRectRegion( const Rectangle& rRect );
+	void				ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly );
+	void				ImplPolyPolyRegionToBandRegionFunc();
+	inline void 		ImplPolyPolyRegionToBandRegion();
+	const ImplRegion*	ImplGetImplRegion() const { return mpImplRegion; }
+	ImplRegion* 		ImplGetImplRegion() { return mpImplRegion; }
+	BOOL				ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
+										  long& nX, long& nY, long& nWidth, long& nHeight ) const;
+	BOOL				ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
+										 long& nX, long& nY, long& nWidth, long& nHeight ) const;
+	void				ImplBeginAddRect( );
+	BOOL				ImplAddRect( const Rectangle& rRect );
+	void				ImplEndAddRect( );
 
-#if _SOLAR__PRIVATE
-#include <region.imp>
+#ifdef DBG_UTIL
+	friend const char*	ImplDbgTestRegion( const void* pObj );
 #endif
 
 public:
@@ -150,9 +169,6 @@ public:
 
 	friend SvStream& operator>>( SvStream& rIStm, Region& rRegion );
 	friend SvStream& operator<<( SvStream& rOStm, const Region& rRegion );
-
-	// usage of this function is only intended for the remote client
-	RegionOverlapType  GetOverlapType( const Rectangle& rRect ) const;
 };
 
 #endif	// _SV_REGION_HXX
Index: vcl/inc/salbmp.hxx
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ vcl/inc/salbmp.hxx	2004-09-12 14:54:44.838057224 +0200
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ *  
+ *
+ *  
+ *
+ *  
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALBMP_HXX
+#define _SV_SALBMP_HXX
+
+#ifndef _TL_GEN_HXX
+#include <tools/gen.hxx>
+#endif
+
+struct BitmapBuffer;
+class SalGraphics;
+class BitmapPalette;
+
+class SalBitmap
+{
+public:
+    SalBitmap() {}
+    virtual ~SalBitmap();
+    
+    virtual bool			Create( const Size& rSize, 
+                                    USHORT nBitCount, 
+                                    const BitmapPalette& rPal ) = 0;
+	virtual bool			Create( const SalBitmap& rSalBmp ) = 0;
+	virtual bool			Create( const SalBitmap& rSalBmp, 
+                                    SalGraphics* pGraphics ) = 0;
+	virtual bool			Create( const SalBitmap& rSalBmp,
+                                    USHORT nNewBitCount ) = 0;
+	virtual void			Destroy() = 0;
+	virtual Size			GetSize() const = 0;
+	virtual USHORT			GetBitCount() const = 0;
+						
+	virtual BitmapBuffer*	AcquireBuffer( bool bReadOnly ) = 0;
+	virtual void			ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ) = 0;
+
+};
+
+#endif
Index: vcl/inc/salctrlhandle.hxx
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ vcl/inc/salctrlhandle.hxx	2004-09-12 14:54:44.838057224 +0200
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ *  
+ *
+ *  
+ *
+ *  
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALCTRLHANDLE_HXX
+#define _SV_SALCTRLHANDLE_HXX
+
+/* SalControlHandle:
+ *
+ *   Container for platform-specific handles and data
+ *   about controls.  Lives as long as the VCL control
+ *   lives.
+ */
+
+class SalControlHandle
+{
+	public:
+		SalControlHandle() {}
+		virtual ~SalControlHandle();
+
+        // TODO: derive Sal implementation
+		//SalControlHandleData	maData;
+};
+
+#endif
Index: vcl/inc/salframe.hxx
===================================================================
--- vcl/inc/salframe.hxx.orig	2004-09-12 14:26:21.732968552 +0200
+++ vcl/inc/salframe.hxx	2004-09-12 14:54:44.839057072 +0200
@@ -80,9 +80,6 @@
 #ifndef _SV_SALWTYPE_HXX
 #include <salwtype.hxx>
 #endif
-#ifndef _SV_SALFRAME_H
-#include <salframe.h>
-#endif
 #ifndef _SV_SALGEOM_HXX
 #include <salgeom.hxx>
 #endif
@@ -91,11 +88,20 @@
 #include <tools/gen.hxx>
 #endif
 
+#ifndef _SV_REGION_HXX
+#include <region.hxx>
+#endif
+
+#ifndef _RTL_USTRING_HXX_
+#include <rtl/ustring.hxx>
+#endif
+
 #ifdef __cplusplus
 
 class AllSettings;
 class SalGraphics;
 class SalBitmap;
+class SalMenu;
 
 #else
 
@@ -160,112 +166,119 @@ struct SystemEnvData;
 
 #ifdef __cplusplus
 
+using namespace rtl;
+
 // ------------
 // - SalFrame -
 // ------------
 
+struct SystemParentData;
+
 class SalFrame
 {
-    friend class SalInstance;
-
+    void*					m_pInst;
+    SALFRAMEPROC			m_pProc;
 public:                     // public for Sal Implementation
-                            SalFrame();
-                            ~SalFrame();
+    SalFrame() : m_pInst( NULL ), m_pProc( NULL ) {}
+    virtual ~SalFrame();
 
 public:                     // public for Sal Implementation
-    SalFrameData            maFrameData;
     SalFrameGeometry		maGeometry;
-    static BOOL             mbInReparent;
-
-#ifdef _INCL_SAL_SALFRAME_IMP
-#include <salframe.imp>
-#endif
 
 public:
     // SalGraphics or NULL, but two Graphics for all SalFrames
     // must be returned
-    SalGraphics*            GetGraphics();
-    void                    ReleaseGraphics( SalGraphics* pGraphics );
+    virtual SalGraphics*		GetGraphics() = 0;
+    virtual void				ReleaseGraphics( SalGraphics* pGraphics ) = 0;
 
     // Event must be destroyed, when Frame is destroyed
     // When Event is called, SalInstance::Yield() must be returned
-    BOOL                    PostEvent( void* pData );
+    virtual BOOL				PostEvent( void* pData ) = 0;
 
-    void                    SetTitle( const XubString& rTitle );
-    void                    SetIcon( USHORT nIcon );
-
-                            // Befor the window is visible, a resize event
-                            // must be sent with the correct size
-    void                    Show( BOOL bVisible, BOOL bNoActivate = FALSE );
-    void                    Enable( BOOL bEnable );
-                            // Set ClientSize and Center the Window to the desktop
-                            // and send/post a resize message
-    void                    SetMinClientSize( long nWidth, long nHeight );
-    void                    SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
-    void                    GetClientSize( long& rWidth, long& rHeight );
-    void                    GetWorkArea( Rectangle& rRect );
-    SalFrame*               GetParent() const;
+    virtual void				SetTitle( const XubString& rTitle ) = 0;
+    virtual void				SetIcon( USHORT nIcon ) = 0;
+    virtual void                    SetMenu( SalMenu *pSalMenu ) = 0;
+    virtual void                    DrawMenuBar() = 0;
+
+    // Before the window is visible, a resize event
+    // must be sent with the correct size
+    virtual void				Show( BOOL bVisible, BOOL bNoActivate = FALSE ) = 0;
+    virtual void				Enable( BOOL bEnable ) = 0;
+    // Set ClientSize and Center the Window to the desktop
+    // and send/post a resize message
+    virtual void              SetMinClientSize( long nWidth, long nHeight ) = 0;
+    virtual void				SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags ) = 0;
+    virtual void				GetClientSize( long& rWidth, long& rHeight ) = 0;
+    virtual void				GetWorkArea( Rectangle& rRect ) = 0;
+    virtual SalFrame*			GetParent() const = 0;
     // Note: x will be mirrored at parent if UI mirroring is active
-    SalFrameGeometry        GetGeometry();
-    const SalFrameGeometry& GetUnmirroredGeometry() const { return maGeometry; }
-    void                    SetWindowState( const SalFrameState* pState );
-    BOOL                    GetWindowState( SalFrameState* pState );
-    void                    ShowFullScreen( BOOL bFullScreen );
-                            // Enable/Disable ScreenSaver, SystemAgents, ...
-    void                    StartPresentation( BOOL bStart );
-                            // Show Window over all other Windows
-    void                    SetAlwaysOnTop( BOOL bOnTop );
-
-                            // Window to top and grab focus
-    void                    ToTop( USHORT nFlags );
-
-                            // this function can call with the same
-                            // pointer style
-    void                    SetPointer( PointerStyle ePointerStyle );
-    void                    CaptureMouse( BOOL bMouse );
-    void                    SetPointerPos( long nX, long nY );
-
-                            // Alle noch anstehenden Ausgaben sofort
-                            // durchfuehren
-    void                    Flush();
-                            // Dummy-Syncronen Aufruf zum Client/Display
-                            // machen, damit man sicher sein kann, das
-                            // Ausgaben nicht den Client/das Display
-                            // ueberrennen
-    void                    Sync();
-
-    void                    SetInputContext( SalInputContext* pContext );
-    void                    EndExtTextInput( USHORT nFlags );
-
-    XubString               GetKeyName( USHORT nKeyCode );
-    XubString               GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
-
-                            // returns the input language used for the last key stroke
-                            // may be LANGUAGE_DONTKNOW if not supported by the OS
-    LanguageType            GetInputLanguage();
-
-    SalBitmap*              SnapShot();
+    SalFrameGeometry			GetGeometry();
+    const SalFrameGeometry&		GetUnmirroredGeometry() const { return maGeometry; }
+    virtual void				SetWindowState( const SalFrameState* pState ) = 0;
+    virtual BOOL				GetWindowState( SalFrameState* pState ) = 0;
+    virtual void				ShowFullScreen( BOOL bFullScreen ) = 0;
+    // Enable/Disable ScreenSaver, SystemAgents, ...
+    virtual void				StartPresentation( BOOL bStart ) = 0;
+    // Show Window over all other Windows
+    virtual void				SetAlwaysOnTop( BOOL bOnTop ) = 0;
+
+    // Window to top and grab focus
+    virtual void				ToTop( USHORT nFlags ) = 0;
+
+    // this function can call with the same
+    // pointer style
+    virtual void				SetPointer( PointerStyle ePointerStyle ) = 0;
+    virtual void				CaptureMouse( BOOL bMouse ) = 0;
+    virtual void				SetPointerPos( long nX, long nY ) = 0;
+
+    // flush output buffer
+    virtual void				Flush() = 0;
+    // flush output buffer, wait till outstanding operations are done
+    virtual void				Sync() = 0;
+
+    virtual void				SetInputContext( SalInputContext* pContext ) = 0;
+    virtual void				EndExtTextInput( USHORT nFlags ) = 0;
+
+    virtual String				GetKeyName( USHORT nKeyCode ) = 0;
+    virtual String				GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode ) = 0;
+
+    // returns the input language used for the last key stroke
+    // may be LANGUAGE_DONTKNOW if not supported by the OS
+    virtual LanguageType		GetInputLanguage() = 0;
 
-    void                    UpdateSettings( AllSettings& rSettings );
+    virtual SalBitmap*			SnapShot() = 0;
 
-    void                    Beep( SoundType eSoundType );
+    virtual void				UpdateSettings( AllSettings& rSettings ) = 0;
 
-    // Liefert die SystemDaten zurueck
-    const SystemEnvData*    GetSystemData() const;
+    virtual void				Beep( SoundType eSoundType ) = 0;
+
+    // returns system data (most prominent: window handle)
+    virtual const SystemEnvData*	GetSystemData() const = 0;
 
-    // Callbacks (indepen in \sv\source\app\svframe.cxx)
-    // for default message handling return 0
-    void                    SetCallback( void* pInst, SALFRAMEPROC pProc );
 
     // get current modifier and button mask
-    ULONG					GetCurrentModButtons();
+    virtual ULONG				GetCurrentModButtons() = 0;
 
     // set new parent window
-    void					SetParent( SalFrame* pNewParent );
+    virtual void				SetParent( SalFrame* pNewParent ) = 0;
     // reparent window to act as a plugin; implementation
     // may choose to use a new system window inetrnally
     // return false to indicate failure
-    bool					SetPluginParent( SystemParentData* pNewParent );
+    virtual bool				SetPluginParent( SystemParentData* pNewParent ) = 0;
+
+    // Callbacks (indepent part in vcl/source/window/winproc.cxx)
+    // for default message handling return 0
+    void						SetCallback( void* pInst, SALFRAMEPROC pProc )
+    { m_pInst = pInst; m_pProc = pProc; }
+
+    // returns the instance set
+    void*                       GetInstance() const { return m_pInst; }
+    
+    // Call the callback set; this sometimes necessary for implementation classes
+    // that should not now more than necessary about the SalFrame implementation
+    // (e.g. input methods, printer update handlers).
+    long						CallCallback( USHORT nEvent, const void* pEvent ) const
+    { return m_pProc ? m_pProc( m_pInst, const_cast<SalFrame*>(this), nEvent, pEvent ) : 0; }
 };
 
 
Index: vcl/inc/salgdi.hxx
===================================================================
--- vcl/inc/salgdi.hxx.orig	2004-09-12 14:26:21.735968096 +0200
+++ vcl/inc/salgdi.hxx	2004-09-12 14:54:44.842056616 +0200
@@ -72,15 +72,21 @@
 #ifndef _SV_SALGTYPE_HXX
 #include <salgtype.hxx>
 #endif
-#ifndef _SV_SALGDI_H
-#include <salgdi.h>
-#endif
 #ifndef _VOS_THREAD_HXX
 #include <vos/thread.hxx>
 #endif
 #ifndef _SV_OUTDEV_HXX
 #include <outdev.hxx>
 #endif
+#ifndef _RTL_USTRING_HXX_
+#include <rtl/ustring.hxx>
+#endif
+#ifndef _SV_NATIVEWIDGETS_HXX
+#include <salnativewidgets.hxx>
+#endif
+#ifndef _SV_SALCTRLHANDLE_HXX
+#include <salctrlhandle.hxx>
+#endif
 
 #include <map>
 
@@ -97,6 +103,7 @@ class ImplLayoutArgs;
 class Rectangle;
 struct FontSubsetInfo;
 class OutputDevice;
+class ServerFontLayout;
 
 // ---------------------
 // - SalGraphics-Codes -
@@ -114,72 +121,131 @@ class OutputDevice;
 // - SalGraphics -
 // ---------------
 
-// note: if you add any new methods to class SalGraphics that work with coordinates 
-//       make sure they are virtual and add them to class SalGraphicsLayout where you have
-//       to perform coordinate mirroring if required, (see existing methods as sample)
+// note: if you add any new methods to class SalGraphics using coordinates 
+//       make sure they have a corresponding protected pure virtual method
+//       which has to be implemented by the platform dependent part.
+//       Add a method that performs coordinate mirroring if required, (see
+//       existing methods as sample) and then calls the equivalent pure method.
+
+// note: all positions are in pixel and relative to
+// the top/left-position of the virtual output area
+
 
 class SalGraphics
 {
-    friend class SalFrame;
-    friend class SalVirtualDevice;
-    friend class SalPrinter;
-
-public:                     // public for Sal Implementation
-                            SalGraphics();
-                            virtual ~SalGraphics();
-
-public:                     // public for Sal Implementation
-    SalGraphicsData         maGraphicsData;
-
-    // to be overridden by derived class
-    virtual int             GetLayout() { return 0; }	// base class supports left-to-right only
-    virtual void            SetLayout( int ) {};
+	int						m_nLayout; // 0: mirroring off, 1: mirror x-axis
+public:
+    SalGraphics();
+    virtual ~SalGraphics();
 
-#ifdef _INCL_SAL_SALGDI_IMP
-#include <salgdi.imp>
-#endif
+protected:
+    virtual BOOL		unionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
+    // draw --> LineColor and FillColor and RasterOp and ClipRegion
+    virtual void		drawPixel( long nX, long nY ) = 0;
+    virtual void		drawPixel( long nX, long nY, SalColor nSalColor ) = 0;
+    virtual void		drawLine( long nX1, long nY1, long nX2, long nY2 ) = 0;
+    virtual void		drawRect( long nX, long nY, long nWidth, long nHeight ) = 0;
+    virtual void		drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ) = 0;
+    virtual void		drawPolygon( ULONG nPoints, const SalPoint* pPtAry ) = 0;
+    virtual void		drawPolyPolygon( ULONG nPoly, const ULONG* pPoints, PCONSTSALPOINT* pPtAry ) = 0;
+    virtual sal_Bool	drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) = 0;
+    virtual sal_Bool	drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) = 0;
+    virtual sal_Bool	drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ) = 0;
 
+    // CopyArea --> No RasterOp, but ClipRegion
+    virtual void		copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
+                                  long nSrcHeight, USHORT nFlags ) = 0;
+    
+    // CopyBits and DrawBitmap --> RasterOp and ClipRegion
+    // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
+    virtual void		copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics ) = 0;
+    virtual void		drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap ) = 0;
+    virtual void		drawBitmap( const SalTwoRect* pPosAry,
+                                    const SalBitmap& rSalBitmap,
+                                    SalColor nTransparentColor ) = 0;
+    virtual void		drawBitmap( const SalTwoRect* pPosAry,
+                                    const SalBitmap& rSalBitmap,
+                                    const SalBitmap& rTransparentBitmap ) = 0;
+    virtual void		drawMask( const SalTwoRect* pPosAry,
+                                  const SalBitmap& rSalBitmap,
+                                  SalColor nMaskColor ) = 0;
+    
+    virtual SalBitmap*	getBitmap( long nX, long nY, long nWidth, long nHeight ) = 0;
+    virtual SalColor	getPixel( long nX, long nY ) = 0;
+
+    // invert --> ClipRegion (only Windows or VirDevs)
+    virtual void		invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) = 0;
+    virtual void		invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags ) = 0;
+
+    virtual BOOL		drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ) = 0;
+
+    // native widget rendering methods that require mirroring
+    virtual BOOL        hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+                                              const Point& aPos, SalControlHandle& rControlHandle, BOOL& rIsInside );
+    virtual BOOL        drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+                                           ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle,
+                                           rtl::OUString aCaption );
+    virtual BOOL        drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+                                               ControlState nState, const ImplControlValue& aValue,
+                                               SalControlHandle& rControlHandle, rtl::OUString aCaption );
+    virtual BOOL        getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState,
+                                                const ImplControlValue& aValue, SalControlHandle& rControlHandle, rtl::OUString aCaption,
+                                                Region &rNativeBoundingRegion, Region &rNativeContentRegion );
 public:
+    // public SalGraphics methods, the interface to the independent vcl part
 
-    // this functions must be quick, because this data is query for all
-    // GetGraphics()-Instances
-    void                    GetResolution( long& rDPIX, long& rDPIY );
-    void                    GetScreenFontResolution( long& rDPIX, long& rDPIY );
-    USHORT                  GetBitCount();
-    long                    GetGraphicsWidth();
-
-    void                    ResetClipRegion();
-    void                    BeginSetClipRegion( ULONG nCount );
-    virtual BOOL            UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
-    void                    EndSetClipRegion();
-
-    void                    SetLineColor();
-    void                    SetLineColor( SalColor nSalColor );
-    void                    SetFillColor();
-
-    void                    SetFillColor( SalColor nSalColor );
-
-    void                    SetXORMode( BOOL bSet );
-
-    void                    SetROPLineColor( SalROPColor nROPColor );
-    void                    SetROPFillColor( SalROPColor nROPColor );
-
-    // all positions are in pixel and relative to
-    // the top/left-position of the output area
-    void                    SetTextColor( SalColor nSalColor );
-    USHORT                  SetFont( ImplFontSelectData*, int nFallbackLevel );
-    void                    GetFontMetric( ImplFontMetricData* );
-                            // return only PairCount when (pKernPairs == NULL)
-    ULONG                   GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
-    ULONG                   GetFontCodeRanges( sal_uInt32* pCodePairs ) const;
+    // get device resolution
+    virtual void			GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) = 0;
+    // get resolution for fonts (an implementations specific adjustment,
+    // ideally would be the same as the Resolution)
+    virtual void			GetScreenFontResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) = 0;
+    // get the depth of the device
+    virtual USHORT			GetBitCount() = 0;
+    // get the width of the device
+    virtual long			GetGraphicsWidth() = 0;
+
+    // set the clip region to empty
+    virtual void			ResetClipRegion() = 0;
+    // begin setting the clip region, add rectangles to the
+    // region with the UnionClipRegion call
+    virtual void			BeginSetClipRegion( ULONG nCount ) = 0;
+    // all rectangles were added and the clip region should be set now
+    virtual void			EndSetClipRegion() = 0;
+
+    // set the line color to transparent (= don't draw lines)
+    virtual void			SetLineColor() = 0;
+    // set the line color to a specific color
+    virtual void			SetLineColor( SalColor nSalColor ) = 0;
+    // set the fill color to transparent (= don't fill)
+    virtual void			SetFillColor() = 0;
+    // set the fill color to a specific color, shapes will be
+    // filled accordingly
+    virtual void          	SetFillColor( SalColor nSalColor ) = 0;
+    // enable/disable XOR drawing
+    virtual void			SetXORMode( BOOL bSet ) = 0;
+    // set line color for raster operations
+    virtual void			SetROPLineColor( SalROPColor nROPColor ) = 0;
+    // set fill color for raster operations
+    virtual void			SetROPFillColor( SalROPColor nROPColor ) = 0;
+    // set the text color to a specific color
+    virtual void			SetTextColor( SalColor nSalColor ) = 0;
+    // set the font
+    virtual USHORT         SetFont( ImplFontSelectData*, int nFallbackLevel ) = 0;
+    // get the current font's etrics
+    virtual void			GetFontMetric( ImplFontMetricData* ) = 0;
+    // get kernign pairs of the current font
+    // return only PairCount if (pKernPairs == NULL)
+    virtual ULONG			GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ) = 0;
+    // get the repertoire of the current font; the code pairs returned
+    // contain unicode ranges. if pCodePairs is NULL return only the
+    // number of pairs which would be filled
+    virtual ULONG			GetFontCodeRanges( sal_uInt32* pCodePairs ) const = 0;
     // graphics must fill supplied font list
-    void                    GetDevFontList( ImplDevFontList* );
+    virtual void			GetDevFontList( ImplDevFontList* ) = 0;
     // graphics should call ImplAddDevFontSubstitute on supplied
     // OutputDevice for all its device specific preferred font substitutions
-    void					GetDevFontSubstList( OutputDevice* );
-    ImplFontData*           AddTempDevFont( const String& rFileURL, const String& rFontName );
-    static void             RemovingFont( ImplFontData* );
-
+    virtual void			GetDevFontSubstList( OutputDevice* ) = 0;
+    virtual ImplFontData*	AddTempDevFont( const String& rFileURL, const String& rFontName ) = 0;
     // CreateFontSubset: a method to get a subset of glyhps of a font
     // inside a new valid font file
     // returns TRUE if creation of subset was successfull
@@ -192,14 +258,14 @@ public:
     //             rInfo: additional outgoing information
     // implementation note: encoding 0 with glyph id 0 should be added implicitly
     // as "undefined character"
-    BOOL					CreateFontSubset( const rtl::OUString& rToFile,
+    virtual BOOL			CreateFontSubset( const rtl::OUString& rToFile,
                                               ImplFontData* pFont,
-                                              long* pGlyphIDs,
+                                              sal_Int32* pGlyphIDs,
                                               sal_uInt8* pEncoding,
                                               sal_Int32* pWidths,
                                               int nGlyphs,
                                               FontSubsetInfo& rInfo // out parameter
-                                              );
+                                              ) = 0;
 
     // GetFontEncodingVector: a method to get the encoding map Unicode
 	// to font encoded character; this is only used for type1 fonts and
@@ -208,7 +274,7 @@ public:
     // glyphs with only a name) exist it is set to the corresponding
     // map for non encoded glyphs; the encoding vector contains -1
     // as encoding for these cases
-    const std::map< sal_Unicode, sal_Int32 >* GetFontEncodingVector( ImplFontData* pFont, const std::map< sal_Unicode, rtl::OString >** ppNonEncoded );
+    virtual const std::map< sal_Unicode, sal_Int32 >* GetFontEncodingVector( ImplFontData* pFont, const std::map< sal_Unicode, rtl::OString >** ppNonEncoded ) = 0;
 
     // GetEmbedFontData: gets the font data for a font marked
     // embeddable by GetDevFontList or NULL in case of error
@@ -219,130 +285,146 @@ public:
     //                      pWidths MUST support at least 256 members;
     //             rInfo: additional outgoing information
     //             pDataLen: out parameter, contains the byte length of the returned buffer
-    const void*                     GetEmbedFontData( ImplFontData* pFont,
-                                                      const sal_Unicode* pUnicodes,
-                                                      sal_Int32* pWidths,
-                                                      FontSubsetInfo& rInfo,
-                                                      long* pDataLen );
+    virtual const void* GetEmbedFontData( ImplFontData* pFont,
+                                          const sal_Unicode* pUnicodes,
+                                          sal_Int32* pWidths,
+                                          FontSubsetInfo& rInfo,
+                                          long* pDataLen ) = 0;
     // frees the font data again
-    void                            FreeEmbedFontData( const void* pData, long nDataLen );
+    virtual void			FreeEmbedFontData( const void* pData, long nDataLen ) = 0;
 
-    virtual BOOL                    GetGlyphBoundRect( long nIndex, Rectangle&, const OutputDevice *pOutDev );
-    virtual BOOL                    GetGlyphOutline( long nIndex, PolyPolygon&, const OutputDevice *pOutDev );
+    virtual BOOL                    GetGlyphBoundRect( long nIndex, Rectangle& ) = 0;
+    virtual BOOL                    GetGlyphOutline( long nIndex, PolyPolygon& ) = 0;
 
-    virtual SalLayout*              GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
+    virtual SalLayout*              GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0;
+    virtual void					 DrawServerFontLayout( const ServerFontLayout& ) = 0;
 
-    // draw --> LineColor and FillColor and RasterOp and ClipRegion
-    virtual void                    DrawPixel( long nX, long nY, const OutputDevice *pOutDev );
-    virtual void                    DrawPixel( long nX, long nY, SalColor nSalColor, const OutputDevice *pOutDev );
-    virtual void                    DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev );
-    virtual void                    DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
-    virtual void                    DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
-    virtual void                    DrawPolygon( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
-    virtual void                    DrawPolyPolygon( ULONG nPoly, const ULONG* pPoints,
-                                             PCONSTSALPOINT* pPtAry, const OutputDevice *pOutDev );
-    virtual sal_Bool                DrawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice *pOutDev );
-    virtual sal_Bool                DrawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice *pOutDev );
-    virtual sal_Bool                DrawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints,
-                                                   const SalPoint* const* pPtAry, const BYTE* const* pFlgAry, const OutputDevice *pOutDev );
+    // mirroring specifica
+	int						GetLayout() { return m_nLayout; }
+	void					SetLayout( int aLayout ) { m_nLayout = aLayout;}
 
+	void					mirror( long& nX, const OutputDevice *pOutDev );
+	void					mirror( long& nX, long& nWidth, const OutputDevice *pOutDev );
+	BOOL					mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev );
+    void                    mirror( Region& rRgn, const OutputDevice *pOutDev );
+
+    // non virtual methods; these do eventual coordinate mirroring and
+    // then delegate to protected virtual methods
+    BOOL					UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
+    // draw --> LineColor and FillColor and RasterOp and ClipRegion
+    void                    DrawPixel( long nX, long nY, const OutputDevice *pOutDev );
+    void                    DrawPixel( long nX, long nY, SalColor nSalColor, const OutputDevice *pOutDev );
+    void                    DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev );
+    void                    DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
+    void                    DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
+    void                    DrawPolygon( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
+    void                    DrawPolyPolygon( ULONG nPoly,
+                                             const ULONG* pPoints,
+                                             PCONSTSALPOINT* pPtAry,
+                                             const OutputDevice *pOutDev );
+    sal_Bool                DrawPolyLineBezier( ULONG nPoints,
+                                                const SalPoint* pPtAry,
+                                                const BYTE* pFlgAry,
+                                                const OutputDevice *pOutDev );
+    sal_Bool                DrawPolygonBezier( ULONG nPoints,
+                                               const SalPoint* pPtAry,
+                                               const BYTE* pFlgAry,
+                                               const OutputDevice *pOutDev );
+    sal_Bool                DrawPolyPolygonBezier( ULONG nPoly,
+                                                   const ULONG* pPoints,
+                                                   const SalPoint* const* pPtAry,
+                                                   const BYTE* const* pFlgAry,
+                                                   const OutputDevice *pOutDev );
+    
     // CopyArea --> No RasterOp, but ClipRegion
-    virtual void                    CopyArea( long nDestX, long nDestY,
-                                      long nSrcX, long nSrcY,
-                                      long nSrcWidth, long nSrcHeight,
-                                      USHORT nFlags, const OutputDevice *pOutDev );
+    void                    CopyArea( long nDestX,
+                                      long nDestY,
+                                      long nSrcX,
+                                      long nSrcY,
+                                      long nSrcWidth,
+                                      long nSrcHeight,
+                                      USHORT nFlags,
+                                      const OutputDevice *pOutDev );
 
     // CopyBits and DrawBitmap --> RasterOp and ClipRegion
     // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
-    virtual void                    CopyBits( const SalTwoRect* pPosAry,
-                                      SalGraphics* pSrcGraphics, const OutputDevice *pOutDev, const OutputDevice *pSrcOutDev );
-    virtual void                    DrawBitmap( const SalTwoRect* pPosAry,
-                                        const SalBitmap& rSalBitmap, const OutputDevice *pOutDev );
-    virtual void                    DrawBitmap( const SalTwoRect* pPosAry,
+    void                    CopyBits( const SalTwoRect* pPosAry,
+                                      SalGraphics* pSrcGraphics,
+                                      const OutputDevice *pOutDev,
+                                      const OutputDevice *pSrcOutDev );
+    void                    DrawBitmap( const SalTwoRect* pPosAry,
                                         const SalBitmap& rSalBitmap,
-                                        SalColor nTransparentColor, const OutputDevice *pOutDev );
-    virtual void                    DrawBitmap( const SalTwoRect* pPosAry,
+                                        const OutputDevice *pOutDev );
+    void                    DrawBitmap( const SalTwoRect* pPosAry,
                                         const SalBitmap& rSalBitmap,
-                                        const SalBitmap& rTransparentBitmap, const OutputDevice *pOutDev );
+                                        SalColor nTransparentColor,
+                                        const OutputDevice *pOutDev );
+    void                    DrawBitmap( const SalTwoRect* pPosAry,
+                                        const SalBitmap& rSalBitmap,
+                                        const SalBitmap& rTransparentBitmap,
+                                        const OutputDevice *pOutDev );
 
-    virtual void                    DrawMask( const SalTwoRect* pPosAry,
+    void                    DrawMask( const SalTwoRect* pPosAry,
                                       const SalBitmap& rSalBitmap,
-                                      SalColor nMaskColor, const OutputDevice *pOutDev );
+                                      SalColor nMaskColor,
+                                      const OutputDevice *pOutDev );
 
-    virtual SalBitmap*              GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
-    virtual SalColor                GetPixel( long nX, long nY, const OutputDevice *pOutDev );
+    SalBitmap*              GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
+    SalColor                GetPixel( long nX, long nY, const OutputDevice *pOutDev );
 
     // invert --> ClipRegion (only Windows)
-    virtual void                    Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev );
-    virtual void                    Invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev );
-
-    virtual BOOL                    DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize, const OutputDevice *pOutDev );
-};
-
-
-// ---------------------
-// - SalGraphicsLayout -
-// ---------------------
-
-// extend SalGraphics for RTL
-
-class SalGraphicsLayout : public SalGraphics
-{
-	friend class SalFrame;
-	friend class SalVirtualDevice;
-	friend class SalPrinter;
-
-private:
-	int                             mnLayout;
-
-public:
-							SalGraphicsLayout();
-							~SalGraphicsLayout();
-
-	int                     GetLayout() { return mnLayout; }
-	void					SetLayout( int aLayout)	{ mnLayout = aLayout;}
-
-	void					mirror( long& nX, const OutputDevice *pOutDev );
-	void					mirror( long& nX, long& nWidth, const OutputDevice *pOutDev );
-	BOOL					mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev );
-
-	// overwrite those SalGraphics methods that require mirroring
-    // note: text methods will not be mirrored here, this is handled in outdev3.cxx
-	BOOL					UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
-	void					DrawPixel( long nX, long nY, const OutputDevice *pOutDev );
-	void					DrawPixel( long nX, long nY, SalColor nSalColor, const OutputDevice *pOutDev );
-	void					DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev );
-	void					DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
-	void					DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
-	void					DrawPolygon( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
-	void					DrawPolyPolygon( ULONG nPoly, const ULONG* pPoints,
-											 PCONSTSALPOINT* pPtAry, const OutputDevice *pOutDev );
-    sal_Bool                DrawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice *pOutDev );
-    sal_Bool                DrawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice *pOutDev );
-    sal_Bool                DrawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints,
-                                                   const SalPoint* const* pPtAry, const BYTE* const* pFlgAry, const OutputDevice *pOutDev );
-	void					CopyArea( long nDestX, long nDestY,
-									  long nSrcX, long nSrcY,
-									  long nSrcWidth, long nSrcHeight,
-									  USHORT nFlags, const OutputDevice *pOutDev );
-	void					CopyBits( const SalTwoRect* pPosAry,
-									  SalGraphics* pSrcGraphics, const OutputDevice *pOutDev, const OutputDevice *pSrcOutDev );
-	void					DrawBitmap( const SalTwoRect* pPosAry,
-										const SalBitmap& rSalBitmap, const OutputDevice *pOutDev );
-	void					DrawBitmap( const SalTwoRect* pPosAry,
-										const SalBitmap& rSalBitmap,
-										SalColor nTransparentColor, const OutputDevice *pOutDev );
-	void					DrawBitmap( const SalTwoRect* pPosAry,
-										const SalBitmap& rSalBitmap,
-										const SalBitmap& rTransparentBitmap, const OutputDevice *pOutDev );
-	void					DrawMask( const SalTwoRect* pPosAry,
-									  const SalBitmap& rSalBitmap,
-									  SalColor nMaskColor, const OutputDevice *pOutDev );
-	SalBitmap*				GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
-	SalColor				GetPixel( long nX, long nY, const OutputDevice *pOutDev );
-	void					Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev );
-	void					Invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev );
-	BOOL					DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize, const OutputDevice *pOutDev );
+    void                    Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev );
+    void                    Invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev );
+    
+    BOOL                    DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize, const OutputDevice *pOutDev );
+
+    //-------------------------------------
+    //  Native Widget Rendering functions
+    //-------------------------------------
+
+    // Query the platform layer for control support
+    virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
+
+    // Query the native control to determine if it was acted upon
+    BOOL HitTestNativeControl( ControlType nType,
+									  ControlPart nPart,
+									  const Region& rControlRegion,
+									  const Point& aPos,
+									  SalControlHandle& rControlHandle,
+                                      BOOL& rIsInside,
+                                      const OutputDevice *pOutDev );
+
+    // Request rendering of a particular control and/or part
+    BOOL DrawNativeControl( ControlType nType,
+									ControlPart nPart,
+									const Region& rControlRegion,
+									ControlState nState,
+									const ImplControlValue& aValue,
+									SalControlHandle& rControlHandle,
+									rtl::OUString aCaption,
+                                    const OutputDevice *pOutDev );
+
+    // Request rendering of a caption string for a control
+    BOOL DrawNativeControlText( ControlType nType,
+										ControlPart nPart,
+										const Region& rControlRegion,
+										ControlState nState,
+										const ImplControlValue& aValue,
+										SalControlHandle& rControlHandle,
+										rtl::OUString aCaption,
+                                        const OutputDevice *pOutDev );
+
+    // Query the native control's actual drawing region (including adornment)
+    BOOL GetNativeControlRegion( ControlType nType,
+										 ControlPart nPart,
+										 const Region& rControlRegion,
+										 ControlState nState,
+										 const ImplControlValue& aValue,
+										 SalControlHandle& rControlHandle,
+										 rtl::OUString aCaption,
+										 Region &rNativeBoundingRegion,
+										 Region &rNativeContentRegion,
+                                         const OutputDevice *pOutDev );
 };
 
 #endif // _SV_SALGDI_HXX
Index: vcl/inc/salimestatus.hxx
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ vcl/inc/salimestatus.hxx	2004-09-12 14:54:44.843056464 +0200
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ *  
+ *
+ *  
+ *
+ *  
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALIMESTATUS_HXX
+#define _SV_SALIMESTATUS_HXX
+
+class SalI18NImeStatus
+{
+public:
+    SalI18NImeStatus() {}
+    virtual ~SalI18NImeStatus();
+    
+    // asks whether there is a status window available
+    // to toggle into menubar
+    virtual bool canToggle() = 0;
+    virtual void toggle() = 0;
+};
+
+#endif
Index: vcl/inc/salinst.hxx
===================================================================
--- vcl/inc/salinst.hxx.orig	2004-09-12 14:26:21.738967640 +0200
+++ vcl/inc/salinst.hxx	2004-09-12 14:54:44.845056160 +0200
@@ -67,15 +67,11 @@
 #ifndef _STRING_HXX
 #include <tools/string.hxx>
 #endif
-
 #endif // __cplusplus
 
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
-#ifndef _SV_SALINST_H
-#include <salinst.h>
-#endif
 
 #ifdef __cplusplus
 
@@ -86,10 +82,19 @@ struct ImplJobSetup;
 class SalGraphics;
 class SalFrame;
 class SalObject;
+class SalSound;
+class SalOpenGL;
+class SalMenu;
+class SalMenuItem;
 class SalVirtualDevice;
 class SalInfoPrinter;
 class SalPrinter;
+class SalTimer;
 class ImplPrnQueueList;
+class SalI18NImeStatus;
+class SalSystem;
+class SalBitmap;
+struct SalItemParams;
 class SalSession;
 
 namespace vos { class IMutex; }
@@ -100,67 +105,88 @@ namespace vos { class IMutex; }
 
 class SalInstance
 {
-    friend SalInstance* CreateSalInstance();
-    friend void DestroySalInstance( SalInstance* );
-
+public:
+    typedef bool(*Callback)(void*,void*,int);
 private:
-                            SalInstance();
-                            ~SalInstance();
-
-public:                     // public for Sal Implementation
-    SalInstanceData         maInstData;
-
-#ifdef _INCL_SAL_SALINST_IMP
-#include <salinst.imp>
-#endif
-
+    void*						m_pEventInst;
+    void*						m_pErrorInst;
+    Callback					m_pEventCallback;
+    Callback					m_pErrorCallback;
+    
 public:
-                            // Frame
-                            // DisplayName for Unix ???
-    SalFrame*               CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
-    SalFrame*               CreateFrame( SalFrame* pParent, ULONG nStyle );
-    void                    DestroyFrame( SalFrame* pFrame );
-
-                            // Object (System Child Window)
-    SalObject*              CreateObject( SalFrame* pParent );
-    void                    DestroyObject( SalObject* pObject );
-
-                            // VirtualDevice
-                            // nDX and nDY in Pixeln
-                            // nBitCount: 0 == Default / 1 == Mono
-    SalVirtualDevice*       CreateVirtualDevice( SalGraphics* pGraphics,
-                                                 long nDX, long nDY,
-                                                 USHORT nBitCount );
-    void                    DestroyVirtualDevice( SalVirtualDevice* pDevice );
-
-                            // Printer
-                            // pSetupData->mpDriverData can be 0
-                            // pSetupData must be updatet with the current
-                            // JobSetup
-    SalInfoPrinter*         CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
-                                               ImplJobSetup* pSetupData );
-    void                    DestroyInfoPrinter( SalInfoPrinter* pPrinter );
-    SalPrinter*             CreatePrinter( SalInfoPrinter* pInfoPrinter );
-    void                    DestroyPrinter( SalPrinter* pPrinter );
-
-    void                    GetPrinterQueueInfo( ImplPrnQueueList* pList );
-    void                    GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
-    void                    DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
-    XubString               GetDefaultPrinter();
+    SalInstance() :
+            m_pEventInst( NULL ),
+            m_pErrorInst( NULL ),
+            m_pEventCallback( NULL ),
+            m_pErrorCallback( NULL )
+    {}
+    virtual ~SalInstance();
+
+    // Frame
+    // DisplayName for Unix ???
+    virtual SalFrame*      	CreateChildFrame( SystemParentData* pParent, ULONG nStyle ) = 0;
+    virtual SalFrame*      	CreateFrame( SalFrame* pParent, ULONG nStyle ) = 0;
+    virtual void				DestroyFrame( SalFrame* pFrame ) = 0;
+
+    // Object (System Child Window)
+    virtual SalObject*			CreateObject( SalFrame* pParent ) = 0;
+    virtual void				DestroyObject( SalObject* pObject ) = 0;
+
+    // VirtualDevice
+    // nDX and nDY in Pixel
+    // nBitCount: 0 == Default(=as window) / 1 == Mono
+    virtual SalVirtualDevice*	CreateVirtualDevice( SalGraphics* pGraphics,
+                                                     long nDX, long nDY,
+                                                     USHORT nBitCount ) = 0;
+    virtual void				DestroyVirtualDevice( SalVirtualDevice* pDevice ) = 0;
+
+    // Printer
+    // pSetupData->mpDriverData can be 0
+    // pSetupData must be updatet with the current
+    // JobSetup
+    virtual SalInfoPrinter*	CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
+                                               ImplJobSetup* pSetupData ) = 0;
+    virtual void				DestroyInfoPrinter( SalInfoPrinter* pPrinter ) = 0;
+    virtual SalPrinter*		CreatePrinter( SalInfoPrinter* pInfoPrinter ) = 0;
+    virtual void				DestroyPrinter( SalPrinter* pPrinter ) = 0;
+
+    virtual void				GetPrinterQueueInfo( ImplPrnQueueList* pList ) = 0;
+    virtual void				GetPrinterQueueState( SalPrinterQueueInfo* pInfo ) = 0;
+    virtual void				DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) = 0;
+    virtual String             GetDefaultPrinter() = 0;
+
+    // SalSound
+    virtual SalSound*			CreateSalSound() = 0;
+    // SalTimer
+    virtual SalTimer*			CreateSalTimer() = 0;
+    // SalOpenGL
+    virtual SalOpenGL*			CreateSalOpenGL( SalGraphics* pGraphics ) = 0;
+    // SalI18NImeStatus
+    virtual SalI18NImeStatus*	CreateI18NImeStatus() = 0;
+    // SalSystem
+    virtual SalSystem*			CreateSalSystem() = 0;
+    // SalBitmap
+    virtual SalBitmap*			CreateSalBitmap() = 0;
+
+    // YieldMutex
+    virtual vos::IMutex*		GetYieldMutex() = 0;
+    virtual ULONG				ReleaseYieldMutex() = 0;
+    virtual void				AcquireYieldMutex( ULONG nCount ) = 0;
+
+	// wait next event and dispatch
+    // must returned by UserEvent (SalFrame::PostEvent)
+    // and timer
+    virtual void				Yield( BOOL bWait ) = 0;
+    virtual bool				AnyInput( USHORT nType ) = 0;
+
+                            // Menues
+    virtual SalMenu*        CreateMenu( BOOL bMenuBar ) = 0;
+    virtual void            DestroyMenu( SalMenu* pMenu) = 0;
+    virtual SalMenuItem*    CreateMenuItem( const SalItemParams* pItemData ) = 0;
+    virtual void            DestroyMenuItem( SalMenuItem* pItem ) = 0;
 
     // may return NULL to disable session management
-    SalSession*				CreateSalSession();
-
-                            // YieldMutex
-    vos::IMutex*            GetYieldMutex();
-    ULONG                   ReleaseYieldMutex();
-    void                    AcquireYieldMutex( ULONG nCount );
-
-                            // wait next event and dispatch
-                            // must returned by UserEvent (SalFrame::PostEvent)
-                            // and timer
-    void                    Yield( BOOL bWait );
-    static BOOL             AnyInput( USHORT nType );
+    virtual SalSession*		CreateSalSession() = 0;
 
     // methods for XDisplayConnection
 
@@ -168,11 +194,21 @@ public:
     //    void* pInst:          pInstance form the SetCallback call
     //    void* pEvent:         address of the system specific event structure
     //    int   nBytes:         length of the system specific event structure
-    void                    SetEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int));
-    void                    SetErrorEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int));
+    void				SetEventCallback( void* pInstance, Callback pCallback )
+    { m_pEventInst = pInstance; m_pEventCallback = pCallback; }
+    Callback GetEventCallback() const 
+    { return m_pEventCallback; }
+    bool				CallEventCallback( void* pEvent, int nBytes )
+    { return m_pEventCallback ? m_pEventCallback( m_pEventInst, pEvent, nBytes ) : false; }
+    void				SetErrorEventCallback( void* pInstance, Callback pCallback )
+    { m_pErrorInst = pInstance; m_pErrorCallback = pCallback; }
+    Callback			GetErrorEventCallback() const
+    { return m_pErrorCallback; }
+    bool				CallErrorCallback( void* pEvent, int nBytes )
+    { return m_pErrorCallback ? m_pErrorCallback( m_pErrorInst, pEvent, nBytes ) : false; }
 
     enum ConnectionIdentifierType { AsciiCString, Blob };
-    void*                   GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
+    virtual void*				GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) = 0;
 };
 
 // called from SVMain
@@ -185,6 +221,8 @@ void DestroySalInstance( SalInstance* pI
 
 void SalAbort( const XubString& rErrorText );
 
+const ::rtl::OUString& SalGetDesktopEnvironment();
+
 #endif // __cplusplus
 
 // -----------
@@ -193,7 +231,6 @@ void SalAbort( const XubString& rErrorTe
 
 void InitSalData();                         // called from Application-Ctor
 void DeInitSalData();                       // called from Application-Dtor
-void SetFilterCallback( void* pCallback, void* pInst );
 
 void InitSalMain();
 void DeInitSalMain();
Index: vcl/inc/sallayout.hxx
===================================================================
--- vcl/inc/sallayout.hxx.orig	2004-09-12 14:26:21.739967488 +0200
+++ vcl/inc/sallayout.hxx	2004-09-12 14:54:44.846056008 +0200
@@ -63,10 +63,10 @@
 #define _SV_SALLAYOUT_HXX
 
 #ifndef _SV_GEN_HXX
-#include <gen.hxx>
-#endif // _SV_GEN_HXX
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#include <tools/gen.hxx>
+#endif
+#ifndef _TL_POLY_HXX
+#include <tools/poly.hxx>
 #endif
 
 #ifndef _TOOLS_LANG_HXX
@@ -76,11 +76,6 @@ typedef unsigned short LanguageType;
 #include <vector>
 #include <list>
 
-#ifdef REMOTE_APPSERVER
-// TODO: better solution: derive ImpServerGraphics from SalGraphics
-#define SalGraphics ImplServerGraphics
-#endif
-
 class SalGraphics;
 struct ImplFontData;
 
@@ -113,7 +108,7 @@ private:
     std::vector<int>    maRuns;
 
 public:
-            ImplLayoutRuns()    { mnRunIndex = 0; }
+            ImplLayoutRuns() { mnRunIndex = 0; maRuns.reserve(8); }
 
     void    Clear()             { maRuns.clear(); }
     bool    AddPos( int nCharPos, bool bRTL );
@@ -140,7 +135,7 @@ public:
     const xub_Unicode*  mpStr;
 
     // positioning related inputs
-    const long*         mpDXArray;          // in pixel units
+    const sal_Int32*         mpDXArray;          // in pixel units
     long                mnLayoutWidth;      // in pixel units
     int                 mnOrientation;      // in 0-3600 system
 
@@ -153,7 +148,7 @@ public:
                     int nMinCharPos, int nEndCharPos, int nFlags );
 
     void        SetLayoutWidth( long nWidth )       { mnLayoutWidth = nWidth; }
-    void        SetDXArray( const long* pDXArray )  { mpDXArray = pDXArray; }
+    void        SetDXArray( const sal_Int32* pDXArray )  { mpDXArray = pDXArray; }
     void        SetOrientation( int nOrientation )  { mnOrientation = nOrientation; }
 
     void        ResetPos()
@@ -220,13 +215,13 @@ public:
 
     // methods using string indexing
     virtual int     GetTextBreak( long nMaxWidth, long nCharExtra=0, int nFactor=1 ) const = 0;
-    virtual long    FillDXArray( long* pDXArray ) const = 0;
+    virtual long    FillDXArray( sal_Int32* pDXArray ) const = 0;
     virtual long    GetTextWidth() const { return FillDXArray( NULL ); }
-    virtual void    GetCaretPositions( int nArraySize, long* pCaretXArray ) const = 0;
+    virtual void    GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray ) const = 0;
 
     // methods using glyph indexing
-    virtual int     GetNextGlyphs( int nLen, long* pGlyphIdxAry, Point& rPos, int&,
-                        long* pGlyphAdvAry = NULL, int* pCharPosAry = NULL ) const = 0;
+    virtual int     GetNextGlyphs( int nLen, sal_Int32* pGlyphIdxAry, Point& rPos, int&,
+                        sal_Int32* pGlyphAdvAry = NULL, int* pCharPosAry = NULL ) const = 0;
     virtual bool    GetOutline( SalGraphics&, PolyPolyVector& ) const;
     virtual bool    GetBoundRect( SalGraphics&, Rectangle& ) const;
 
@@ -280,10 +275,10 @@ class MultiSalLayout : public SalLayout
 public:
     virtual void    DrawText( SalGraphics& ) const;
     virtual int     GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const;
-    virtual long    FillDXArray( long* pDXArray ) const;
-    virtual void    GetCaretPositions( int nArraySize, long* pCaretXArray ) const;
-    virtual int     GetNextGlyphs( int nLen, long* pGlyphIdxAry, Point& rPos,
-                        int&, long* pGlyphAdvAry, int* pCharPosAry ) const;
+    virtual long    FillDXArray( sal_Int32* pDXArray ) const;
+    virtual void    GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray ) const;
+    virtual int     GetNextGlyphs( int nLen, sal_Int32* pGlyphIdxAry, Point& rPos,
+                        int&, sal_Int32* pGlyphAdvAry, int* pCharPosAry ) const;
     virtual bool    GetOutline( SalGraphics&, PolyPolyVector& ) const;
     virtual bool    GetBoundRect( SalGraphics&, Rectangle& ) const;
 
@@ -364,13 +359,13 @@ public:
 
     // used by upper layers
     virtual long    GetTextWidth() const;
-    virtual long    FillDXArray( long* pDXArray ) const;
+    virtual long    FillDXArray( sal_Int32* pDXArray ) const;
     virtual int     GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const;
-    virtual void    GetCaretPositions( int nArraySize, long* pCaretXArray ) const;
+    virtual void    GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray ) const;
 
     // used by display layers
-    virtual int     GetNextGlyphs( int nLen, long* pGlyphIdxAry, Point& rPos, int&,
-                        long* pGlyphAdvAry = NULL, int* pCharPosAry = NULL ) const;
+    virtual int     GetNextGlyphs( int nLen, sal_Int32* pGlyphIdxAry, Point& rPos, int&,
+                        sal_Int32* pGlyphAdvAry = NULL, int* pCharPosAry = NULL ) const;
 
 protected:
                     GenericSalLayout();
@@ -381,7 +376,7 @@ protected:
     virtual void    DropGlyph( int nStart );
     virtual void    Simplify( bool bIsBase );
 
-    bool            GetCharWidths( long* pCharWidths ) const;
+    bool            GetCharWidths( sal_Int32* pCharWidths ) const;
 
 private:
     GlyphItem*      mpGlyphItems;   // TODO: change to GlyphList
Index: vcl/inc/salmenu.hxx
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ vcl/inc/salmenu.hxx	2004-09-12 14:54:44.846056008 +0200
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ *  
+ *
+ *  
+ *
+ *  
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALMENU_HXX
+#define _SV_SALMENU_HXX
+
+#ifndef _SV_SV_H
+#include <sv.h>
+#endif
+#ifndef _SV_MENU_HXX
+#include <menu.hxx>
+#endif
+#ifndef _SV_KEYCODE_HXX
+#include <keycod.hxx>
+#endif
+#ifndef _SV_IMAGE_HXX
+#include <image.hxx>
+#endif
+
+struct SystemMenuData;
+class SalFrame;
+
+struct SalItemParams
+{
+    USHORT          nId;					// item Id
+    MenuItemType    eType;					// MenuItem-Type
+    MenuItemBits    nBits;					// MenuItem-Bits
+    Menu*           pMenu;				    // Pointer to Menu
+    XubString       aText;					// Menu-Text
+    Image           aImage;					// Image
+};
+
+
+class SalMenuItem
+{
+public:
+    SalMenuItem() {}
+    virtual ~SalMenuItem();
+};
+
+class SalMenu
+{
+public:
+    SalMenu() {}
+    virtual ~SalMenu();
+
+    virtual BOOL VisibleMenuBar() = 0;  // must return TRUE to actually DISPLAY native menu bars
+                            // otherwise only menu messages are processed (eg, OLE on Windows)
+
+    virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) = 0;
+    virtual void RemoveItem( unsigned nPos ) = 0;
+    virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) = 0;
+    virtual void SetFrame( const SalFrame* pFrame ) = 0;
+    virtual void CheckItem( unsigned nPos, BOOL bCheck ) = 0;
+    virtual void EnableItem( unsigned nPos, BOOL bEnable ) = 0;
+    virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText )= 0;
+    virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage ) = 0;
+    virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName ) = 0;
+    virtual void GetSystemMenuData( SystemMenuData* pData ) = 0;
+};
+
+
+#endif // _SV_SALMENU_HXX
+
Index: vcl/inc/salnativewidgets.hxx
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ vcl/inc/salnativewidgets.hxx	2004-09-12 14:54:44.848055704 +0200
@@ -0,0 +1,367 @@
+/*************************************************************************
+ *
+ *  
+ *
+ *  
+ *
+ *  
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_NATIVEWIDGETS_HXX
+#define _SV_NATIVEWIDGETS_HXX
+
+#ifndef _RTL_USTRING_HXX_
+#include <rtl/ustring.hxx>
+#endif
+
+/* Control Types:
+ *
+ *   Specify the overall, whole control
+ *   type (as opposed to parts of the
+ *   control if it were composite).
+ */
+
+typedef sal_uInt32		ControlType;
+
+// Normal PushButton/Command Button
+#define CTRL_PUSHBUTTON			1
+
+// Normal single radio button
+#define CTRL_RADIOBUTTON			2
+
+// Normal single checkbox
+#define CTRL_CHECKBOX			10
+
+// Combobox, i.e. a ListBox
+// that allows data entry by user
+#define CTRL_COMBOBOX			20
+
+// Control that allows text entry
+#define CTRL_EDITBOX			30
+
+// Control that allows text entry, but without the usual border
+// Has to be handled separately, because this one cannot handle
+// HAS_BACKGROUND_TEXTURE, which is drawn in the edit box'es
+// border window.
+#define CTRL_EDITBOX_NOBORDER	31
+
+// Control that pops up a menu,
+// but does NOT allow data entry
+#define CTRL_LISTBOX			35
+
+// An edit field together with two little 
+// buttons on the side (aka spin field)
+#define CTRL_SPINBOX			40
+
+// Two standalone spin buttons
+// without an edit field
+#define CTRL_SPINBUTTONS		45
+
+// A single tab
+#define CTRL_TAB_ITEM			50
+
+// The border around a tab area,
+// but without the tabs themselves.
+// May have a gap at the top for
+// the active tab
+#define CTRL_TAB_PANE			55
+
+// Background of a Tab Pane
+#define CTRL_TAB_BODY			56
+
+// Normal scrollbar, including
+// all parts like slider, buttons
+#define CTRL_SCROLLBAR			60
+
+// Border around a group of related
+// items, perhaps also displaying
+// a label of identification
+#define CTRL_GROUPBOX			70
+
+// A separator line
+#define CTRL_FIXEDLINE			80
+
+// A rectangular border, like a
+// Tab Pane, but without the
+// possible gap for a tab
+#define CTRL_FIXEDBORDER			90
+
+
+
+/* Control Parts:
+ *
+ *   Uniquely identify a part of a control,
+ *   for example the slider of a scroll bar.
+ */
+
+typedef sal_uInt32		ControlPart;
+
+#define PART_ENTIRE_CONTROL		1
+#define PART_WINDOW             5       // the static listbox window containing the list
+#define PART_BUTTON				100
+#define PART_BUTTON_UP			101
+#define PART_BUTTON_DOWN			102	// Also for ComboBoxes/ListBoxes
+#define PART_BUTTON_LEFT			103
+#define PART_BUTTON_RIGHT		104
+#define PART_ALL_BUTTONS    		105
+#define PART_TRACK_HORZ_LEFT		200
+#define PART_TRACK_VERT_UPPER		201
+#define PART_TRACK_HORZ_RIGHT		202
+#define PART_TRACK_VERT_LOWER		203
+#define PART_THUMB_HORZ			210
+#define PART_THUMB_VERT			211
+
+/** The edit field part of a control, e.g. of the combo box.
+
+    Currently used just for combo boxes and just for GetNativeControlRegion().
+    It is valid only if GetNativeControlRegion() supports PART_BUTTON_DOWN as
+    well.
+*/
+#define PART_SUB_EDIT           300
+
+// For controls that require the entire background
+// to be drawn first, and then other pieces over top.
+// (GTK+ scrollbars for example).  Control region passed
+// in to draw this part is expected to be the entire
+// area of the control.
+// A control may respond to one or both.
+#define PART_DRAW_BACKGROUND_HORZ		1000
+#define PART_DRAW_BACKGROUND_VERT		1001
+
+// GTK+ also draws tabs right->left since there is a 
+// hardcoded 2 pixel overlap between adjacent tabs
+#define PART_TABS_DRAW_RTL			3000
+
+// For themes that do not want to have the focus
+// rectangle part drawn by VCL but take care of the
+// whole inner control part by themselves
+// eg, listboxes or comboboxes or spinbuttons
+#define HAS_BACKGROUND_TEXTURE  4000
+
+// For scrollbars that have 3 buttons (most KDE themes)
+#define HAS_THREE_BUTTONS       5000
+
+/* Control State:
+ *
+ *   Specify how a particular part of the control
+ *   is to be drawn.  Constants are bitwise OR-ed
+ *   together to compose a final drawing state.
+ *   A _disabled_ state is assumed by the drawing
+ *   functions until an ENABLED or HIDDEN is passed
+ *   in the ControlState.
+ */
+
+typedef sal_uInt32		ControlState;
+
+#define CTRL_STATE_ENABLED		0x0001
+#define CTRL_STATE_FOCUSED		0x0002
+#define CTRL_STATE_PRESSED		0x0004
+#define CTRL_STATE_ROLLOVER		0x0008
+#define CTRL_STATE_HIDDEN		0x0010
+#define CTRL_STATE_DEFAULT		0x0020
+#define CTRL_STATE_SELECTED		0x0040
+#define CTRL_CACHING_ALLOWED	0x8000  // set when the control is completely visible (i.e. not clipped)
+
+/* ButtonValue:
+ *
+ *   Identifies the tri-state value options
+ *   that buttons allow
+ */
+
+enum ButtonValue {
+	BUTTONVALUE_DONTKNOW,
+	BUTTONVALUE_ON,
+	BUTTONVALUE_OFF,
+	BUTTONVALUE_MIXED
+};
+
+
+#ifdef __cplusplus
+
+
+/* ScrollbarValue:
+ *
+ *   Value container for scrollbars.
+ */
+class ScrollbarValue
+{
+	public:
+		long			mnMin;
+		long			mnMax;
+		long			mnCur;
+		long			mnVisibleSize;
+		Rectangle		maThumbRect;
+		Rectangle		maButton1Rect;
+		Rectangle		maButton2Rect;
+		ControlState	mnButton1State;
+		ControlState	mnButton2State;
+		ControlState	mnThumbState;
+		ControlState	mnPage1State;
+		ControlState	mnPage2State;
+
+		inline ScrollbarValue()
+				{
+					mnMin = 0; mnMax = 0; mnCur = 0; mnVisibleSize = 0;
+					mnButton1State = 0; mnButton2State = 0;
+					mnThumbState = 0; mnPage1State = 0; mnPage2State = 0;
+				};
+		inline ~ScrollbarValue() {};
+};
+
+/* TabitemValue:
+ *
+ *   Value container for tabitems.
+ */
+
+/* TABITEM constants are OR-ed together */
+#define TABITEM_NOTALIGNED     0x000   // the tabitem is an inner item
+#define TABITEM_LEFTALIGNED    0x001   // the tabitem is aligned with the left  border of the TabControl
+#define TABITEM_RIGHTALIGNED   0x002   // the tabitem is aligned with the right border of the TabControl
+#define TABITEM_FIRST_IN_GROUP 0x004   // the tabitem is the first in group of tabitems
+#define TABITEM_LAST_IN_GROUP  0x008   // the tabitem is the last in group of tabitems
+
+class TabitemValue
+{
+	public:
+        unsigned int    mnAlignment;
+
+		inline TabitemValue()
+				{
+					mnAlignment = 0;
+				};
+		inline ~TabitemValue() {};
+
+        BOOL isLeftAligned()  { return (mnAlignment & TABITEM_LEFTALIGNED) != 0; }
+        BOOL isRightAligned() { return (mnAlignment & TABITEM_RIGHTALIGNED) != 0; }
+        BOOL isBothAligned()  { return isLeftAligned() && isRightAligned(); }
+        BOOL isNotAligned()   { return (mnAlignment & (TABITEM_LEFTALIGNED | TABITEM_RIGHTALIGNED)) == 0; }
+        BOOL isFirst()        { return (mnAlignment & TABITEM_FIRST_IN_GROUP) != 0; }
+        BOOL isLast()         { return (mnAlignment & TABITEM_LAST_IN_GROUP) != 0; }
+};
+
+
+/* SpinbuttonValue:
+ *
+ *   Value container for spinbuttons to paint both buttons at once.
+ *   Note: the other parameters of DrawNativeControl will have no meaning
+ *         all parameters for spinbuttons are carried here
+ */
+class SpinbuttonValue
+{
+	public:
+		Rectangle		maUpperRect;
+		Rectangle		maLowerRect;
+		ControlState	mnUpperState;
+		ControlState	mnLowerState;
+		int			mnUpperPart;
+		int			mnLowerPart;
+
+		inline SpinbuttonValue()
+				{
+					mnUpperState = mnLowerState = 0;
+				};
+		inline ~SpinbuttonValue() {};
+};
+
+/* ImplControlValue:
+ *
+ *   Generic value container for all control parts.
+ */
+
+class ImplControlValue
+{
+	friend class SalFrame;
+	
+	private:
+		ButtonValue	mTristate;	// Tristate value: on, off, mixed
+		rtl::OUString	mString;		// string value
+		long			mNumber;		// numeric value
+		void *		mOptionalVal;	// optional control-specific value
+
+	public:
+		inline ImplControlValue( ButtonValue nTristate, rtl::OUString sString, long nNumeric, void * aOptVal ) \
+								{ mTristate = nTristate; mString = sString; mNumber = nNumeric; mOptionalVal = aOptVal; };
+		inline ImplControlValue( ButtonValue nTristate, rtl::OUString sString, long nNumeric ) \
+								{ mTristate = nTristate; mString = sString; mNumber = nNumeric; mOptionalVal = NULL; };
+		inline ImplControlValue( ButtonValue nTristate )	{ mTristate = nTristate; mOptionalVal = NULL; };
+		inline ImplControlValue( rtl::OUString sString )	{ mString = sString; mOptionalVal = NULL; };
+		inline ImplControlValue( long nNumeric )		{ mNumber = nNumeric; mOptionalVal = NULL; };
+		inline ImplControlValue( void * aOptVal ) 		{ mOptionalVal = aOptVal; };
+		inline ImplControlValue() { mTristate = BUTTONVALUE_DONTKNOW; mNumber = 0; mOptionalVal = NULL; };
+		inline ~ImplControlValue() { mOptionalVal = NULL; };
+
+		inline ButtonValue		getTristateVal( void ) const { return mTristate; }
+		inline void			setTristateVal( ButtonValue nTristate ) { mTristate = nTristate; }
+
+		inline const rtl::OUString&	getStringVal( void ) const { return mString; }
+		inline void			setStringVal( rtl::OUString sString ) { mString = sString; }
+
+		inline long			getNumericVal( void ) const { return mNumber; }
+		inline void			setNumericVal( long nNumeric ) { mNumber = nNumeric; }
+
+		inline void *			getOptionalVal( void ) const { return mOptionalVal; }
+		inline void			setOptionalVal( void * aOptVal ) { mOptionalVal = aOptVal; }
+};
+
+#endif	/* __cplusplus */
+
+#endif
+
+
+
+
+
+
+
Index: vcl/inc/salobj.hxx
===================================================================
--- vcl/inc/salobj.hxx.orig	2004-09-12 14:26:21.742967032 +0200
+++ vcl/inc/salobj.hxx	2004-09-12 14:54:44.848055704 +0200
@@ -71,9 +71,6 @@
 #ifndef _SV_SALWTYPE_HXX
 #include <salwtype.hxx>
 #endif
-#ifndef _SV_SALOBJ_H
-#include <salobj.h>
-#endif
 
 struct SystemEnvData;
 
@@ -91,37 +88,32 @@ struct SystemEnvData;
 
 class SalObject
 {
-public: 					// public for Sal Implementation
-							SalObject();
-							~SalObject();
-
-public: 					// public for Sal Implementation
-	SalObjectData			maObjectData;
-
-#ifdef _INCL_SAL_SALOBJ_IMP
-#include <salobj.imp>
-#endif
-
+    void*				m_pInst;
+    SALOBJECTPROC		m_pCallback;
 public:
-	void					ResetClipRegion();
-	USHORT					GetClipRegionType();
-	void					BeginSetClipRegion( ULONG nRects );
-	void					UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
-	void					EndSetClipRegion();
-
-	void					SetPosSize( long nX, long nY, long nWidth, long nHeight );
-	void					Show( BOOL bVisible );
-	void					Enable( BOOL nEnable );
-	void					GrabFocus();
-
-	void					SetBackground();
-	void					SetBackground( SalColor nSalColor );
-
-	const SystemEnvData*	GetSystemData() const;
-
-	// Callbacks (indepen in \vcl\source\window\winproc.cxx)
-	// for default message handling return 0
-	void					SetCallback( void* pInst, SALOBJECTPROC pProc );
+    SalObject() : m_pInst( NULL ), m_pCallback( NULL ) {}
+    virtual ~SalObject();
+
+	virtual void					ResetClipRegion() = 0;
+	virtual USHORT					GetClipRegionType() = 0;
+	virtual void					BeginSetClipRegion( ULONG nRects ) = 0;
+	virtual void					UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
+	virtual void					EndSetClipRegion() = 0;
+
+	virtual void					SetPosSize( long nX, long nY, long nWidth, long nHeight ) = 0;
+	virtual void					Show( BOOL bVisible ) = 0;
+	virtual void					Enable( BOOL nEnable ) = 0;
+	virtual void					GrabFocus() = 0;
+
+	virtual void					SetBackground() = 0;
+	virtual void					SetBackground( SalColor nSalColor ) = 0;
+
+	virtual const SystemEnvData*	GetSystemData() const = 0;
+
+	void					SetCallback( void* pInst, SALOBJECTPROC pProc )
+    { m_pInst = pInst; m_pCallback = pProc; }
+    long					CallCallback( USHORT nEvent, const void* pEvent )
+    { return m_pCallback ? m_pCallback( m_pInst, this, nEvent, pEvent ) : 0; }
 };
 
 #endif // _SV_SALOBJ_HXX
Index: vcl/inc/salogl.hxx
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ vcl/inc/salogl.hxx	2004-09-12 14:54:44.849055552 +0200
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ *  
+ *
+ *  
+ *
+ *  
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALOGL_HXX
+#define _SV_SALOGL_HXX
+
+#define _OPENGL_EXT
+
+#ifndef _GEN_HXX
+#include <tools/gen.hxx>
+#endif
+
+#define _SVUNX_H
+
+#ifndef _SV_SV_H
+#include <sv.h>
+#endif
+#ifndef _SV_SALOTYPE_HXX
+#include <salotype.hxx>
+#endif
+
+// -----------------
+// - State defines -
+// -----------------
+
+#define OGL_STATE_UNLOADED		(0x00000000)
+#define OGL_STATE_INVALID		(0x00000001)
+#define OGL_STATE_VALID		(0x00000002)
+
+// -------------
+// - SalOpenGL -
+// -------------
+
+class SalGraphics;
+
+class SalOpenGL
+{
+public:					
+    
+    SalOpenGL() {}
+    virtual ~SalOpenGL();
+						
+	virtual bool		IsValid() = 0;
+	virtual void*		GetOGLFnc( const char * ) = 0;
+	virtual void		OGLEntry( SalGraphics* pGraphics ) = 0;
+	virtual void		OGLExit( SalGraphics* pGraphics ) = 0;
+    virtual void		StartScene( SalGraphics* pGraphics ) = 0;
+	virtual void		StopScene() = 0;
+};
+
+#endif
Index: vcl/inc/salprn.hxx
===================================================================
--- vcl/inc/salprn.hxx.orig	2004-09-12 14:26:21.746966424 +0200
+++ vcl/inc/salprn.hxx	2004-09-12 14:54:44.850055400 +0200
@@ -69,9 +69,6 @@
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
-#ifndef _SV_SALPRN_H
-#include <salprn.h>
-#endif
 #ifndef _SV_PRNTYPES_HXX
 #include <prntypes.hxx>
 #endif
@@ -107,49 +104,39 @@ struct SalPrinterQueueInfo
 
 class SalInfoPrinter
 {
-	friend class SalInstance;
-
 public:
     std::vector< vcl::PaperInfo  >		m_aPaperFormats;	// all printer supported formats
     bool								m_bPapersInit;		// set to true after InitPaperFormats
+    
+    SalInfoPrinter() {}
+    virtual ~SalInfoPrinter();
 
-							SalInfoPrinter();
-							~SalInfoPrinter();
-
-public: 					// public for Sal Implementation
-	SalInfoPrinterData		maPrinterData;
-
-#ifdef _INCL_SAL_SALIPRN_IMP
-#include <saliprn.imp>
-#endif
-
-public:
 	// SalGraphics or NULL, but two Graphics for all SalFrames
 	// must be returned
-	SalGraphics*			GetGraphics();
-	void					ReleaseGraphics( SalGraphics* pGraphics );
+	virtual SalGraphics*			GetGraphics() = 0;
+	virtual void					ReleaseGraphics( SalGraphics* pGraphics ) = 0;
 
-	BOOL					Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
-							// This function set the driver data and
-							// set the new indepen data in pSetupData
-	BOOL					SetPrinterData( ImplJobSetup* pSetupData );
-							// This function merged the indepen driver data
-							// and set the new indepen data in pSetupData
-							// Only the data must changed, where the bit
-							// in nFlags is set
-	BOOL					SetData( ULONG nFlags, ImplJobSetup* pSetupData );
-
-	void					GetPageInfo( const ImplJobSetup* pSetupData,
-										 long& rOutWidth, long& rOutHeight,
-										 long& rPageOffX, long& rPageOffY,
-										 long& rPageWidth, long& rPageHeight );
-	ULONG					GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType );
-	ULONG					GetPaperBinCount( const ImplJobSetup* pSetupData );
-	XubString				GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin );
+	virtual BOOL					Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) = 0;
+    // This function set the driver data and
+    // set the new indepen data in pSetupData
+	virtual BOOL					SetPrinterData( ImplJobSetup* pSetupData ) = 0;
+    // This function merged the indepen driver data
+    // and set the new indepen data in pSetupData
+    // Only the data must changed, where the bit
+    // in nFlags is set
+	virtual BOOL					SetData( ULONG nFlags, ImplJobSetup* pSetupData ) = 0;
+
+	virtual void					GetPageInfo( const ImplJobSetup* pSetupData,
+                                                 long& rOutWidth, long& rOutHeight,
+                                                 long& rPageOffX, long& rPageOffY,
+                                                 long& rPageWidth, long& rPageHeight ) = 0;
+	virtual ULONG					GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType ) = 0;
+	virtual ULONG					GetPaperBinCount( const ImplJobSetup* pSetupData ) = 0;
+	virtual String					GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin ) = 0;
 	// fills m_aPaperFormats and sets m_bPapersInit to true
-    void					InitPaperFormats( const ImplJobSetup* pSetupData );
+    virtual void					InitPaperFormats( const ImplJobSetup* pSetupData ) = 0;
     // returns angle that a landscape page will be turned counterclockwise wrt to portrait
-    int						GetLandscapeAngle( const ImplJobSetup* pSetupData );
+    virtual int					GetLandscapeAngle( const ImplJobSetup* pSetupData ) = 0;
 };
 
 
@@ -159,30 +146,20 @@ public:
 
 class SalPrinter
 {
-	friend class SalInstance;
-
-private:
-							SalPrinter();
-							~SalPrinter();
-
 public: 					// public for Sal Implementation
-	SalPrinterData			maPrinterData;
+    SalPrinter() {}
+    virtual ~SalPrinter();
 
-#ifdef _INCL_SAL_SALPRN_IMP
-#include <salprn.imp>
-#endif
-
-public:
-	BOOL					StartJob( const XubString* pFileName,
-									  const XubString& rJobName,
-									  const XubString& rAppName,
-									  ULONG nCopies, BOOL bCollate,
-									  ImplJobSetup* pSetupData );
-	BOOL					EndJob();
-	BOOL					AbortJob();
-	SalGraphics*			StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData );
-	BOOL					EndPage();
-	ULONG					GetErrorCode();
+	virtual BOOL					StartJob( const XubString* pFileName,
+                                              const XubString& rJobName,
+                                              const XubString& rAppName,
+                                              ULONG nCopies, BOOL bCollate,
+                                              ImplJobSetup* pSetupData ) = 0;
+	virtual BOOL					EndJob() = 0;
+	virtual BOOL					AbortJob() = 0;
+	virtual SalGraphics*			StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ) = 0;
+	virtual BOOL					EndPage() = 0;
+	virtual ULONG					GetErrorCode() = 0;
 };
 
 #endif // _SV_SALPRN_HXX
Index: vcl/inc/salsound.hxx
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ vcl/inc/salsound.hxx	2004-09-12 14:54:44.851055248 +0200
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ *  
+ *
+ *  
+ *
+ *  
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALSOUND_HXX
+#define _SV_SALSOUND_HXX
+
+#ifndef _GEN_HXX
+#include <tools/gen.hxx>
+#endif
+#ifndef _SV_SV_H
+#include <sv.h>
+#endif
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+#ifndef _SV_SALSTYPE_HXX
+#include <salstype.hxx>
+#endif
+
+class SalSound
+{
+	// for notification
+	void*					m_pInst;
+	SALSOUNDPROC			m_aPROC;
+public:
+    SalSound() : m_pInst( NULL ), m_aPROC( NULL ) {}
+    virtual ~SalSound();
+    
+    // checks whether sound system is ready for input and hence
+    // SalSound can be initialized
+    virtual bool		IsValid() = 0;
+    // initialize with sound file name, returns success and // FIXME: rSoundLen ?
+    virtual bool		Init( const String&	rSoundName,
+                              ULONG&		rSoundLen ) = 0;
+    // play the sound, start at nStartTime (ms), play for nPlayTime (ms),
+	// loop = true/false
+   	virtual void		Play( ULONG nStartTime, ULONG nPlayTime, bool bLoop ) = 0;
+    // stop playing
+	virtual void		Stop() = 0;
+    // pause playing
+	virtual void		Pause() = 0;
+    // continue a paused play
+	virtual void		Continue() = 0;
+    // is looping ?
+    virtual bool		IsLoopMode() const = 0;
+    // is playing ?
+	virtual bool		IsPlaying() const = 0;
+    // is paused ?
+    virtual bool		IsPaused() const = 0;
+
+    // register a callback to be called when state changes
+	void		SetNotifyProc( void* pInst, SALSOUNDPROC pProc )
+    { m_pInst = pInst; m_aPROC = pProc; }
+    void		CallNotifyProc( SoundNotification eNotification, ULONG nError )
+    {
+        if( m_aPROC )
+            m_aPROC( m_pInst, eNotification, nError );
+    }
+};
+
+#endif
Index: vcl/inc/salsys.hxx
===================================================================
--- vcl/inc/salsys.hxx.orig	2004-09-12 14:26:21.748966120 +0200
+++ vcl/inc/salsys.hxx	2004-09-12 14:54:44.851055248 +0200
@@ -65,44 +65,9 @@
 #ifndef _STRING_HXX
 #include <tools/string.hxx>
 #endif
-#ifndef _LIST_HXX
-#include <tools/list.hxx>
-#endif
-
-#ifndef _SV_SV_H
-#include <sv.h>
-#endif
-
-#ifndef _SV_SYSTEM_HXX
-#include <system.hxx>
-#endif
-
-#include <list>
-
-// -------------------
-// - SalSystem-Types -
-// -------------------
-
-// Must be the same values like in VCLSystemInfo
-#define SALSYSTEM_GETSYSTEMINFO_STACK           ((ULONG)0x00000001)
-#define SALSYSTEM_GETSYSTEMINFO_MODULES         ((ULONG)0x00000002)
-#define SALSYSTEM_GETSYSTEMINFO_SYSTEMVERSION   ((ULONG)0x00000004)
-#define SALSYSTEM_GETSYSTEMINFO_CPUTYPE         ((ULONG)0x00000008)
-#define SALSYSTEM_GETSYSTEMINFO_MEMORYINFO      ((ULONG)0x00000010)
-#define SALSYSTEM_GETSYSTEMINFO_LOCALVOLUMES    ((ULONG)0x00000020)
-#define SALSYSTEM_GETSYSTEMINFO_SYSTEMDIRS      ((ULONG)0x00000040)
-#define SALSYSTEM_GETSYSTEMINFO_MOUSEINFO       ((ULONG)0x00000080)
-#define SALSYSTEM_GETSYSTEMINFO_GRAPHICSSYSTEM  ((ULONG)0x00000100)
-
-// -------------
-// - SalSystem -
-// -------------
 
-String GetSalSummarySystemInfos( ULONG nFlags );
 
-bool GetSalSystemDisplayInfo( System::DisplayInfo& rInfo );
-
-/* Button combinations for ImplShowNativeMessageBox
+/* Button combinations for ShowNativeMessageBox
 */
 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK                 = 0;
 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL          = 1;
@@ -111,7 +76,7 @@ const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN
 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO             = 4;
 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL       = 5;
 
-/* Button identifier for ImplShowNativeMessageBox
+/* Button identifier for ShowNativeMessageBox
 */
 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK     = 1;
 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL = 2;
@@ -121,29 +86,57 @@ const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN
 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES    = 6;
 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO     = 7;
 
-/*  Shows a native message box with the specified title, message and button
-    combination. 
+
+
+// -------------
+// - SalSystem -
+// -------------
+
+struct DisplayInfo
+{
+    int nWidth, nHeight, nDepth;
+};
+
+
+class SalSystem
+{
+public:
+			SalSystem() {}
+    virtual ~SalSystem();
+    
+    // get info about the display
+    virtual bool GetSalSystemDisplayInfo( DisplayInfo& rInfo ) = 0;
+
+
+	/*  Shows a native message box with the specified title, message and button
+        combination. 
                 
-    @param  rTitle
-            The title to be shown by the dialog box.
+        @param  rTitle
+        The title to be shown by the dialog box.
             
-    @param  rMessage
-            The message to be shown by the dialog box.
+        @param  rMessage
+        The message to be shown by the dialog box.
             
-    @param  nButtonCombination
-            Specify which button combination the message box should display.
-            See button combinations above.
+        @param  nButtonCombination
+        Specify which button combination the message box should display.
+        See button combinations above.
                         
-    @param  nDefaultButton
-            Specifies which button has the focus initially. 
-            See button identifiers above. 
-            The effect of specifying a button that doesn't belong
-            to the specified button combination is undefined.
+        @param  nDefaultButton
+        Specifies which button has the focus initially. 
+        See button identifiers above. 
+        The effect of specifying a button that doesn't belong
+        to the specified button combination is undefined.
                                              
-    @returns the identifier of the button that was pressed by the user.            
-             See button identifier above. If the function fails the
-             return value is 0.
-*/
-int ImplShowNativeMessageBox(const String& rTitle, const String& rMessage, int nButtonCombination, int nDefaultButton);
+        @returns the identifier of the button that was pressed by the user.            
+        See button identifier above. If the function fails the
+        return value is 0.
+    */
+    virtual int ShowNativeMessageBox( const String& rTitle,
+                                      const String& rMessage,
+                                      int nButtonCombination,
+                                      int nDefaultButton) = 0;
+};
+
+SalSystem* ImplGetSalSystem();
 
 #endif // _SV_SALSYS_HXX
Index: vcl/inc/saltimer.hxx
===================================================================
--- vcl/inc/saltimer.hxx.orig	2004-09-12 14:26:21.749965968 +0200
+++ vcl/inc/saltimer.hxx	2004-09-12 14:54:44.852055096 +0200
@@ -73,15 +73,34 @@
 // - SalTimer -
 // ------------
 
+/*
+ * note: there will be only a single instance of SalTimer
+ * SalTimer originally had only static methods, but
+ * this needed to be virtualized for the sal plugin migration
+ */
+
 class SalTimer
 {
+    SALTIMERPROC		m_pProc;
 public:
-							// AutoRepeat and Restart
-	static void 			Start( ULONG nMS );
-	static void 			Stop();
+    SalTimer() : m_pProc( NULL ) {}
+    virtual ~SalTimer();
+
+    // AutoRepeat and Restart
+	virtual void 			Start( ULONG nMS ) = 0;
+	virtual void 			Stop() = 0;
 
 	// Callbacks (indepen in \sv\source\app\timer.cxx)
-	static void 			SetCallback( SALTIMERPROC pProc );
+	void 			SetCallback( SALTIMERPROC pProc )
+    {
+        m_pProc = pProc; 
+    }
+    
+    void			CallCallback()
+    {
+        if( m_pProc )
+            m_pProc();
+    }
 };
 
 #endif // _SV_SALTIMER_HXX
Index: vcl/inc/salvd.hxx
===================================================================
--- vcl/inc/salvd.hxx.orig	2004-09-12 14:26:21.750965816 +0200
+++ vcl/inc/salvd.hxx	2004-09-12 14:54:44.852055096 +0200
@@ -65,9 +65,6 @@
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
-#ifndef _SV_SALVD_H
-#include <salvd.h>
-#endif
 
 class SalGraphics;
 
@@ -77,27 +74,17 @@ class SalGraphics;
 
 class SalVirtualDevice
 {
-    friend class SalInstance;
-
-private:
-                            SalVirtualDevice();
-                            ~SalVirtualDevice();
-
 public:                     // public for Sal Implementation
-    SalVirDevData           maVirDevData;
-
-#ifdef _INCL_SAL_SALVD_IMP
-#include <salvd.imp>
-#endif
+    SalVirtualDevice() {}
+    virtual ~SalVirtualDevice();
 
-public:
     // SalGraphics or NULL, but two Graphics for all SalVirtualDevices
     // must be returned
-    SalGraphics*            GetGraphics();
-    void                    ReleaseGraphics( SalGraphics* pGraphics );
+    virtual SalGraphics*			GetGraphics() = 0;
+    virtual void					ReleaseGraphics( SalGraphics* pGraphics ) = 0;
 
                             // Set new size, without saving the old contents
-    BOOL                    SetSize( long nNewDX, long nNewDY );
+    virtual BOOL                    SetSize( long nNewDX, long nNewDY ) = 0;
 };
 
 #endif // _SV_SALVD_HXX
Index: vcl/inc/salwtype.hxx
===================================================================
--- vcl/inc/salwtype.hxx.orig	2004-09-12 14:26:21.751965664 +0200
+++ vcl/inc/salwtype.hxx	2004-09-12 14:54:44.853054944 +0200
@@ -147,7 +147,11 @@ struct ImplFontSelectData;
 #define SALEVENT_CLOSEPOPUPS            ((USHORT)30)
 #define SALEVENT_EXTERNALKEYINPUT       ((USHORT)31)
 #define SALEVENT_EXTERNALKEYUP          ((USHORT)32)
-#define SALEVENT_COUNT                  ((USHORT)32)
+#define SALEVENT_MENUCOMMAND            ((USHORT)33)
+#define SALEVENT_MENUHIGHLIGHT          ((USHORT)34)
+#define SALEVENT_MENUACTIVATE           ((USHORT)35)
+#define SALEVENT_MENUDEACTIVATE         ((USHORT)36)
+#define SALEVENT_COUNT                  ((USHORT)36)
 
 // MOUSELEAVE must send, when the pointer leave the client area and
 // the mouse is not captured
@@ -171,6 +175,13 @@ struct SalKeyEvent
     USHORT          mnRepeat;       // Repeat-Count (KeyInputs-1)
 };
 
+// MENUEVENT
+struct SalMenuEvent
+{
+    USHORT          mnId;           // Menu item ID
+    void*           mpMenu;         // pointer to VCL menu (class Menu)
+};
+
 // KEYMODCHANGE
 struct SalKeyModEvent
 {
Index: vcl/inc/scrbar.hxx
===================================================================
--- vcl/inc/scrbar.hxx.orig	2004-09-12 14:26:21.752965512 +0200
+++ vcl/inc/scrbar.hxx	2004-09-12 14:54:44.854054792 +0200
@@ -69,6 +69,8 @@
 #include <ctrl.hxx>
 #endif
 
+class AutoTimer;
+
 // -------------------
 // - ScrollBar-Types -
 // -------------------
@@ -79,6 +81,7 @@ enum ScrollType { SCROLL_DONTKNOW, SCROL
 // -------------
 // - ScrollBar -
 // -------------
+struct ImplScrollBarData;
 
 class ScrollBar : public Control
 {
@@ -88,7 +91,7 @@ private:
     Rectangle       maPage1Rect;
     Rectangle       maPage2Rect;
     Rectangle       maThumbRect;
-    void*           mpDummy;
+    ImplScrollBarData* mpData;
     long            mnStartPos;
     long            mnMouseOff;
     long            mnThumbPixRange;
@@ -107,14 +110,26 @@ private:
     ScrollType      meDDScrollType;
     BOOL            mbCalcSize;
     BOOL            mbFullDrag;
-    BOOL            mbDummy1;
-    BOOL            mbDummy2;
     Link            maScrollHdl;
     Link            maEndScrollHdl;
+    Rectangle*      ImplFindPartRect( const Point& rPt );
 
-#ifdef _SV_SCRBAR_CXX
-#include <scrbar.imp>
-#endif
+	void			ImplInit( Window* pParent, WinBits nStyle );
+	void			ImplInitStyle( WinBits nStyle );
+	void			ImplLoadRes( const ResId& rResId );
+	BOOL			ImplUpdateThumbRect( const Rectangle& rOldRect );
+	void			ImplUpdateRects( BOOL bUpdate = TRUE );
+	long			ImplCalcThumbPos( long nPixPos );
+	long			ImplCalcThumbPosPix( long nPos );
+	void			ImplCalc( BOOL bUpdate = TRUE );
+	void			ImplDraw( USHORT nDrawFlags, OutputDevice* pOutDev  );
+	long			ImplScroll( long nNewPos, BOOL bCallEndScroll );
+	long			ImplDoAction( BOOL bCallEndScroll );
+	void			ImplDoMouseAction( const Point& rPos, BOOL bCallAction = TRUE );
+	void			ImplInvert();
+    BOOL            ImplDrawNative( USHORT nDrawFlags );
+					DECL_LINK( ImplTimerHdl, Timer* );
+					DECL_LINK( ImplAutoTimerHdl, AutoTimer* );
 
 public:
                     ScrollBar( Window* pParent, WinBits nStyle = WB_VERT );
@@ -125,9 +140,13 @@ public:
     virtual void    Tracking( const TrackingEvent& rTEvt );
     virtual void    KeyInput( const KeyEvent& rKEvt );
     virtual void    Paint( const Rectangle& rRect );
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
     virtual void    Resize();
     virtual void    StateChanged( StateChangedType nType );
     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
+    virtual long    PreNotify( NotifyEvent& rNEvt );
+    virtual void    GetFocus();
+    virtual void    LoseFocus();
 
     virtual void    Scroll();
     virtual void    EndScroll();
@@ -169,11 +188,9 @@ public:
 
 class ScrollBarBox : public Window
 {
-#ifdef _SV_SCRBAR_CXX
 private:
     void            ImplInit( Window* pParent, WinBits nStyle );
     void            ImplInitSettings();
-#endif
 
 public:
                     ScrollBarBox( Window* pParent, WinBits nStyle = 0 );
Index: vcl/inc/settings.hxx
===================================================================
--- vcl/inc/settings.hxx.orig	2004-09-12 14:26:21.756964904 +0200
+++ vcl/inc/settings.hxx	2004-09-12 14:54:44.858054184 +0200
@@ -69,8 +69,8 @@
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
-#ifndef _SV_COLOR_HXX
-#include <color.hxx>
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
 #endif
 #ifndef _SV_FONT_HXX
 #include <font.hxx>
@@ -99,10 +99,8 @@ class ImplMachineData
 {
     friend class MachineSettings;
 
-#ifdef _SV_SETTINGS_CXX
                                     ImplMachineData();
                                     ImplMachineData( const ImplMachineData& rData );
-#endif
 
 private:
     USHORT                          mnRefCount;
@@ -161,10 +159,8 @@ class ImplMouseData
 {
     friend class MouseSettings;
 
-#ifdef _SV_SETTINGS_CXX
                                     ImplMouseData();
                                     ImplMouseData( const ImplMouseData& rData );
-#endif
 
 private:
     USHORT                          mnRefCount;
@@ -187,10 +183,6 @@ private:
     ULONG                           mnActionDelay;
     ULONG                           mnMenuDelay;
     ULONG                           mnFollow;
-    ULONG                           mnDummy1;
-    ULONG                           mnDummy2;
-    ULONG                           mnDummy3;
-    ULONG                           mnDummy4;
     USHORT                          mnMiddleButtonAction;
     USHORT                          mnAlign1;
 };
@@ -324,10 +316,8 @@ class ImplKeyboardData
 {
     friend class KeyboardSettings;
 
-#ifdef _SV_SETTINGS_CXX
                                     ImplKeyboardData();
                                     ImplKeyboardData( const ImplKeyboardData& rData );
-#endif
 
 private:
     USHORT                          mnRefCount;
@@ -378,74 +368,56 @@ class ImplStyleData
 {
     friend class StyleSettings;
 
-#ifdef _SV_SETTINGS_CXX
                                     ImplStyleData();
                                     ImplStyleData( const ImplStyleData& rData );
     void                            SetStandardStyles();
-    void                            SetStandardWinStyles();
-    void                            SetStandardOS2Styles();
-    void                            SetStandardMacStyles();
-    void                            SetStandardUnixStyles();
-#endif
 
 private:
     USHORT                          mnRefCount;
-    Color                           maFaceColor;
-    Color                           maCheckedColor;
-    Color                           maLightColor;
-    Color                           maLightBorderColor;
-    Color                           maShadowColor;
-    Color                           maDarkShadowColor;
-    Color                           maButtonTextColor;
-    Color                           maRadioCheckTextColor;
-    Color                           maLabelTextColor;
-    Color                           maInfoTextColor;
-    Color                           maWindowColor;
-    Color                           maWindowTextColor;
-    Color                           maDialogColor;
-    Color                           maDialogTextColor;
-    Color                           maWorkspaceColor;
-    Color                           maFieldColor;
-    Color                           maFieldTextColor;
+
+	void*							mpStyleData_NotUsedYet;
+
+	Color                           maActiveBorderColor;
     Color                           maActiveColor;
     Color                           maActiveColor2;
     Color                           maActiveTextColor;
-    Color                           maActiveBorderColor;
+    Color                           maButtonTextColor;
+    Color                           maCheckedColor;
+    Color                           maDarkShadowColor;
+    Color                           maDeactiveBorderColor;
     Color                           maDeactiveColor;
     Color                           maDeactiveColor2;
     Color                           maDeactiveTextColor;
-    Color                           maDeactiveBorderColor;
+    Color                           maDialogColor;
+    Color                           maDialogTextColor;
+    Color                           maDisableColor;
+    Color                           maFaceColor;
+    Color                           maFieldColor;
+    Color                           maFieldTextColor;
+    Color                           maFontColor;
+    Color                           maGroupTextColor;
+    Color                           maHelpColor;
     Color                           maHelpTextColor;
-    Color                           maMenuColor;
     Color                           maHighlightColor;
+    Color                           maHighlightLinkColor;
     Color                           maHighlightTextColor;
+    Color                           maInfoTextColor;
+    Color                           maLabelTextColor;
+    Color                           maLightBorderColor;
+    Color                           maLightColor;
+    Color                           maLinkColor;
+    Color                           maMenuBarColor;
+    Color                           maMenuBorderColor;
+    Color                           maMenuColor;
     Color                           maMenuHighlightColor;
     Color                           maMenuHighlightTextColor;
-    Color                           maDisableColor;
-    Color                           maHelpColor;
-    Color                           maGroupTextColor;
     Color                           maMenuTextColor;
-    Color                           maLinkColor;
+    Color                           maRadioCheckTextColor;
+    Color                           maShadowColor;
     Color                           maVisitedLinkColor;
-    Color                           maHighlightLinkColor;
-    Color                           maFontColor;
-    Color                           maDummyColor2;
-    Color                           maDummyColor3;
-    Color                           maDummyColor4;
-    Color                           maDummyColor5;
-    Color                           maDummyColor6;
-    Color                           maDummyColor7;
-    Color                           maDummyColor8;
-    Color                           maDummyColor9;
-    Color                           maDummyColor10;
-    Color                           maDummyColor11;
-    Color                           maDummyColor12;
-    Color                           maDummyColor13;
-    Color                           maDummyColor14;
-    Color                           maDummyColor15;
-    Color                           maDummyColor16;
-    Color                           maMenuBorderColor;
-    Color                           maMenuBarColor;
+    Color                           maWindowColor;
+    Color                           maWindowTextColor;
+    Color                           maWorkspaceColor;
     Font                            maAppFont;
     Font                            maHelpFont;
     Font                            maTitleFont;
@@ -459,8 +431,6 @@ private:
     Font                            maFieldFont;
     Font                            maIconFont;
     Font                            maGroupFont;
-    Font                            maDummyFont1;
-    Font                            maDummyFont2;
     long                            mnBorderSize;
     long                            mnTitleHeight;
     long                            mnFloatTitleHeight;
@@ -473,11 +443,6 @@ private:
     long                            mnIconHorzSpace;
     long                            mnIconVertSpace;
     long                            mnAntialiasedMin;
-    long                            mnDummySize2;
-    long                            mnDummySize3;
-    long                            mnDummySize4;
-    long                            mnDummySize5;
-    long                            mnDummySize6;
     ULONG                           mnCursorBlinkTime;
     ULONG                           mnDragFullOptions;
     ULONG                           mnAnimationOptions;
@@ -485,8 +450,6 @@ private:
     ULONG                           mnLogoDisplayTime;
     ULONG                           mnDisplayOptions;
     ULONG                           mnToolbarIconSize;
-    ULONG                           mnDummyOption3;
-    ULONG                           mnDummyOption4;
     ULONG                           mnUseFlatMenues;
     ULONG                           mnOptions;
     USHORT                          mnScreenZoom;
@@ -499,6 +462,7 @@ private:
     USHORT                          mnUseSystemUIFonts;
     USHORT                          mnAutoMnemonic;
     USHORT                          mnUseImagesInMenus;
+    ULONG                           mnUseFlatBorders;
 };
 
 // -----------------
@@ -750,10 +714,15 @@ public:
                                         { CopyData(); mpData->mnHighContrast = bHighContrast; }
     BOOL							GetHighContrastMode() const
                                         { return (BOOL) mpData->mnHighContrast; }
+    BOOL							IsHighContrastBlackAndWhite() const;
     void							SetUseSystemUIFonts( BOOL bUseSystemUIFonts )
                                         { CopyData(); mpData->mnUseSystemUIFonts = bUseSystemUIFonts; }
     BOOL							GetUseSystemUIFonts() const
                                         { return (BOOL) mpData->mnUseSystemUIFonts; }
+    void							SetUseFlatBorders( BOOL bUseFlatBorders )
+                                        { CopyData(); mpData->mnUseFlatBorders = bUseFlatBorders; }
+    BOOL							GetUseFlatBorders() const
+                                        { return (BOOL) mpData->mnUseFlatBorders; }
     void							SetUseFlatMenues( BOOL bUseFlatMenues )
                                         { CopyData(); mpData->mnUseFlatMenues = bUseFlatMenues; }
     BOOL							GetUseFlatMenues() const
@@ -962,17 +931,14 @@ class ImplMiscData
 {
     friend class MiscSettings;
 
-#ifdef _SV_SETTINGS_CXX
                                     ImplMiscData();
                                     ImplMiscData( const ImplMiscData& rData );
-#endif
 
 private:
     USHORT                          mnRefCount;
     USHORT                          mnTwoDigitYearStart;
     USHORT                          mnEnableATT;
-    USHORT                          mnDummy1;
-    USHORT                          mnDummy2;
+    BOOL                            mbEnableLocalizedDecimalSep;
 };
 
 // ----------------
@@ -997,6 +963,8 @@ public:
                                         { return mpData->mnTwoDigitYearStart; }
     void							SetEnableATToolSupport( BOOL bEnable );
     BOOL							GetEnableATToolSupport() const;
+    void							SetEnableLocalizedDecimalSep( BOOL bEnable );
+    BOOL							GetEnableLocalizedDecimalSep() const;
     const MiscSettings&             operator =( const MiscSettings& rSet );
 
     BOOL                            operator ==( const MiscSettings& rSet ) const;
@@ -1012,10 +980,8 @@ class ImplSoundData
 {
     friend class SoundSettings;
 
-#ifdef _SV_SETTINGS_CXX
                                     ImplSoundData();
                                     ImplSoundData( const ImplSoundData& rData );
-#endif
 
 private:
     USHORT                          mnRefCount;
@@ -1063,10 +1029,8 @@ class ImplNotificationData
 {
     friend class NotificationSettings;
 
-#ifdef _SV_SETTINGS_CXX
                                     ImplNotificationData();
                                     ImplNotificationData( const ImplNotificationData& rData );
-#endif
 
 private:
     USHORT                          mnRefCount;
@@ -1109,10 +1073,8 @@ class ImplHelpData
 {
     friend class HelpSettings;
 
-#ifdef _SV_SETTINGS_CXX
                                     ImplHelpData();
                                     ImplHelpData( const ImplHelpData& rData );
-#endif
 
 private:
     USHORT                          mnRefCount;
@@ -1171,13 +1133,11 @@ public:
 
 class ImplAllSettingsData
 {
-    friend class AllSettings;
+    friend class	AllSettings;
 
-#ifdef _SV_SETTINGS_CXX
-                                            ImplAllSettingsData();
-                                            ImplAllSettingsData( const ImplAllSettingsData& rData );
-                                            ~ImplAllSettingsData();
-#endif
+					ImplAllSettingsData();
+					ImplAllSettingsData( const ImplAllSettingsData& rData );
+					~ImplAllSettingsData();
 
 private:
     USHORT                                  mnRefCount;
@@ -1202,9 +1162,6 @@ private:
     CollatorWrapper*                        mpUICollatorWrapper;
     vcl::I18nHelper*                        mpI18nHelper;
     vcl::I18nHelper*                        mpUII18nHelper;
-
-    void*                                   mpDummy1;
-    void*                                   mpDummy2;
 };
 
 // ---------------
Index: vcl/inc/slider.hxx
===================================================================
--- vcl/inc/slider.hxx.orig	2004-09-12 14:26:21.757964752 +0200
+++ vcl/inc/slider.hxx	2004-09-12 14:54:44.859054032 +0200
@@ -106,7 +106,6 @@ private:
 	Link			maSlideHdl;
 	Link			maEndSlideHdl;
 
-#ifdef _SV_SLIDER_CXX
 	void			ImplInit( Window* pParent, WinBits nStyle );
 	void			ImplInitStyle( WinBits nStyle );
 	void			ImplLoadRes( const ResId& rResId );
@@ -123,7 +122,6 @@ private:
 	void			ImplDoMouseAction( const Point& rPos, BOOL bCallAction = TRUE );
 	long			ImplDoSlide( long nNewPos );
 	long			ImplDoSlideAction( ScrollType eScrollType );
-#endif
 
 public:
 					Slider( Window* pParent, WinBits nStyle = WB_HORZ );
Index: vcl/inc/sound.hxx
===================================================================
--- vcl/inc/sound.hxx.orig	2004-09-12 14:26:21.758964600 +0200
+++ vcl/inc/sound.hxx	2004-09-12 14:54:44.859054032 +0200
@@ -92,15 +92,10 @@ class Sound
 {
 private:
 
-#ifndef REMOTE_APPSERVER
 	SalSound*			mpSound;
-#else
-	RMSound*			mpSound;
-#endif
-
 	XubString			maSoundName;
 	Window* 			mpWindow;
-	BYTE*				mpSoundData;
+	BYTE*				mpSoundData_NOTUSED;
 	ULONG				mnDataLen;
 	ULONG				mnSoundLen;
 	ULONG				mnStartTime;
@@ -124,7 +119,7 @@ public:
 	
 public:
                         Sound( Window* pWindow = NULL );
-                        ~Sound();
+    virtual             ~Sound();
 
     virtual void        Notify();
 
@@ -132,8 +127,6 @@ public:
 	Window* 			GetWindow() const { return mpWindow; }
 	BOOL				SetSoundName( const XubString& rSoundName );
 	const XubString& 	GetSoundName() const { return maSoundName; }
-	BOOL				SetSoundData( const BYTE* pSoundData, ULONG nDataLen );
-	BYTE*				GetSoundData() const { return mpSoundData; }
 	ULONG				GetSoundLen() const { return mnSoundLen; }
 
     void				Play();
Index: vcl/inc/spin.h
===================================================================
--- vcl/inc/spin.h.orig	2004-09-12 14:26:21.759964448 +0200
+++ vcl/inc/spin.h	2004-09-12 14:54:44.860053880 +0200
@@ -82,6 +82,6 @@ void ImplDrawSpinButton( OutputDevice* p
                          BOOL bUpperIn, BOOL bLowerIn,
                          BOOL bUpperEnabled = TRUE,
                          BOOL bLowerEnabled = TRUE,
-                         BOOL bHorz = FALSE );
+                         BOOL bHorz = FALSE, BOOL bMirrorHorz = FALSE );
 
 #endif  // _SV_SPIN_H
Index: vcl/inc/spin.hxx
===================================================================
--- vcl/inc/spin.hxx.orig	2004-09-12 14:26:21.760964296 +0200
+++ vcl/inc/spin.hxx	2004-09-12 14:54:44.861053728 +0200
@@ -82,19 +82,24 @@ private:
     AutoTimer       maRepeatTimer;
     Rectangle       maUpperRect;
     Rectangle       maLowerRect;
-    BOOL            mbRepeat      : 1;
-    BOOL            mbUpperIn     : 1;
-    BOOL            mbLowerIn     : 1;
-    BOOL            mbInitialUp   : 1;
-    BOOL            mbInitialDown : 1;
-    BOOL            mbHorz        : 1;
+    Rectangle       maFocusRect;
+    BOOL            mbRepeat         : 1;
+    BOOL            mbUpperIn        : 1;
+    BOOL            mbLowerIn        : 1;
+    BOOL            mbInitialUp      : 1;
+    BOOL            mbInitialDown    : 1;
+    BOOL            mbHorz           : 1;
+    BOOL            mbUpperIsFocused : 1;
     Link            maUpHdlLink;
     Link            maDownHdlLink;
+    long            mnMinRange;
+    long            mnMaxRange;
+    long            mnValue;
+    long            mnValueStep;
+    Rectangle*      ImplFindPartRect( const Point& rPt );
 
-#ifdef _SV_SPIN_CXX
     void            ImplInit( Window* pParent, WinBits nStyle );
                     DECL_LINK( ImplTimeout, Timer* );
-#endif
 
 public:
                     SpinButton( Window* pParent, WinBits nStyle = 0 );
@@ -106,16 +111,45 @@ public:
 
     virtual void    Resize();
     virtual void    Paint( const Rectangle& rRect );
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
     virtual void    MouseButtonDown( const MouseEvent& rMEvt );
     virtual void    MouseButtonUp( const MouseEvent& rMEvt );
     virtual void    MouseMove( const MouseEvent& rMEvt );
     virtual void    KeyInput( const KeyEvent& rKEvt );
     virtual void    StateChanged( StateChangedType nStateChange );
+    virtual void    GetFocus();
+    virtual void    LoseFocus();
+
+    void            SetRangeMin( long nNewRange );
+    long            GetRangeMin() const { return mnMinRange; }
+    void            SetRangeMax( long nNewRange );
+    long            GetRangeMax() const { return mnMaxRange; }
+    void            SetRange( const Range& rRange );
+    Range           GetRange() const { return Range( GetRangeMin(), GetRangeMax() ); }
+    void            SetValue( long nValue );
+    long            GetValue() const { return mnValue; }
+    void            SetValueStep( long nNewStep ) { mnValueStep = nNewStep; }
+    long            GetValueStep() const { return mnValueStep; }
+    virtual long    PreNotify( NotifyEvent& rNEvt );
 
     void            SetUpHdl( const Link& rLink ) { maUpHdlLink = rLink; }
     const Link&     GetUpHdl() const   { return maUpHdlLink;   }
     void            SetDownHdl( const Link& rLink ) { maDownHdlLink = rLink; }
     const Link&     GetDownHdl() const { return maDownHdlLink; }
+
+private:
+    // moves the focus to the upper or lower rect. Return TRUE if the focus rect actually changed.
+    BOOL            ImplMoveFocus( BOOL _bUpper );
+    void            ImplCalcFocusRect( BOOL _bUpper );
+
+    inline BOOL     ImplIsUpperEnabled( ) const
+    {
+        return mnValue + mnValueStep <= mnMaxRange;
+    }
+    inline BOOL     ImplIsLowerEnabled( ) const
+    {
+        return mnValue >= mnMinRange + mnValueStep;
+    }
 };
 
 #endif  // _SV_SPIN_HXX
Index: vcl/inc/spinfld.hxx
===================================================================
--- vcl/inc/spinfld.hxx.orig	2004-09-12 14:26:21.761964144 +0200
+++ vcl/inc/spinfld.hxx	2004-09-12 14:54:44.861053728 +0200
@@ -97,16 +97,12 @@ protected:
 					mbLowerIn:1,
 					mbInDropDown:1;
 
-#if _SOLAR__PRIVATE
 	void			ImplInit( Window* pParent, WinBits nStyle );
 
-#ifdef _SV_SPINFLD_CXX
 private:
 					DECL_LINK( ImplTimeout, Timer* );
 	void			ImplInitData();
 	void			ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rectangle& rDDArea, Rectangle& rSpinUpArea, Rectangle& rSpinDownArea );
-#endif
-#endif
 
 protected:
 					SpinField( WindowType nTyp );
@@ -117,6 +113,7 @@ protected:
 	void			EndDropDown();
 
     virtual void  FillLayoutData() const;
+    Rectangle *     ImplFindPartRect( const Point& rPt );
 public:
 					SpinField( Window* pParent, WinBits nWinStyle = 0 );
 					SpinField( Window* pParent, const ResId& rResId );
@@ -137,6 +134,7 @@ public:
 	virtual void	Resize();
 	virtual void	StateChanged( StateChangedType nType );
 	virtual void	DataChanged( const DataChangedEvent& rDCEvt );
+    virtual long    PreNotify( NotifyEvent& rNEvt );
 
 	void			SetUpHdl( const Link& rLink ) { maUpHdlLink = rLink; }
 	const Link& 	GetUpHdl() const { return maUpHdlLink; }
Index: vcl/inc/split.hxx
===================================================================
--- vcl/inc/split.hxx.orig	2004-09-12 14:26:21.761964144 +0200
+++ vcl/inc/split.hxx	2004-09-12 14:54:44.862053576 +0200
@@ -92,7 +92,6 @@ private:
     Link                maStartSplitHdl;
     Link                maSplitHdl;
 
-#ifdef _SV_SPLIT_CXX
 	void 				ImplInitData();
 	void 				ImplDrawSplitter();
     void                ImplSplitMousePos( Point& rPos );
@@ -101,7 +100,6 @@ private:
     BOOL                ImplSplitterActive();
     Splitter*           ImplFindSibling();
     void                ImplRestoreSplitter();
-#endif
 
 protected:
 	void 				ImplInit( Window* pParent, WinBits nWinStyle );
Index: vcl/inc/splitwin.hxx
===================================================================
--- vcl/inc/splitwin.hxx.orig	2004-09-12 14:26:21.762963992 +0200
+++ vcl/inc/splitwin.hxx	2004-09-12 14:54:44.862053576 +0200
@@ -141,10 +141,7 @@ private:
 						mbFadeInPressed:1,
 						mbFadeOutPressed:1,
 						mbFadeNoButtonMode:1,
-						mbNoAlign:1,
-						mbDummy2:1,
-						mbDummy3:1,
-						mbDummy4:1;
+						mbNoAlign:1;
 	Link				maStartSplitHdl;
 	Link				maSplitHdl;
 	Link				maSplitResizeHdl;
@@ -152,7 +149,6 @@ private:
 	Link				maFadeInHdl;
 	Link				maFadeOutHdl;
 
-#ifdef _SV_SPLITWIN_CXX
 	void				ImplInit( Window* pParent, WinBits nStyle );
 	void				ImplInitSettings();
 	void				ImplCalcLayout();
@@ -169,7 +165,6 @@ private:
 	void				ImplDrawFadeIn( BOOL bInPaint );
 	void				ImplDrawFadeOut( BOOL bInPaint );
 	void				ImplNewAlign();
-#endif
 
 public:
 						SplitWindow( Window* pParent, WinBits nStyle = 0 );
Index: vcl/inc/status.hxx
===================================================================
--- vcl/inc/status.hxx.orig	2004-09-12 14:26:21.764963688 +0200
+++ vcl/inc/status.hxx	2004-09-12 14:54:44.863053424 +0200
@@ -128,23 +128,17 @@ private:
 	long				mnCalcHeight;
 	long				mnTextY;
 	long				mnItemY;
-	long				mnDummyLong;
 	USHORT				mnCurItemId;
 	USHORT				mnPercent;
 	USHORT				mnPercentCount;
-	USHORT				mnDummy1;
 	BOOL				mbVisibleItems;
 	BOOL				mbFormat;
 	BOOL				mbProgressMode;
 	BOOL				mbInUserDraw;
 	BOOL				mbBottomBorder;
-	BOOL				mbDummy1;
-	BOOL				mbDummy2;
-	BOOL				mbDummy3;
 	Link				maClickHdl;
 	Link				maDoubleClickHdl;
 
-#ifdef _SV_STATUS_CXX
 	void				ImplInit( Window* pParent, WinBits nStyle );
 	void				ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
 	void				ImplFormat();
@@ -155,7 +149,6 @@ private:
 										  USHORT nOldPerc, USHORT nNewPerc );
 	void				ImplCalcProgressRect();
 	Rectangle			ImplGetItemRectPos( USHORT nPos ) const;
-#endif
 
 public:
 						StatusBar( Window* pParent,
Index: vcl/inc/svapp.hxx
===================================================================
--- vcl/inc/svapp.hxx.orig	2004-09-12 14:26:21.765963536 +0200
+++ vcl/inc/svapp.hxx	2004-09-12 14:54:44.865053120 +0200
@@ -74,9 +74,6 @@
 #ifndef _UNQID_HXX
 #include <tools/unqid.hxx>
 #endif
-#ifndef _RTTI_HXX
-#include <tools/rtti.hxx>
-#endif
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
@@ -106,11 +103,6 @@ class KeyCode;
 class NotifyEvent;
 class KeyEvent;
 
-#ifndef NOOLDSV
-class Font;
-class ApplicationAddress;
-class ApplicationEvent;
-#endif
 namespace vos { class IMutex; }
 
 #ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
@@ -327,7 +319,7 @@ class Application
 {
 public:
                                 Application();
-                                ~Application();
+    virtual                     ~Application();
 
     virtual void                Main() = 0;
 
@@ -435,7 +427,8 @@ public:
 #ifndef NO_GETAPPWINDOW
     static WorkWindow*          GetAppWindow();
 #endif
-    static Window*              GetFocusWindow();
+
+	static Window*              GetFocusWindow();
     static OutputDevice*        GetDefaultDevice();
 
     static Window*              GetFirstTopLevelWindow();
@@ -562,6 +555,11 @@ public:
         Can be called without the Solar mutex locked.
      */
     static bool GetShowImeStatusWindowDefault();
+    
+    /** Returns a string representing the desktop environment 
+        the process is currently running in.
+     */
+    static const ::rtl::OUString& GetDesktopEnvironment();
 };
 
 Application* GetpApp();
Index: vcl/inc/svdata.hxx
===================================================================
--- vcl/inc/svdata.hxx.orig	2004-09-12 14:26:21.767963232 +0200
+++ vcl/inc/svdata.hxx	2004-09-12 14:54:44.866052968 +0200
@@ -147,80 +147,13 @@ class ImplVDevCache;
 class UnoWrapperBase;
 class GraphicConverter;
 class ImplWheelWindow;
+class SalTimer;
+class SalI18NImeStatus;
 
 namespace vos { class OMutex; }
 namespace vos { class OCondition; }
 namespace vcl { class DisplayConnection; class DefaultFontConfigItem; class FontSubstConfigItem; class SettingsConfigItem;}
 
-// ----------
-// - Remote -
-// ----------
-
-#ifdef REMOTE_APPSERVER
-class VclOTimer;
-class RmEventQueue;
-class UNODispatchThread;
-
-// see unotools/atom.hxx
-namespace utl {
-    class AtomClient;
-}
-
-// needed for server side drag and drop
-namespace com { namespace sun { namespace star { namespace datatransfer { namespace dnd {
-    class XDragSource;
-} } } } }
-
-#include <tools/table.hxx>
-#include <vos/mutex.hxx>
-#include <vos/thread.hxx>
-#include <vos/semaphor.hxx>
-#include "rvp.hxx"
-
-#define CHECK_FOR_RVPSYNC_NORMAL()  ImplGetSVData()->mpRVPNormalSync->CheckForRVPSync( NULL );
-#define CHECK_FOR_RVPSYNC_SOUND()   ImplGetSVData()->mpRVPSoundSync->CheckForRVPSync( NULL );
-
-void rvpExceptionHandler();
-
-DECLARE_TABLE( KeyNames, String* );
-
-class ImplRemoteYieldMutex : public vos::OMutex
-{
-    ULONG                                       mnCount;
-    vos::OThread::TThreadIdentifier             mnThreadId;
-    vos::OThread::TThreadIdentifier             mnMainThreadId;
-
-public:
-                                                ImplRemoteYieldMutex();
-
-    virtual void SAL_CALL                       acquire();
-    virtual void SAL_CALL                       release();
-    virtual sal_Bool SAL_CALL                   tryToAcquire();
-
-    ULONG                                       GetAcquireCount() const { return mnCount; }
-    vos::OThread::TThreadIdentifier             GetThreadId() const { return mnThreadId; }
-    vos::OThread::TThreadIdentifier             GetMainThreadId() const { return mnMainThreadId; }
-
-};
-
-// sync uno rvp call packages
-class RVPSync
-{
-    vos::OThread::TThreadIdentifier             mnLastThreadId;
-    oslInterlockedCount                         mnRVPCount;
-    REF( NMSP_CLIENT::XRmSync )                 mxRVPSync;
-    vos::OMutex                                 maMutex;
-	sal_uInt32                                  mnForceSyncCount;
-	sal_uInt32                                  mnSyncCount;
-
-public:
-    RVPSync( const REF( NMSP_CLIENT::XRmSync )& xRVPSync );
-
-    void                                        CheckForRVPSync( const char* );
-};
-
-#endif
-
 // -----------------
 // - ImplSVAppData -
 // -----------------
@@ -234,9 +167,6 @@ struct ImplSVAppData
         ImeStatusWindowMode_SHOW
     };
 
-#ifdef REMOTE_APPSERVER
-    ImplRemoteYieldMutex*   mpSolarMutex;       // Solar-Mutex
-#endif
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >    mxMSF;
     String*                 mpMSFTempFileName;
     AllSettings*            mpSettings;         // Application settings
@@ -337,7 +267,6 @@ struct ImplSVWinData
     USHORT                  mnAutoScrollFlags;  // auto scroll flags
     BOOL                    mbNoDeactivate;     // TRUE: keine Deactivate durchfuehren
 	BOOL					mbNoSaveFocus;		// TRUE: menues must not save/restore focus
-    BOOL                    mbDummy1;
 };
 
 
@@ -387,17 +316,6 @@ struct ImplSVHelpData
 };
 
 
-// --------------------
-// - ImplSVSystemData -
-// --------------------
-
-struct ImplSVSystemData
-{
-#ifndef REMOTE_APPSERVER
-    SalSystem*              mpDefSystem;        // Default-System-Instance
-#endif
-};
-
 // --------------
 // - ImplSVData -
 // --------------
@@ -412,6 +330,9 @@ struct ImplSVData
     ULONG                   mnThreadCount;      // is VCL MultiThread enabled
     ImplConfigData*         mpFirstConfigData;  // Zeiger auf ersten Config-Block
     ImplTimerData*          mpFirstTimerData;   // list of all running timers
+    SalTimer*				mpSalTimer;			// interface to sal event loop/timers
+    SalI18NImeStatus*		mpImeStatus;		// interface to ime status window
+    SalSystem*				mpSalSystem;		// SalSystem interface
     ResMgr*                 mpResMgr;           // SV-Resource-Manager
     ULONG                   mnTimerPeriod;      // current timer period
     ULONG                   mnTimerUpdate;      // TimerCallbackProcs on stack
@@ -422,35 +343,12 @@ struct ImplSVData
     ImplSVWinData           maWinData;          // indepen data for Windows classes
     ImplSVCtrlData          maCtrlData;         // indepen data for Control classes
     ImplSVHelpData          maHelpData;         // indepen data for Help classes
-    ImplSVSystemData        maSystemData;       // indepen data for class System
     UnoWrapperBase*         mpUnoWrapper;
     Window*                 mpIntroWindow;      // the splash screen
 
     vos::OThread::TThreadIdentifier     mnMainThreadId;
     ::vcl::DisplayConnection*           mpDisplayConnection;
 
-#ifdef REMOTE_APPSERVER
-    VclOTimer*                          mpOTimer;           // VOS-Timer
-    RmEventQueue*                       mpRmEventQueue;     // Remote-EventQueue
-    REF( NMSP_CLIENT::XRmStatus )               mxStatus;           // Remote-Status
-    REF( NMSP_LANG::XMultiServiceFactory )      mxClientFactory;    // XFactory zum erzeugen der UNO-Objekte statt ueber UNO_createObject
-    REF( NMSP_CLIENT::XMultiInstanceFactory )   mxMultiFactory;     // XFactory zum erzeugen der UNO-Objekte statt ueber UNO_createObject
-    RVPSync*                            mpRVPNormalSync;    // sync interfaces for rvp normal-calls
-    RVPSync*                            mpRVPSoundSync;     // sync interfaces for rvp sound-calls
-    long                                mnRemoteVersion;    // remote version of client
-    ::utl::AtomClient*                  mpAtoms;            // Atoms for client connection
-    ::vos::OMutex*                      mpWindowObjectMutex;
-    ::vos::OCondition*                  mpStartUpCond;
-    void*                               mhRemoteEnv;        // not needed anymore
-    String*                             mpConnectionName;
-    KeyNames*                           mpKeyNames;
-    REF( NMSP_CLIENT::XRmPrinterEnvironment )	mxRmPrinterEnvironment;
-    NMSP_CLIENT::PrinterEnvironment*			mpPrinterEnvironment;
-//  UNO_Server                          mhRemotePrinter;    // UNO-PrinterServer
-//  XRmPrinterEnvironment*              mpRmPrinterEnv;     // UNO-Printer-Environment
-    ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > mxServerDragSource;
-	Rectangle							maWorkArea;			// the remote screen size in pixels
-#endif
     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxAccessBridge;
     com::sun::star::uno::Reference< com::sun::star::frame::XSessionManagerClient > xSMClient;
     ::vcl::SettingsConfigItem*			mpSettingsConfigItem;
@@ -465,10 +363,8 @@ ResMgr*     ImplGetResMgr();
 void        ImplWindowAutoMnemonic( Window* pWindow );
 void        ImplTimerCallbackProc();
 
-#ifndef REMOTE_APPSERVER
 void        ImplUpdateSystemProcessWindow();
 Window*     ImplFindWindow( const SalFrame* pFrame, Point& rSalFramePos );
-#endif
 
 // SVAPP.CXX
 BOOL        ImplCallHotKey( const KeyCode& rKeyCode );
Index: vcl/inc/sysdata.hxx
===================================================================
--- vcl/inc/sysdata.hxx.orig	2004-09-12 14:26:21.768963080 +0200
+++ vcl/inc/sysdata.hxx	2004-09-12 14:54:44.867052816 +0200
@@ -69,11 +69,8 @@
 struct SystemEnvData
 {
 	unsigned long		nSize;			// size in bytes of this structure
-#ifndef SYSDATA_ONLY_BASETYPE
-#if defined( WIN ) || defined( WNT )
+#if defined( WNT )
 	HWND				hWnd;			// the window hwnd
-#elif defined( OS2 )
-	HWND				hWnd;			// the client hwnd
 #elif defined( UNX )
 	void*				pDisplay;		// the relevant display connection
 	long				aWindow;		// the window of the object
@@ -86,7 +83,6 @@ struct SystemEnvData
 	long				aShellWindow;	// the window of the frame's shell
 	void*				pShellWidget;	// the frame's shell widget
 #endif
-#endif
 };
 
 #define SystemChildData SystemEnvData
@@ -98,14 +94,24 @@ struct SystemEnvData
 struct SystemParentData
 {
 	unsigned long	nSize;			// size in bytes of this structure
-#ifndef SYSDATA_ONLY_BASETYPE
-#if defined( WIN ) || defined( WNT )
+#if defined( WNT )
 	HWND			hWnd;			// the window hwnd
-#elif defined( OS2 )
-	HWND			hWnd;			// the client hwnd
 #elif defined( UNX )
 	long		    aWindow;		// the window of the object
 #endif
+};
+
+// --------------------
+// - SystemMenuData -
+// --------------------
+
+struct SystemMenuData
+{
+	unsigned long	nSize;			// size in bytes of this structure
+#if defined( WNT )
+	HMENU			hMenu;			// the menu handle of the menu bar
+#elif defined( UNX )
+	long		    aMenu;		    // ???
 #endif
 };
 
Index: vcl/inc/syswin.hxx
===================================================================
--- vcl/inc/syswin.hxx.orig	2004-09-12 14:26:21.769962928 +0200
+++ vcl/inc/syswin.hxx	2004-09-12 14:54:44.868052664 +0200
@@ -219,12 +219,9 @@ private:
     BOOL            mbDockBtn;
     BOOL            mbHideBtn;
     BOOL            mbSysChild;
-    BOOL            mbDummy2;
-    BOOL            mbDummy3;
     USHORT          mnMenuBarMode;
     USHORT          mnIcon;
 	TaskPaneList*   mpTaskPaneList;
-	void*			mpDummy;
 
 protected:
                     SystemWindow( WindowType nType );
Index: vcl/inc/tabctrl.hxx
===================================================================
--- vcl/inc/tabctrl.hxx.orig	2004-09-12 14:26:21.770962776 +0200
+++ vcl/inc/tabctrl.hxx	2004-09-12 14:54:44.868052664 +0200
@@ -110,8 +110,6 @@ private:
     Link                maActivateHdl;
     Link                maDeactivateHdl;
 
-#ifdef _SV_TABCTRL_CXX
-private:
     void                ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
     ImplTabItem*        ImplGetItem( USHORT nId ) const;
     void                ImplScrollBtnsColor();
@@ -124,16 +122,17 @@ private:
     void                ImplActivateTabPage( BOOL bNext );
     void                ImplSetFirstPagePos( USHORT nPagePos );
     void                ImplShowFocus();
-    void                ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bool bLayout = false );
+    void                ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bool bLayout = false, bool bFirstInGroup = false, bool bLastInGroup = false, bool bIsCurrentItem = false );
     void				ImplPaint( const Rectangle& rRect, bool bLayout = false );
     void				ImplFreeLayoutData();
                         DECL_LINK( ImplScrollBtnHdl, PushButton* pBtn );
-#endif
+
 protected:
     void                ImplInit( Window* pParent, WinBits nStyle );
     void                ImplLoadRes( const ResId& rResId );
 
     virtual void		FillLayoutData() const;
+    Rectangle*          ImplFindPartRect( const Point& rPt );
 
 public:
                         TabControl( Window* pParent,
@@ -152,6 +151,7 @@ public:
     virtual long        Notify( NotifyEvent& rNEvt );
     virtual void        StateChanged( StateChangedType nType );
     virtual void        DataChanged( const DataChangedEvent& rDCEvt );
+    virtual long        PreNotify( NotifyEvent& rNEvt );
 
     virtual void        ActivatePage();
     virtual long        DeactivatePage();
Index: vcl/inc/tabdlg.hxx
===================================================================
--- vcl/inc/tabdlg.hxx.orig	2004-09-12 14:26:21.770962776 +0200
+++ vcl/inc/tabdlg.hxx	2004-09-12 14:54:44.869052512 +0200
@@ -83,10 +83,8 @@ private:
 	WindowAlign 		meViewAlign;
 	BOOL				mbPosControls;
 
-#ifdef _SV_TABDLG_CXX
 	void				ImplInitData();
 	void				ImplPosControls();
-#endif
 
 public:
 						TabDialog( Window* pParent,
Index: vcl/inc/tabpage.hxx
===================================================================
--- vcl/inc/tabpage.hxx.orig	2004-09-12 14:26:21.771962624 +0200
+++ vcl/inc/tabpage.hxx	2004-09-12 14:54:44.869052512 +0200
@@ -75,16 +75,16 @@
 
 class TabPage : public Window
 {
-#ifdef _SV_TABPAGE_CXX
 private:
 	void			ImplInit( Window* pParent, WinBits nStyle );
 	void			ImplInitSettings();
-#endif
 
 public:
 					TabPage( Window* pParent, WinBits nStyle = 0 );
 					TabPage( Window* pParent, const ResId& rResId );
 
+    virtual void    Paint( const Rectangle& rRect );
+
 	virtual void	StateChanged( StateChangedType nStateChange );
 	virtual void	DataChanged( const DataChangedEvent& rDCEvt );
 
Index: vcl/inc/threadex.hxx
===================================================================
--- vcl/inc/threadex.hxx.orig	2004-09-12 14:26:21.772962472 +0200
+++ vcl/inc/threadex.hxx	2004-09-12 14:54:44.870052360 +0200
@@ -74,7 +74,7 @@ namespace vcl
 		static void SAL_CALL worker( void* );
 	public:
 		ThreadExecutor();
-		~ThreadExecutor();
+		virtual ~ThreadExecutor();
 
 		virtual long doIt() = 0;
 		long execute();
@@ -88,7 +88,7 @@ namespace vcl
 		DECL_LINK( worker, void* );
 	public:
 		SolarThreadExecutor();
-		~SolarThreadExecutor();
+		virtual ~SolarThreadExecutor();
 
 		virtual long doIt() = 0;
 		long execute();
Index: vcl/inc/timer.hxx
===================================================================
--- vcl/inc/timer.hxx.orig	2004-09-12 14:26:21.772962472 +0200
+++ vcl/inc/timer.hxx	2004-09-12 14:54:44.870052360 +0200
@@ -89,7 +89,7 @@ protected:
 public:
                     Timer();
                     Timer( const Timer& rTimer );
-                    ~Timer();
+	virtual			~Timer();
 
     virtual void    Timeout();
 
Index: vcl/inc/toolbox.hxx
===================================================================
--- vcl/inc/toolbox.hxx.orig	2004-09-12 14:26:21.775962016 +0200
+++ vcl/inc/toolbox.hxx	2004-09-12 14:54:44.872052056 +0200
@@ -202,7 +202,6 @@ private:
     Rectangle           maPaintRect;
     FloatingWindow*     mpFloatWin;
     USHORT              mnKeyModifier;
-	USHORT				mnDummy2;
     long                mnDX;
     long                mnDY;
     long                mnItemWidth;
@@ -250,10 +249,9 @@ private:
                         mbDragging:1,
                         mbHideStatusText:1,
                         mbMenuStrings:1,
-                        mbDummy1_Shift:1,
-                        mbDummy2_KeyEvt:1,
-                        mbDummy3_ChangingHighlight:1,
-                        mbDummy4:1;
+                        mbIsShift:1,
+                        mbIsKeyEvent:1,
+                        mbChangingHighlight:1;
     WindowAlign         meAlign;
     WindowAlign         meDockAlign;
     ButtonType          meButtonType;
@@ -267,8 +265,6 @@ private:
     Link                maSelectHdl;
     Link                maNextToolBoxHdl;
 
-#if _SOLAR__PRIVATE
-#ifdef _SV_TOOLBOX_CXX
     void                ImplInit( Window* pParent, WinBits nStyle );
     void                ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
     void                ImplLoadRes( const ResId& rResId );
@@ -298,12 +294,16 @@ private:
 	void				ImplUpdateInputEnable();
     void				ImplFillLayoutData() const;
                         DECL_LINK( ImplUpdateHdl, void* );
-#endif
+
+#if _SOLAR__PRIVATE
 public:
     void                ImplFloatControl( BOOL bStart, FloatingWindow* pWindow = NULL );
 	void				ImplDisableFlatButtons();
 #endif
 
+protected: 
+    void                SetCurItemId(USHORT nSet) { mnCurItemId = nSet; }
+
 public:
                         ToolBox( Window* pParent, WinBits nStyle = 0 );
                         ToolBox( Window* pParent, const ResId& rResId );
@@ -513,9 +513,9 @@ public:
     void                GetAccessObject( AccessObjectRef& rAcc ) const;
 
     // allow Click Handler to detect special key
-    BOOL                IsShift() const { return mbDummy1_Shift; }
+    BOOL                IsShift() const { return mbIsShift; }
     // allow Click Handler to distinguish between mouse and key input
-    BOOL                IsKeyEvent() const { return mbDummy2_KeyEvt; }
+    BOOL                IsKeyEvent() const { return mbIsKeyEvent; }
 
     // accessibility helpers
 
Index: vcl/inc/unobrok.hxx
===================================================================
--- vcl/inc/unobrok.hxx.orig	2004-09-12 14:26:21.776961864 +0200
+++ vcl/inc/unobrok.hxx	2004-09-12 14:54:44.872052056 +0200
@@ -62,63 +62,9 @@
 #ifndef _UNOBROK_HXX
 #define _UNOBROK_HXX
 
-#include "rvp.hxx"
-
 #include <svdata.hxx>
 #include <vos/thread.hxx>
 
-//  #include <com/sun/star/connection/XAcceptor.hpp>
-
-//  class UnoBrokerThread : public ::vos::OThread
-//  {
-//  public:
-
-//  	UnoBrokerThread(
-//  		const ::com::sun::star::uno::Reference<
-//  		      ::com::sun::star::lang::XMultiServiceFactory > &rSMgr,
-//  		const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > &rInitialObject );
-
-//  	~UnoBrokerThread();
-//  protected:
-	
-//  	virtual void SAL_CALL run();
-//  	virtual void SAL_CALL onTerminated();
-
-//  private:
-
-//  	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_rSMgr;
-//  	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_rInitialObject;
-//  };
-
-
-//  /*****************
-//   * This thread is used, when application is started as appserver
-//   * Note : No security is checked, every user may connect to the application !
-//   *****************/
-//  class vcl_AcceptorThread : public ::vos::OThread
-//  {
-//  public:
-
-//  	vcl_AcceptorThread(
-//  		const ::com::sun::star::uno::Reference<
-//  		      ::com::sun::star::lang::XMultiServiceFactory > &rSMgr,
-//  		const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > &rInitialObject,
-//  		const ::rtl::OUString &sAcceptorParameter);
-
-//  protected:
-	
-//  	virtual void SAL_CALL run();
-//  	virtual void SAL_CALL onTerminated();
-
-//  	virtual void SAL_CALL terminate();
-//  private:
-
-//  	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_rSMgr;
-//  	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_rInitialObject;
-//  	::com::sun::star::uno::Reference< ::com::sun::star::connection::XAcceptor  > m_rAcceptor;
-//  	::rtl::OUString m_sAcceptorDescription;
-//  };
-
 namespace vcl_accept
 {
 	sal_Bool accept(const ::rtl::OUString & accDcp, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> & rSMgr);
Index: vcl/inc/unohelp2.hxx
===================================================================
--- vcl/inc/unohelp2.hxx.orig	2004-09-12 14:26:21.776961864 +0200
+++ vcl/inc/unohelp2.hxx	2004-09-12 14:54:44.873051904 +0200
@@ -74,6 +74,9 @@
 #include <tools/string.hxx>
 #endif
 
+#ifndef _OSL_MUTEX_HXX_
+#include <osl/mutex.hxx>
+#endif
 
 namespace vcl { namespace unohelper {
 
@@ -99,6 +102,14 @@ namespace vcl { namespace unohelper {
 		::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors(  ) throw(::com::sun::star::uno::RuntimeException);
 		sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) throw(::com::sun::star::uno::RuntimeException);
 	};
+	
+	struct MutexHelper
+	{
+	    private:
+	        ::osl::Mutex maMutex;
+	    public:
+	        ::osl::Mutex& GetMutex() { return maMutex; }
+	};
 
 }}	// namespace vcl::unohelper
 
Index: vcl/inc/vclevent.hxx
===================================================================
--- vcl/inc/vclevent.hxx.orig	2004-09-12 14:26:21.777961712 +0200
+++ vcl/inc/vclevent.hxx	2004-09-12 14:54:44.874051752 +0200
@@ -178,6 +178,7 @@ class Menu;
 #define VCLEVENT_TOOLBOX_ITEMENABLED        1168        // pData = itempos
 #define VCLEVENT_TOOLBOX_ITEMDISABLED       1169        // pData = itempos
 #define VCLEVENT_TABPAGE_PAGETEXTCHANGED    1170        // pData = pageid
+#define VCLEVENT_ROADMAP_ITEMSELECTED       1171
 
 // VclMenuEvent
 #define VCLEVENT_MENU_ACTIVATE              1200
@@ -203,8 +204,8 @@ class VclSimpleEvent
 {
 private:
     ULONG nId;
-    
-public:    
+
+public:
     VclSimpleEvent( ULONG n ) { nId = n; }
 	TYPEINFO();
 
@@ -216,11 +217,11 @@ class VclWindowEvent : public VclSimpleE
 private:
     Window* pWindow;
     void*   pData;
-    
-public:    
+
+public:
     VclWindowEvent( Window* pWin, ULONG n, void* pDat = NULL ) : VclSimpleEvent(n) { pWindow = pWin; pData = pDat; }
 	TYPEINFO();
-	
+
 	Window* GetWindow() const { return pWindow; }
 	void*   GetData() const { return pData; }
 };
@@ -230,11 +231,11 @@ class VclMouseEvent : public VclWindowEv
 {
 private:
     MouseEvent aEvent;
-    
-public:    
+
+public:
     VclMouseEvent( Window* pWin, ULONG n, const MouseEvent& rEvent ) : VclWindowEvent( pWin, n ), aEvent(rEvent) { ; }
 	TYPEINFO();
-	
+
 	const MouseEvent& GetEvent() const { return aEvent; }
 };
 */
@@ -244,11 +245,11 @@ class VclMenuEvent : public VclSimpleEve
 private:
     Menu* pMenu;
     USHORT mnPos;
-    
-public:    
+
+public:
     VclMenuEvent( Menu* pM, ULONG n, USHORT nPos ) : VclSimpleEvent(n) { pMenu = pM; mnPos = nPos; }
 	TYPEINFO();
-	
+
 	Menu* GetMenu() const { return pMenu; }
     USHORT GetItemPos() const { return mnPos; }
 };
@@ -261,7 +262,7 @@ public:
 
     // stops notifying when any handler has processed the event
     // and returns TRUE in that case
-    // a handler must return TRUE to signal that it has processed the event 
+    // a handler must return TRUE to signal that it has processed the event
     BOOL Process( VclSimpleEvent* pEvent ) const;
 };
 
Index: vcl/inc/virdev.hxx
===================================================================
--- vcl/inc/virdev.hxx.orig	2004-09-12 14:26:21.778961560 +0200
+++ vcl/inc/virdev.hxx	2004-09-12 14:54:44.875051600 +0200
@@ -78,40 +78,52 @@ class RmVirtualDevice;
 
 class VirtualDevice : public OutputDevice
 {
-private:
+	friend class Application;
+	friend class OutputDevice;
 
-#ifndef REMOTE_APPSERVER
+private:
 	SalVirtualDevice*	mpVirDev;
-#else
-	RmVirtualDevice*	mpVirDev;
-#endif
 	VirtualDevice*		mpPrev;
 	VirtualDevice*		mpNext;
 	USHORT				mnBitCount;
 	BOOL				mbScreenComp;
-	BOOL				mbDummyAlign;
+	sal_Int8			mnAlphaDepth;
+	BYTE				meRefDevMode;
 
-#if _SOLAR__PRIVATE
-	friend class Application;
-	friend class OutputDevice;
-#ifdef _SV_VIRDEV_CXX
 	void				ImplInitVirDev( const OutputDevice* pOutDev, long nDX, long nDY, USHORT nBitCount );
-#endif
-#ifdef REMOTE_APPSERVER
-	RmVirtualDevice*	ImplGetRemoteVirDev() const { return mpVirDev; }
-#endif
-#endif
+	BOOL				ImplSetOutputSizePixel( const Size& rNewSize, BOOL bErase );
 
 public:
 						VirtualDevice( USHORT nBitCount = 0 );
 						VirtualDevice( const OutputDevice& rCompDev,
 									   USHORT nBitCount = 0 );
+    /** Create a virtual device with alpha channel
+        
+    	@param rCompDev
+        The generated vdev will be compatible to this device. By
+        default, Application::GetDefaultDevice() is used here.
+
+        @param nBitCount
+        Bit depth of the generated virtual device. Use 0 here, to
+        indicate: take default screen depth. Currently, only 0 and 1
+        are allowed here, with 1 denoting binary mask.
+
+        @param nAlphaBitCount
+        Bit depth of the generated virtual device. Use 0 here, to
+        indicate: take default screen depth. Currently, only 0 and 1
+        are allowed here, with 1 denoting binary mask.
+     */
+						VirtualDevice( const OutputDevice& rCompDev,
+									   USHORT nBitCount, USHORT nAlphaBitCount );
 	virtual 			~VirtualDevice();
 
-    void                SetReferenceDevice();
 	BOOL				SetOutputSizePixel( const Size& rNewSize, BOOL bErase = TRUE );
 	BOOL				SetOutputSize( const Size& rNewSize, BOOL bErase = TRUE )
 							{ return SetOutputSizePixel( LogicToPixel( rNewSize ), bErase ); }
+
+    // reference device modes for different compatibility levels
+    enum RefDevMode { REFDEV_NONE=0, REFDEV_MODE06, REFDEV_MODE48, REFDEV_MODE96 };
+    void                SetReferenceDevice( RefDevMode eMode = VirtualDevice::REFDEV_MODE06 );
 };
 
 #endif // _SV_VIRDEV_HXX
Index: vcl/inc/wall.hxx
===================================================================
--- vcl/inc/wall.hxx.orig	2004-09-12 14:26:21.779961408 +0200
+++ vcl/inc/wall.hxx	2004-09-12 14:54:44.876051448 +0200
@@ -65,13 +65,14 @@
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
-#ifndef _SV_COLOR_HXX
-#include <color.hxx>
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
 #endif
 
 class Rectangle;
 class Gradient;
 class BitmapEx;
+class ImplWallpaper;
 
 // -------------------
 // - Wallpaper-Types -
@@ -113,40 +114,6 @@ enum WallpaperStyle 
 
 #endif
 
-// -----------------
-// - ImplWallpaper -
-// -----------------
-
-class SvStream;
-
-class ImplWallpaper
-{
-	friend class Wallpaper;
-
-private:
-	Color			maColor;
-	BitmapEx*		mpBitmap;
-	Gradient*		mpGradient;
-	Rectangle*		mpRect;
-	WallpaperStyle	meStyle;
-	USHORT			mnRefCount;
-	BitmapEx*		mpCache;
-
-	friend SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper );
-	friend SvStream& operator<<( SvStream& rOStm, const ImplWallpaper& rImplWallpaper );
-
-#ifdef _SV_WALL_CXX
-public:
-					ImplWallpaper();
-					ImplWallpaper( const ImplWallpaper& rImplWallpaper );
-					~ImplWallpaper();
-
-	void			ImplSetCachedBitmap( BitmapEx& rBmp );
-	const BitmapEx*	ImplGetCachedBitmap() { return mpCache; }
-	void			ImplReleaseCachedBitmap();
-#endif
-};
-
 // -------------
 // - Wallpaper -
 // -------------
@@ -156,8 +123,9 @@ class Wallpaper
 private:
 	ImplWallpaper*	mpImplWallpaper;
 
-#ifdef _SV_WALL_CXX
 	void			ImplMakeUnique( BOOL bReleaseCache = TRUE );
+
+#if _SOLAR__PRIVATE
 public:
 	ImplWallpaper*	ImplGetImpWallpaper() const { return mpImplWallpaper; }
 #endif
@@ -171,25 +139,25 @@ public:
 					~Wallpaper();
 
 	void			SetColor( const Color& rColor );
-	const Color&	GetColor() const { return mpImplWallpaper->maColor; }
+	const Color&	GetColor() const;
 
 	void			SetStyle( WallpaperStyle eStyle );
-	WallpaperStyle	GetStyle() const { return mpImplWallpaper->meStyle; }
+	WallpaperStyle	GetStyle() const;
 
 	void			SetBitmap( const BitmapEx& rBitmap );
 	void			SetBitmap();
 	BitmapEx		GetBitmap() const;
-	BOOL			IsBitmap() const { return (mpImplWallpaper->mpBitmap != 0); }
+	BOOL			IsBitmap() const;
 
 	void			SetGradient( const Gradient& rGradient );
 	void			SetGradient();
 	Gradient		GetGradient() const;
-	BOOL			IsGradient() const { return (mpImplWallpaper->mpGradient != 0); }
+	BOOL			IsGradient() const;
 
 	void			SetRect( const Rectangle& rRect );
 	void			SetRect();
 	Rectangle		GetRect() const;
-	BOOL			IsRect() const { return (mpImplWallpaper->mpRect != 0); }
+	BOOL			IsRect() const;
 
 	BOOL			IsFixed() const;
 	BOOL			IsScrollable() const;
Index: vcl/inc/wall2.hxx
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ vcl/inc/wall2.hxx	2004-09-12 14:54:44.876051448 +0200
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ *  
+ *
+ *  
+ *
+ *  
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_WALL2_HXX
+#define _SV_WALL2_HXX
+
+#ifndef _SV_WALL_HXX
+#include <wall.hxx>
+#endif
+
+class ImplWallpaper
+{
+	friend class Wallpaper;
+
+private:
+	Color			maColor;
+	BitmapEx*		mpBitmap;
+	Gradient*		mpGradient;
+	Rectangle*		mpRect;
+	WallpaperStyle	meStyle;
+	USHORT			mnRefCount;
+	BitmapEx*		mpCache;
+
+	friend SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper );
+	friend SvStream& operator<<( SvStream& rOStm, const ImplWallpaper& rImplWallpaper );
+
+public:
+					ImplWallpaper();
+					ImplWallpaper( const ImplWallpaper& rImplWallpaper );
+					~ImplWallpaper();
+
+	void			ImplSetCachedBitmap( BitmapEx& rBmp );
+	const BitmapEx*	ImplGetCachedBitmap() { return mpCache; }
+	void			ImplReleaseCachedBitmap();
+};
+
+
+#endif	// _SV_WALL2_HXX
Index: vcl/inc/windata.hxx
===================================================================
--- vcl/inc/windata.hxx.orig	2004-09-12 14:26:21.781961104 +0200
+++ vcl/inc/windata.hxx	2004-09-12 14:54:44.877051296 +0200
@@ -72,15 +72,7 @@ class SalFrame;
 // - Prototypes -
 // --------------
 
-#ifndef REMOTE_APPSERVER
-	long ImplWindowFrameProc( void* pInst, SalFrame* pFrame,
-                          		USHORT nEvent, const void* pEvent );
-#else
-	class ExtRmEvent;
-    class Window;
-	void ImplRemoteWindowFrameProc( ExtRmEvent* pEvent );
-    void ImplUpdateCursorRect( Window *pWindow );
-#endif
+long ImplWindowFrameProc( void* pInst, SalFrame* pFrame, USHORT nEvent, const void* pEvent );
 
 // -----------
 // - HitTest -
Index: vcl/inc/window.h
===================================================================
--- vcl/inc/window.h.orig	2004-09-12 14:26:21.782960952 +0200
+++ vcl/inc/window.h	2004-09-12 14:54:44.878051144 +0200
@@ -86,6 +86,7 @@ class VirtualDevice;
 struct SalPaintEvent;
 class ImplDevFontList;
 class ImplFontCache;
+class SalControlHandle;
 
 namespace com {
 namespace sun {
@@ -113,6 +114,10 @@ struct ImplWinData
     Rectangle*          mpFocusRect;
     Rectangle*          mpTrackRect;
     USHORT              mnTrackFlags;
+    USHORT				mnIsTopWindow;
+    BOOL                mbMouseOver;          // tracks mouse over for native widget paint effect
+    SalControlHandle*   mpSalControlHandle;   // native data for NWF
+    BOOL                mbEnableNativeWidget; // toggle native widget rendering
 };
 
 // -------------------
@@ -145,16 +150,18 @@ struct ImplFrameData
     Window*             mpFirstBackWin;     // Erstes Overlap-Window mit Hintergrund-Sicherung
     ImplDevFontList*    mpFontList;         // Font-List for this frame
     ImplFontCache*      mpFontCache;        // Font-Cache for this frame
-    long                mnDPIX;             // Original Screen Resolution
-    long                mnDPIY;             // Original Screen Resolution
-    long                mnFontDPIX;         // Original Font Resolution
-    long                mnFontDPIY;         // Original Font Resolution
+    sal_Int32           mnDPIX;             // Original Screen Resolution
+    sal_Int32           mnDPIY;             // Original Screen Resolution
+    sal_Int32           mnFontDPIX;         // Original Font Resolution
+    sal_Int32           mnFontDPIY;         // Original Font Resolution
     ImplMapRes          maMapUnitRes;       // for LogicUnitToPixel
     ULONG               mnAllSaveBackSize;  // Groesse aller Bitmaps fuer Hintergrund-Sicherung
     ULONG               mnFocusId;          // FocusId for PostUserLink
     ULONG               mnMouseMoveId;      // MoveId for PostUserLink
     long                mnLastMouseX;       // last x mouse position
     long                mnLastMouseY;       // last y mouse position
+    long                mnBeforeLastMouseX; // last but one x mouse position
+    long                mnBeforeLastMouseY; // last but one y mouse position
     long                mnFirstMouseX;      // first x mouse position by mousebuttondown
     long                mnFirstMouseY;      // first y mouse position by mousebuttondown
     long                mnLastMouseWinX;    // last x mouse position, rel. to pMouseMoveWin
Index: vcl/inc/window.hxx
===================================================================
--- vcl/inc/window.hxx.orig	2004-09-12 14:26:21.786960344 +0200
+++ vcl/inc/window.hxx	2004-09-12 14:54:44.881050688 +0200
@@ -68,8 +68,8 @@
 #ifndef _SV_OUTDEV_HXX
 #include <outdev.hxx>
 #endif
-#ifndef _SV_RESID_HXX
-#include <resid.hxx>
+#ifndef _TOOLS_RESID_HXX
+#include <tools/resid.hxx>
 #endif
 #ifndef _SV_POINTR_HXX
 #include <pointr.hxx>
@@ -91,12 +91,20 @@
 #include <event.hxx>
 #endif
 
-#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
-#include <com/sun/star/uno/Reference.hxx>
+#ifndef _SV_REGION_HXX
+#include <region.hxx>
+#endif
+
+#ifndef _SV_NATIVEWIDGETS_HXX
+#include <salnativewidgets.hxx>
+#endif
+
+#ifndef _RTL_USTRING_HXX_
+#include <rtl/ustring.hxx>
 #endif
 
-#ifdef REMOTE_APPSERVER
-#include "rvp.hxx"
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
+#include <com/sun/star/uno/Reference.hxx>
 #endif
 
 class VirtualDevice;
@@ -144,6 +152,7 @@ namespace sun {
 namespace star {
 namespace awt {
     class XWindowPeer;
+       class XWindow;
 }
 namespace uno {
     class Any;
@@ -335,26 +344,55 @@ typedef USHORT StateChangedType;
 #define EXTTEXTINPUT_END_COMPLETE       ((USHORT)0x0001)
 #define EXTTEXTINPUT_END_CANCEL         ((USHORT)0x0002)
 
+#if _SOLAR__PRIVATE
+#define IMPL_MINSIZE_BUTTON_WIDTH       70
+#define IMPL_MINSIZE_BUTTON_HEIGHT      22
+#define IMPL_EXTRA_BUTTON_WIDTH         18
+#define IMPL_EXTRA_BUTTON_HEIGHT        10
+#define IMPL_SEP_BUTTON_X               5
+#define IMPL_SEP_BUTTON_Y               5
+#define IMPL_MINSIZE_MSGBOX_WIDTH       150
+#define IMPL_MINSIZE_MSGBOX_HEIGHT      80
+#define IMPL_DIALOG_OFFSET              5
+#define IMPL_DIALOG_BAR_OFFSET          3
+#define IMPL_MSGBOX_OFFSET_EXTRA_X      0
+#define IMPL_MSGBOX_OFFSET_EXTRA_Y      2
+#define IMPL_SEP_MSGBOX_IMAGE           8
+#define IMPL_SEP_BUTTON_IMAGE           4
+
+#define DLGWINDOW_PREV                  0
+#define DLGWINDOW_NEXT                  1
+#define DLGWINDOW_FIRST                 2
+#endif
+
 // ----------
 // - Window -
 // ----------
 
 class Window : public OutputDevice
 {
+    friend class Cursor;
+    friend class OutputDevice;
+    friend class Application;
+    friend class SystemWindow;
+    friend class WorkWindow;
+    friend class Dialog;
+    friend class MessBox;
+    friend class DockingWindow;
+    friend class FloatingWindow;
+    friend class GroupBox;
+    friend class PushButton;
+    friend class RadioButton;
+    friend class SystemChildWindow;
+    friend class ImplBorderWindow;
+
 private:
     ImplWinData*        mpWinData;
     ImplOverlapData*    mpOverlapData;
     ImplFrameData*      mpFrameData;
-#ifndef REMOTE_APPSERVER
     SalFrame*           mpFrame;
     SalObject*          mpSysObj;
     void*               mpRmEvents;
-#else
-    friend class ExtRmEvent;
-    RmFrameWindow*      mpFrame;
-    void*               mpSysObj;
-    ExtRmEvent*         mpRmEvents;
-#endif
     Window*             mpFrameWindow;
     Window*             mpOverlapWindow;
     Window*             mpBorderWindow;
@@ -385,14 +423,13 @@ private:
     Font*               mpControlFont;
     Color               maControlForeground;
     Color               maControlBackground;
-    long                mnLeftBorder;
-    long                mnTopBorder;
-    long                mnRightBorder;
-    long                mnBottomBorder;
+    sal_Int32           mnLeftBorder;
+    sal_Int32           mnTopBorder;
+    sal_Int32           mnRightBorder;
+    sal_Int32           mnBottomBorder;
     long                mnX;
     long                mnY;
     long                mnAbsScreenX;
-    long                mnDummy2;
     Point               maPos;
     ULONG               mnHelpId;
     ULONG               mnUniqId;
@@ -413,8 +450,6 @@ private:
     WinBits             mnExtendedStyle;
     WinBits             mnPrevExtendedStyle;
     WindowType          mnType;
-    LanguageType        meDummy1;
-    CharSet             meDummy2;
     USHORT              mnWaitCount;
     USHORT              mnPaintFlags;
     USHORT              mnGetFocusFlags;
@@ -422,8 +457,6 @@ private:
     USHORT              mnActivateMode;
     USHORT              mnDlgCtrlFlags;
     USHORT              mnLockCount;
-    USHORT              mnDummy3;
-    USHORT              mnIsTopWindow;
     BOOL                mbFrame:1,
                         mbBorderWin:1,
                         mbOverlapWin:1,
@@ -490,9 +523,176 @@ private:
                         mbDrawSelectionBackground:1;
 
     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
+    void                ImplInitData( WindowType nType );
+
 
 #if _SOLAR__PRIVATE
-#include <window.imp>
+
+#ifdef DBG_UTIL
+    friend const char* ImplDbgCheckWindow( const void* pObj );
+#endif
+
+public:
+    void                ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData );
+    void                ImplInit( Window* pParent, WinBits nStyle, const ::com::sun::star::uno::Any& aSystemWorkWindowToken );
+    WinBits             ImplInitRes( const ResId& rResId );
+    void                ImplLoadRes( const ResId& rResId );
+    void                ImplWindowRes( const ResId& rResId );
+    void				ImplSetFrameParent( const Window* pParent );
+    void                ImplInsertWindow( Window* pParent );
+    void                ImplRemoveWindow( BOOL bRemoveFrameData );
+    Window*             ImplGetWindow() { if ( mpClientWindow ) return mpClientWindow; else return this; }
+    ImplFrameData*      ImplGetFrameData() { return mpFrameData; }
+    SalFrame*           ImplGetFrame() const { return mpFrame; }
+    ImplWinData*        ImplGetWinData() const;
+    SalGraphics*        ImplGetFrameGraphics() const;
+    void                ImplCallFocusChangeActivate( Window* pNewOverlapWindow, Window* pOldOverlapWindow );
+    Window*             ImplFindWindow( const Point& rFramePos );
+    USHORT              ImplHitTest( const Point& rFramePos );
+    Window*             ImplGetParent() const { return mpParent; }
+    Window*             ImplGetClientWindow() const { return mpClientWindow; }
+    Window*             ImplGetBorderWindow() const { return mpBorderWindow; }
+    Window*             ImplGetFirstOverlapWindow() { if ( mbOverlapWin ) return this; else return mpOverlapWindow; }
+    const Window*       ImplGetFirstOverlapWindow() const { if ( mbOverlapWin ) return this; else return mpOverlapWindow; }
+    Window*             ImplGetFrameWindow() const { return mpFrameWindow; }
+    BOOL                ImplIsRealParentPath( const Window* pWindow ) const;
+    BOOL                ImplIsChild( const Window* pWindow, BOOL bSystemWindow = FALSE ) const;
+    BOOL                ImplIsWindowOrChild( const Window* pWindow, BOOL bSystemWindow = FALSE ) const;
+    Window*             ImplGetSameParent( const Window* pWindow ) const;
+    BOOL                ImplIsDockingWindow() const { return mbDockWin; }
+    BOOL                ImplIsFloatingWindow() const { return mbFloatWin; }
+    BOOL                ImplIsToolbox() const { return mbToolBox; }
+    BOOL                ImplIsSplitter() const { return mbSplitter; }
+    BOOL                ImplIsPushButton() const { return mbPushButton; }
+    BOOL                ImplIsOverlapWindow() const { return mbOverlapWin; }
+    void                ImplSetActive( BOOL bActive ) { mbActive = bActive; }
+    BOOL                ImplIsMouseTransparent() const { return mbMouseTransparent; }
+    void                ImplSetMouseTransparent( BOOL bTransparent ) { mbMouseTransparent = bTransparent; }
+    int                 ImplTestMousePointerSet();
+    PointerStyle        ImplGetMousePointer() const;
+    void                ImplResetReallyVisible();
+    void                ImplSetReallyVisible();
+    void                ImplCallInitShow();
+    void                ImplAddDel( ImplDelData* pDel );
+    void                ImplRemoveDel( ImplDelData* pDel );
+    void                ImplInitResolutionSettings();
+    void                ImplPointToLogic( Font& rFont ) const;
+    void                ImplLogicToPoint( Font& rFont ) const;
+    Point               ImplOutputToFrame( const Point& rPos )
+                            { return Point( rPos.X()+mnOutOffX, rPos.Y()+mnOutOffY ); }
+    Point               ImplFrameToOutput( const Point& rPos )
+                            { return Point( rPos.X()-mnOutOffX, rPos.Y()-mnOutOffY ); }
+    void                ImplOutputToFrame( Rectangle& rRect )
+                            { rRect.Left()+=mnOutOffX; rRect.Top()+=mnOutOffY;
+                              rRect.Right()+=mnOutOffX; rRect.Bottom()+=mnOutOffY; }
+    void                ImplFrameToOutput( Rectangle& rRect )
+                            { rRect.Left()-=mnOutOffX; rRect.Top()-=mnOutOffY;
+                              rRect.Right()-=mnOutOffX; rRect.Bottom()-=mnOutOffY; }
+    BOOL                ImplSysObjClip( const Region* pOldRegion );
+    void                ImplUpdateSysObjChildsClip();
+    void                ImplUpdateSysObjOverlapsClip();
+    void                ImplUpdateSysObjClip();
+    BOOL                ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller = FALSE );
+    BOOL                ImplSetClipFlagOverlapWindows( BOOL bSysObjOnlySmaller = FALSE );
+    BOOL                ImplSetClipFlag( BOOL bSysObjOnlySmaller = FALSE );
+    void                ImplIntersectWindowClipRegion( Region& rRegion );
+    void                ImplIntersectWindowRegion( Region& rRegion );
+    void                ImplExcludeWindowRegion( Region& rRegion );
+    void                ImplExcludeOverlapWindows( Region& rRegion );
+    void                ImplExcludeOverlapWindows2( Region& rRegion );
+    void                ImplClipBoundaries( Region& rRegion, BOOL bThis, BOOL bOverlaps );
+    BOOL                ImplClipChilds( Region& rRegion );
+    void                ImplClipAllChilds( Region& rRegion );
+    void                ImplClipSiblings( Region& rRegion );
+    void                ImplInitWinClipRegion();
+    void                ImplInitWinChildClipRegion();
+    Region*             ImplGetWinChildClipRegion();
+    void                ImplIntersectAndUnionOverlapWindows( const Region& rInterRegion, Region& rRegion );
+    void                ImplIntersectAndUnionOverlapWindows2( const Region& rInterRegion, Region& rRegion );
+    void                ImplCalcOverlapRegionOverlaps( const Region& rInterRegion, Region& rRegion );
+    void                ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegion,
+                                               BOOL bChilds, BOOL bParent, BOOL bSiblings );
+    void                ImplCallPaint( const Region* pRegion, USHORT nPaintFlags );
+    void                ImplCallOverlapPaint();
+    void                ImplPostPaint();
+    void                ImplInvalidateFrameRegion( const Region* pRegion, USHORT nFlags );
+    void                ImplInvalidateOverlapFrameRegion( const Region& rRegion );
+    void                ImplInvalidateParentFrameRegion( Region& rRegion );
+    void                ImplInvalidate( const Region* rRegion, USHORT nFlags );
+    void                ImplValidateFrameRegion( const Region* rRegion, USHORT nFlags );
+    void                ImplValidate( const Region* rRegion, USHORT nFlags );
+    void                ImplMoveInvalidateRegion( const Rectangle& rRect, long nHorzScroll, long nVertScroll, BOOL bChilds );
+    void                ImplMoveAllInvalidateRegions( const Rectangle& rRect, long nHorzScroll, long nVertScroll, BOOL bChilds );
+    void                ImplScroll( const Rectangle& rRect, long nHorzScroll, long nVertScroll, USHORT nFlags );
+    void                ImplUpdateAll( BOOL bOverlapWindows = TRUE );
+    void                ImplUpdateWindowPtr( Window* pWindow );
+    void                ImplUpdateWindowPtr();
+    void                ImplUpdateOverlapWindowPtr( BOOL bNewFrame );
+    BOOL                ImplUpdatePos();
+    void                ImplUpdateSysObjPos();
+    void                ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl = TRUE );
+    void                ImplAlignChilds();
+    void                ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+    void                ImplToBottomChild();
+    void                ImplCalcToTop( ImplCalcToTopData* pPrevData );
+    void                ImplCalcChildOverlapToTop( ImplCalcToTopData* pPrevData );
+    void                ImplToTop( USHORT nFlags );
+    void                ImplStartToTop( USHORT nFlags );
+    void                ImplFocusToTop( USHORT nFlags, BOOL bReallyVisible );
+    void                ImplShowAllOverlaps();
+    void                ImplHideAllOverlaps();
+    void                ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt );
+    void                ImplCallMouseMove( USHORT nMouseCode, BOOL bModChanged = FALSE );
+    void                ImplGenerateMouseMove();
+    void                ImplGrabFocus( USHORT nFlags );
+    void                ImplInvertFocus( const Rectangle& rRect );
+    void                ImplControlFocus( USHORT nFlags = 0 );
+    Window*             ImplGetDlgWindow( USHORT n, USHORT nType, USHORT nStart = 0, USHORT nEnd = 0xFFFF, USHORT* pIndex = NULL );
+    BOOL                ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput );
+    BOOL                ImplHasDlgCtrl();
+    void                ImplDlgCtrlNextWindow();
+    void                ImplDlgCtrlFocusChanged( Window* pWindow, BOOL bGetFocus );
+    Window*             ImplFindDlgCtrlWindow( Window* pWindow );
+    long                ImplLogicUnitToPixelX( long nX, MapUnit eUnit );
+    long                ImplLogicUnitToPixelY( long nY, MapUnit eUnit );
+    BOOL                ImplIsWindowInFront( const Window* pTestWindow ) const;
+    void                ImplSaveOverlapBackground();
+    BOOL                ImplRestoreOverlapBackground( Region& rInvRegion );
+    void                ImplDeleteOverlapBackground();
+    void                ImplInvalidateAllOverlapBackgrounds();
+    static void         ImplNewInputContext();
+    void                ImplCallActivateListeners(Window*);
+    void                ImplCallDeactivateListeners(Window*);
+                        DECL_LINK( ImplHandlePaintHdl, void* );
+                        DECL_LINK( ImplGenerateMouseMoveHdl, void* );
+                        DECL_LINK( ImplTrackTimerHdl, Timer* );
+                        DECL_LINK( ImplAsyncFocusHdl, void* );
+                        DECL_LINK( ImplAsyncStateChangedHdl, void* );
+
+    static void         ImplCalcSymbolRect( Rectangle& rRect );
+    void                ImplHandleScroll( ScrollBar* pHScrl, long nX, ScrollBar* pVScrl, long nY );
+    BOOL                ImplGetCurrentBackgroundColor( Color& rCol );
+    BOOL                ImplIsAccessibleCandidate() const;
+    BOOL                ImplIsAccessibleNativeFrame() const;
+    USHORT              ImplGetAccessibleCandidateChildWindowCount( USHORT nFirstWindowType ) const;
+    Window*             ImplGetAccessibleCandidateChild( USHORT nChild, USHORT& rChildCount, USHORT nFirstWindowType, BOOL bTopLevel = TRUE ) const;
+    BOOL                ImplRegisterAccessibleNativeFrame();
+    void                ImplRevokeAccessibleNativeFrame();
+    void                ImplCallResize();
+    void                ImplCallMove();
+    Rectangle           ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle& rRect ) const;
+    void                ImplMirrorFramePos( Point &pt ) const;
+    long                ImplGetUnmirroredOutOffX();
+    void                ImplIncModalCount();
+    void                ImplDecModalCount();
+
+    Rectangle           ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly );
+    void                ImplNotifyIconifiedState( BOOL bIconified );
+    bool				ImplStopDnd();
+    void				ImplStartDnd();
+
+    static void			ImplInitAppFontData( Window* pWindow );
+    void                ImplInitSalControlHandle();
 #endif
 
 protected:
@@ -573,8 +773,8 @@ public:
 
     void                SetBorderStyle( USHORT nBorderStyle );
     USHORT              GetBorderStyle() const;
-    void                GetBorder( long& rLeftBorder, long& rTopBorder,
-                                   long& rRightBorder, long& rBottomBorder ) const;
+    void                GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+                                   sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
     Size                CalcWindowSize( const Size& rOutSz ) const;
     Size                CalcOutputSize( const Size& rWinSz ) const;
     long                CalcTitleWidth() const;
@@ -594,6 +794,8 @@ public:
     void                SetDialogControlFlags( USHORT nFlags ) { mnDlgCtrlFlags = nFlags; }
     USHORT              GetDialogControlFlags() const { return mnDlgCtrlFlags; }
 
+    BOOL                IsMouseOver();
+
     ULONG               GetCurrentModButtons();
 
     void                SetInputContext( const InputContext& rInputContext );
@@ -616,7 +818,7 @@ public:
     void                SetZoomedPointFont( const Font& rFont );
     long                GetDrawPixel( OutputDevice* pDev, long nPixels ) const;
     Font                GetDrawPixelFont( OutputDevice* pDev ) const;
-    void                GetFontResolution( long& nDPIX, long& nDPIY ) const;
+    void                GetFontResolution( sal_Int32& nDPIX, sal_Int32& nDPIY ) const;
 
     void                SetControlFont();
     void                SetControlFont( const Font& rFont );
@@ -641,6 +843,10 @@ public:
     Region              GetWindowClipRegionPixel( USHORT nFlags = 0 ) const;
     Region              GetPaintRegion() const;
     BOOL                IsInPaint() const { return mbInPaint; }
+    // while IsInPaint returns true ExpandPaintClipRegion adds the
+    // submitted region to the paint clip region so you can
+    // paint additional parts of your window if necessary
+    void				ExpandPaintClipRegion( const Region& rRegion );
 
     void                SetParent( Window* pNewParent );
     Window*             GetParent() const { return mpRealParent; }
@@ -687,8 +893,12 @@ public:
     BOOL                IsDefaultPos() const { return mbDefPos; }
     BOOL                IsDefaultSize() const { return mbDefSize; }
 
+    // those conversion routines might deliver different results during UI mirroring
     Point               OutputToScreenPixel( const Point& rPos ) const;
     Point               ScreenToOutputPixel( const Point& rPos ) const;
+    //  the normalized screen methods work independent from UI mirroring
+    Point               OutputToNormalizedScreenPixel( const Point& rPos ) const;
+    Point               NormalizedScreenToOutputPixel( const Point& rPos ) const;
     Point               OutputToAbsoluteScreenPixel( const Point& rPos ) const;
     Point               AbsoluteScreenToOutputPixel( const Point& rPos ) const;
     Rectangle           GetDesktopRectPixel() const;
@@ -753,6 +963,7 @@ public:
     BOOL                IsChildPointerOverwrite() const { return mbChildPtrOverwrite; }
     void                SetPointerPosPixel( const Point& rPos );
     Point               GetPointerPosPixel();
+    Point               GetLastPointerPosPixel();
     void                ShowPointer( BOOL bVisible );
     BOOL                IsPointerVisible() const { return !mbNoPtrVisible; }
     void                EnterWait();
@@ -852,11 +1063,11 @@ public:
     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible( BOOL bCreate = TRUE );
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
 	void SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > );
-	
+
     Window* GetAccessibleParentWindow() const;
     USHORT  GetAccessibleChildWindowCount();
     Window* GetAccessibleChildWindow( USHORT n );
-    
+
     void    SetAccessibleRole( USHORT nRole );
     USHORT  GetAccessibleRole() const;
 
@@ -900,6 +1111,52 @@ public:
     // Clipboard/Selection interfaces
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetClipboard();
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetSelection();
+
+    //-------------------------------------
+    //  Native Widget Rendering functions
+    //-------------------------------------
+
+    // form controls must never use native widgets, this can be toggled here
+    void    EnableNativeWidget( BOOL bEnable = TRUE );
+    BOOL    IsNativeWidgetEnabled() const;
+
+    // These all just call through to the private mpFrame functions of the same name.
+
+    // Query the platform layer for control support
+    BOOL					IsNativeControlSupported( ControlType nType, ControlPart nPart );
+
+    // Query the native control to determine if it was acted upon
+    BOOL				HitTestNativeControl( ControlType nType,
+									  ControlPart nPart,
+									  const Region& rControlRegion,
+									  const Point& aPos,
+									  BOOL& rIsInside );
+
+    // Request rendering of a particular control and/or part
+    BOOL				DrawNativeControl(    ControlType nType,
+									  ControlPart nPart,
+									  const Region& rControlRegion,
+									  ControlState nState,
+									  const ImplControlValue& aValue,
+									  rtl::OUString aCaption );
+
+     // Request rendering of a caption string for a control
+    BOOL				DrawNativeControlText(     ControlType nType,
+										  ControlPart nPart,
+										  const Region& rControlRegion,
+										  ControlState nState,
+										  const ImplControlValue& aValue,
+										  rtl::OUString aCaption );
+
+    // Query the native control's actual drawing region (including adornment)
+    BOOL				GetNativeControlRegion(  ControlType nType,
+										  ControlPart nPart,
+										  const Region& rControlRegion,
+										  ControlState nState,
+										  const ImplControlValue& aValue,
+										  rtl::OUString aCaption,
+										  Region &rNativeBoundingRegion,
+										  Region &rNativeContentRegion );
 };
 
 inline void Window::SetPosPixel( const Point& rNewPos )
Index: vcl/inc/wintypes.hxx
===================================================================
--- vcl/inc/wintypes.hxx.orig	2004-09-12 14:26:21.787960192 +0200
+++ vcl/inc/wintypes.hxx	2004-09-12 14:54:44.882050536 +0200
@@ -154,14 +154,15 @@ typedef USHORT WindowType;
 #define WINDOW_TREELISTBOX	        (WINDOW_FIRST + 0x4d)
 #define WINDOW_HELPTEXTWINDOW		(WINDOW_FIRST + 0x4e)
 #define WINDOW_INTROWINDOW		    (WINDOW_FIRST + 0x4f)
-#define WINDOW_LAST 				(WINDOW_INTROWINDOW)
+#define WINDOW_LISTBOXWINDOW        (WINDOW_FIRST + 0x50)
+#define WINDOW_LAST 				(WINDOW_LISTBOXWINDOW)
 
 
 // ---------------
 // - Window-Bits -
 // ---------------
 
-// By changes you must also change: tools/vclrsc.hxx
+// By changes you must also change: rsc/vclrsc.hxx
 typedef sal_Int64 WinBits;
 
 // Window-Bits fuer Window
Index: vcl/inc/wrkwin.hxx
===================================================================
--- vcl/inc/wrkwin.hxx.orig	2004-09-12 14:26:21.788960040 +0200
+++ vcl/inc/wrkwin.hxx	2004-09-12 14:54:44.882050536 +0200
@@ -96,20 +96,10 @@ private:
     BOOL            mbPresentationMode:1,
                     mbPresentationVisible:1,
                     mbPresentationFull:1,
-                    mbFullScreenMode:1,
-                    mbDummy0:1,
-                    mbDummy1:1,
-                    mbDummy2:1,
-                    mbDummy3:1,
-                    mbDummy4:1,
-                    mbDummy5:1,
-                    mbDummy6:1,
-                    mbDummy7:1;
+                    mbFullScreenMode:1;
 
-#ifdef _SV_WRKWIN_CXX
     void            ImplInitData();
     void            ImplInit( Window* pParent, WinBits nStyle, const ::com::sun::star::uno::Any& aSystemWorkWindowToken );
-#endif
 
 protected:
                     WorkWindow( WindowType nType );
@@ -124,6 +114,8 @@ public:
                     WorkWindow( SystemParentData* pParent ); // Not in the REMOTE-Version
                     ~WorkWindow();
 
+    virtual BOOL    Close();
+
     void            ShowFullScreenMode( BOOL bFullScreenMode = TRUE );
     void            EndFullScreenMode() { ShowFullScreenMode( FALSE ); }
     BOOL            IsFullScreenMode() const { return mbFullScreenMode; }
@@ -136,16 +128,14 @@ public:
 
     BOOL			SetPluginParent( SystemParentData* pParent );
 
-#ifndef NOOLDSV
     void            Minimize();
-    void            Maximize();
     void            Restore();
 
-    BOOL            IsMaximized() const;
 
     void            SetOptOutputSizePixel( const Size& ) {}
     Size            GetOptOutputSizePixel() const { return Size(); }
-#endif
+    void			Maximize( BOOL bMaximize = TRUE );
+    BOOL			IsMaximized();
 };
 
 #endif // _SV_WRKWIN_HXX
Index: vcl/inc/xconnection.hxx
===================================================================
--- vcl/inc/xconnection.hxx.orig	2004-09-12 14:26:21.789959888 +0200
+++ vcl/inc/xconnection.hxx	2004-09-12 14:54:44.883050384 +0200
@@ -78,7 +78,7 @@
 #include <com/sun/star/uno/Reference.hxx>
 #endif
 
-#ifndef __SGI_STL_LIST
+#ifndef _STLP_LIST
 #include <list>
 #endif