summaryrefslogtreecommitdiffstats
path: root/src/vtk-7-mingw-w64-git.patch
blob: 9a3f49190cee3ec3a4b957c3f3c89b7a8c90b529 (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
This file is part of MXE.
See index.html for further information.

This patch has been taken from the git url below:

From: David Partyka <david.partyka@kitware.com>
Date: Wed, 21 Sep 2011 13:19:30 +0000 (-0400)
Subject: Merge branch '11742_mingw64_compile_fixes' into release
X-Git-Tag: v5.10.0-rc1~108^2~1
X-Git-Url: http://vtk.org/gitweb?p=VTK.git;a=commitdiff_plain;h=be64234e8399145f1e2c099500779a9bcff75702;hp=7b4ad680f6b2b4b4211baf47de6588308db7e14f

Merge branch '11742_mingw64_compile_fixes' into release
---

diff --git a/Common/vtkWin32Header.h b/Common/vtkWin32Header.h
index 81b094a..a3edb90 100644
--- a/Common/vtkWin32Header.h
+++ b/Common/vtkWin32Header.h
@@ -102,9 +102,15 @@ Do_not_include_vtkWin32Header_directly__vtkSystemIncludes_includes_it;
 #  define vtkGetWindowLong GetWindowLong
 #  define vtkSetWindowLong SetWindowLong
 #  define vtkLONG LONG
+#  ifdef _WIN64
+#    define vtkGWL_WNDPROC GWLP_WNDPROC
+#    define vtkGWL_HINSTANCE GWLP_HINSTANCE
+#    define vtkGWL_USERDATA GWLP_USERDATA
+#  else
 #  define vtkGWL_WNDPROC GWL_WNDPROC
 #  define vtkGWL_HINSTANCE GWL_HINSTANCE
 #  define vtkGWL_USERDATA GWL_USERDATA
+#  endif
 #endif //
 
 #endif
diff --git a/Hybrid/vtkVideoSource.cxx b/Hybrid/vtkVideoSource.cxx
index 1fcdbe1..c40b845 100644
--- a/Hybrid/vtkVideoSource.cxx
+++ b/Hybrid/vtkVideoSource.cxx
@@ -32,9 +32,9 @@
 
 //---------------------------------------------------------------
 // Important FrameBufferMutex rules:
-// 
+//
 // The frame grabs are generally done asynchronously, and it is necessary
-// to ensure that when the frame buffer is valid when it is being written 
+// to ensure that when the frame buffer is valid when it is being written
 // to or read from
 //
 // The following information can only be changed within a mutex lock,
@@ -59,8 +59,8 @@
 //
 // AdvanceFrameBuffer()
 //
-// Any methods which might be called asynchronously must lock the 
-// mutex before reading the above information, and you must be very 
+// Any methods which might be called asynchronously must lock the
+// mutex before reading the above information, and you must be very
 // careful when accessing any information except for the above.
 // These methods include the following:
 //
@@ -74,13 +74,13 @@ vtkStandardNewMacro(vtkVideoSource);
 #if ( _MSC_VER >= 1300 ) // Visual studio .NET
 #pragma warning ( disable : 4311 )
 #pragma warning ( disable : 4312 )
-#endif 
+#endif
 
 //----------------------------------------------------------------------------
 vtkVideoSource::vtkVideoSource()
 {
   int i;
-  
+
   this->Initialized = 0;
 
   this->AutoAdvance = 1;
@@ -93,7 +93,7 @@ vtkVideoSource::vtkVideoSource()
     {
     this->FrameBufferExtent[i] = 0;
     }
-  
+
   this->Playing = 0;
   this->Recording = 0;
 
@@ -151,8 +151,8 @@ vtkVideoSource::vtkVideoSource()
 
 //----------------------------------------------------------------------------
 vtkVideoSource::~vtkVideoSource()
-{ 
-  // we certainly don't want to access a virtual 
+{
+  // we certainly don't want to access a virtual
   // function after the subclass has destructed!!
   this->vtkVideoSource::ReleaseSystemResources();
 
@@ -165,10 +165,10 @@ vtkVideoSource::~vtkVideoSource()
 void vtkVideoSource::PrintSelf(ostream& os, vtkIndent indent)
 {
   int idx;
-  
+
   this->Superclass::PrintSelf(os,indent);
-  
-  os << indent << "FrameSize: (" << this->FrameSize[0] << ", " 
+
+  os << indent << "FrameSize: (" << this->FrameSize[0] << ", "
      << this->FrameSize[1] << ", " << this->FrameSize[2] << ")\n";
 
   os << indent << "ClipRegion: (" << this->ClipRegion[0];
@@ -177,14 +177,14 @@ void vtkVideoSource::PrintSelf(ostream& os, vtkIndent indent)
     os << ", " << this->ClipRegion[idx];
     }
   os << ")\n";
-  
+
   os << indent << "DataSpacing: (" << this->DataSpacing[0];
   for (idx = 1; idx < 3; ++idx)
     {
     os << ", " << this->DataSpacing[idx];
     }
   os << ")\n";
-  
+
   os << indent << "DataOrigin: (" << this->DataOrigin[0];
   for (idx = 1; idx < 3; ++idx)
     {
@@ -205,7 +205,7 @@ void vtkVideoSource::PrintSelf(ostream& os, vtkIndent indent)
     os << ", " << this->OutputWholeExtent[idx];
     }
   os << ")\n";
-  
+
   os << indent << "FrameRate: " << this->FrameRate << "\n";
 
   os << indent << "FrameCount: " << this->FrameCount << "\n";
@@ -232,7 +232,7 @@ void vtkVideoSource::PrintSelf(ostream& os, vtkIndent indent)
 
 //----------------------------------------------------------------------------
 // Update the FrameBuffers according to any changes in the FrameBuffer*
-// information. 
+// information.
 // This function should always be called from within a FrameBufferMutex lock
 // and should never be called asynchronously.
 // It sets up the FrameBufferExtent
@@ -246,10 +246,10 @@ void vtkVideoSource::UpdateFrameBuffer()
   for (i = 0; i < 3; i++)
     {
     oldExt = this->FrameBufferExtent[2*i+1] - this->FrameBufferExtent[2*i] + 1;
-    this->FrameBufferExtent[2*i] = ((this->ClipRegion[2*i] > 0) 
-                             ? this->ClipRegion[2*i] : 0);  
-    this->FrameBufferExtent[2*i+1] = ((this->ClipRegion[2*i+1] < 
-                                       this->FrameSize[i]-1) 
+    this->FrameBufferExtent[2*i] = ((this->ClipRegion[2*i] > 0)
+                             ? this->ClipRegion[2*i] : 0);
+    this->FrameBufferExtent[2*i+1] = ((this->ClipRegion[2*i+1] <
+                                       this->FrameSize[i]-1)
                              ? this->ClipRegion[2*i+1] : this->FrameSize[i]-1);
 
     ext[i] = this->FrameBufferExtent[2*i+1] - this->FrameBufferExtent[2*i] + 1;
@@ -318,20 +318,20 @@ void vtkVideoSource::ReleaseSystemResources()
 //----------------------------------------------------------------------------
 void vtkVideoSource::SetFrameSize(int x, int y, int z)
 {
-  if (x == this->FrameSize[0] && 
-      y == this->FrameSize[1] && 
+  if (x == this->FrameSize[0] &&
+      y == this->FrameSize[1] &&
       z == this->FrameSize[2])
     {
     return;
     }
 
-  if (x < 1 || y < 1 || z < 1) 
+  if (x < 1 || y < 1 || z < 1)
     {
     vtkErrorMacro(<< "SetFrameSize: Illegal frame size");
     return;
     }
 
-  if (this->Initialized) 
+  if (this->Initialized)
     {
     this->FrameBufferMutex->Lock();
     this->FrameSize[0] = x;
@@ -349,7 +349,7 @@ void vtkVideoSource::SetFrameSize(int x, int y, int z)
 
   this->Modified();
 }
-    
+
 //----------------------------------------------------------------------------
 void vtkVideoSource::SetFrameRate(float rate)
 {
@@ -363,7 +363,7 @@ void vtkVideoSource::SetFrameRate(float rate)
 }
 
 //----------------------------------------------------------------------------
-void vtkVideoSource::SetClipRegion(int x0, int x1, int y0, int y1, 
+void vtkVideoSource::SetClipRegion(int x0, int x1, int y0, int y1,
                                    int z0, int z1)
 {
   if (this->ClipRegion[0] != x0 || this->ClipRegion[1] != x1 ||
@@ -371,7 +371,7 @@ void vtkVideoSource::SetClipRegion(int x0, int x1, int y0, int y1,
       this->ClipRegion[4] != z0 || this->ClipRegion[5] != z1)
     {
     this->Modified();
-    if (this->Initialized) 
+    if (this->Initialized)
       { // modify the FrameBufferExtent
       this->FrameBufferMutex->Lock();
       this->ClipRegion[0] = x0; this->ClipRegion[1] = x1;
@@ -422,7 +422,7 @@ void vtkVideoSource::InternalGrab()
                      this->FrameBufferBitsPerPixel + 7)/8;
   bytesPerRow = ((bytesPerRow + this->FrameBufferRowAlignment - 1) /
                  this->FrameBufferRowAlignment)*this->FrameBufferRowAlignment;
-  int totalSize = bytesPerRow * 
+  int totalSize = bytesPerRow *
                    (this->FrameBufferExtent[3]-this->FrameBufferExtent[2]+1) *
                    (this->FrameBufferExtent[5]-this->FrameBufferExtent[4]+1);
 
@@ -432,7 +432,7 @@ void vtkVideoSource::InternalGrab()
   ptr = reinterpret_cast<vtkUnsignedCharArray *>(this->FrameBuffer[index])->GetPointer(0);
 
   // Somebody should check this:
-  lptr = (int *)(((((long)ptr) + 3)/4)*4);
+  lptr = (int *)(((((intptr_t)ptr) + 3)/4)*4);
   i = totalSize/4;
 
   while (--i >= 0)
@@ -482,7 +482,7 @@ static inline void vtkSleep(double duration)
 
 //----------------------------------------------------------------------------
 // Sleep until the specified absolute time has arrived.
-// You must pass a handle to the current thread.  
+// You must pass a handle to the current thread.
 // If '0' is returned, then the thread was aborted before or during the wait.
 static int vtkThreadSleep(vtkMultiThreader::ThreadInfo *data, double time)
 {
@@ -506,7 +506,7 @@ static int vtkThreadSleep(vtkMultiThreader::ThreadInfo *data, double time)
       remaining = 0.1;
       }
 
-    // check to see if we are being told to quit 
+    // check to see if we are being told to quit
     data->ActiveFlagLock->Lock();
     int activeFlag = *(data->ActiveFlag);
     data->ActiveFlagLock->Unlock();
@@ -527,7 +527,7 @@ static int vtkThreadSleep(vtkMultiThreader::ThreadInfo *data, double time)
 static void *vtkVideoSourceRecordThread(vtkMultiThreader::ThreadInfo *data)
 {
   vtkVideoSource *self = (vtkVideoSource *)(data->UserData);
-  
+
   double startTime = vtkTimerLog::GetUniversalTime();
   double rate = self->GetFrameRate();
   int frame = 0;
@@ -544,7 +544,7 @@ static void *vtkVideoSourceRecordThread(vtkMultiThreader::ThreadInfo *data)
 
 //----------------------------------------------------------------------------
 // Set the source to grab frames continuously.
-// You should override this as appropriate for your device.  
+// You should override this as appropriate for your device.
 void vtkVideoSource::Record()
 {
   if (this->Playing)
@@ -559,19 +559,19 @@ void vtkVideoSource::Record()
     this->Recording = 1;
     this->FrameCount = 0;
     this->Modified();
-    this->PlayerThreadId = 
+    this->PlayerThreadId =
       this->PlayerThreader->SpawnThread((vtkThreadFunctionType)\
                                 &vtkVideoSourceRecordThread,this);
     }
 }
-    
+
 //----------------------------------------------------------------------------
 // this function runs in an alternate thread to 'play the tape' at the
 // specified frame rate.
 static void *vtkVideoSourcePlayThread(vtkMultiThreader::ThreadInfo *data)
 {
   vtkVideoSource *self = (vtkVideoSource *)(data->UserData);
- 
+
   double startTime = vtkTimerLog::GetUniversalTime();
   double rate = self->GetFrameRate();
   int frame = 0;
@@ -588,7 +588,7 @@ static void *vtkVideoSourcePlayThread(vtkMultiThreader::ThreadInfo *data)
 
 //----------------------------------------------------------------------------
 // Set the source to play back recorded frames.
-// You should override this as appropriate for your device.  
+// You should override this as appropriate for your device.
 void vtkVideoSource::Play()
 {
   if (this->Recording)
@@ -602,12 +602,12 @@ void vtkVideoSource::Play()
 
     this->Playing = 1;
     this->Modified();
-    this->PlayerThreadId = 
+    this->PlayerThreadId =
       this->PlayerThreader->SpawnThread((vtkThreadFunctionType)\
                                         &vtkVideoSourcePlayThread,this);
     }
 }
-    
+
 //----------------------------------------------------------------------------
 // Stop continuous grabbing or playback.  You will have to override this
 // if your class overrides Play() and Record()
@@ -621,7 +621,7 @@ void vtkVideoSource::Stop()
     this->Recording = 0;
     this->Modified();
     }
-} 
+}
 
 //----------------------------------------------------------------------------
 // Rewind back to the frame with the earliest timestamp.
@@ -665,7 +665,7 @@ void vtkVideoSource::Rewind()
     }
 
   this->FrameBufferMutex->Unlock();
-}  
+}
 
 //----------------------------------------------------------------------------
 // Fast-forward to the frame with the latest timestamp.
@@ -717,12 +717,12 @@ void vtkVideoSource::FastForward()
     }
 
   this->FrameBufferMutex->Unlock();
-}  
+}
 
 //----------------------------------------------------------------------------
 // Rotate the buffers
 void vtkVideoSource::Seek(int n)
-{ 
+{
   this->FrameBufferMutex->Lock();
   this->AdvanceFrameBuffer(n);
   this->FrameIndex = (this->FrameIndex + n) % this->FrameBufferSize;
@@ -731,7 +731,7 @@ void vtkVideoSource::Seek(int n)
     this->FrameIndex += this->FrameBufferSize;
     }
   this->FrameBufferMutex->Unlock();
-  this->Modified(); 
+  this->Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -798,7 +798,7 @@ void vtkVideoSource::SetOutputFormat(int format)
 
 //----------------------------------------------------------------------------
 // set or change the circular buffer size
-// you will have to override this if you want the buffers 
+// you will have to override this if you want the buffers
 // to be device-specific (i.e. something other than vtkDataArray)
 void vtkVideoSource::SetFrameBufferSize(int bufsize)
 {
@@ -830,12 +830,12 @@ void vtkVideoSource::SetFrameBufferSize(int bufsize)
         {
         this->FrameBuffer[i] = vtkUnsignedCharArray::New();
         this->FrameBufferTimeStamps[i] = 0.0;
-        } 
+        }
       this->FrameBufferSize = bufsize;
       this->Modified();
       }
     }
-  else 
+  else
     {
     if (bufsize > 0)
       {
@@ -909,7 +909,7 @@ void vtkVideoSource::SetFrameBufferSize(int bufsize)
 void vtkVideoSource::AdvanceFrameBuffer(int n)
 {
   int i = (this->FrameBufferIndex - n) % this->FrameBufferSize;
-  while (i < 0) 
+  while (i < 0)
     {
     i += this->FrameBufferSize;
     }
@@ -918,7 +918,7 @@ void vtkVideoSource::AdvanceFrameBuffer(int n)
 
 //----------------------------------------------------------------------------
 double vtkVideoSource::GetFrameTimeStamp(int frame)
-{ 
+{
   double timeStamp;
 
   this->FrameBufferMutex->Lock();
@@ -959,7 +959,7 @@ int vtkVideoSource::RequestInformation(
     // if 'flag' is set in output extent, use the FrameBufferExtent instead
     if (extent[2*i+1] < extent[2*i])
       {
-      extent[2*i] = 0; 
+      extent[2*i] = 0;
       extent[2*i+1] = \
         this->FrameBufferExtent[2*i+1] - this->FrameBufferExtent[2*i];
       }
@@ -981,7 +981,7 @@ int vtkVideoSource::RequestInformation(
   extent[5] = extent[4] + (extent[5]-extent[4]+1) * numFrames - 1;
 
   outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),extent,6);
-    
+
   // set the spacing
   outInfo->Set(vtkDataObject::SPACING(),this->DataSpacing,3);
 
@@ -989,7 +989,7 @@ int vtkVideoSource::RequestInformation(
   outInfo->Set(vtkDataObject::ORIGIN(),this->DataOrigin,3);
 
   // set default data type (8 bit greyscale)
-  vtkDataObject::SetPointDataActiveScalarInfo(outInfo, VTK_UNSIGNED_CHAR, 
+  vtkDataObject::SetPointDataActiveScalarInfo(outInfo, VTK_UNSIGNED_CHAR,
     this->NumberOfScalarComponents);
 
   return 1;
@@ -1000,7 +1000,7 @@ int vtkVideoSource::RequestInformation(
 // unusual pixel packing formats, such as XRGB XBRG BGRX BGR etc.
 // The version below assumes that the packing of the framebuffer is
 // identical to that of the output.
-void vtkVideoSource::UnpackRasterLine(char *outPtr, char *rowPtr, 
+void vtkVideoSource::UnpackRasterLine(char *outPtr, char *rowPtr,
                                       int start, int count)
 {
   char *inPtr = rowPtr + start*this->NumberOfScalarComponents;
@@ -1020,7 +1020,7 @@ void vtkVideoSource::UnpackRasterLine(char *outPtr, char *rowPtr,
 //----------------------------------------------------------------------------
 // The Execute method is fairly complex, so I would not recommend overriding
 // it unless you have to.  Override the UnpackRasterLine() method instead.
-// You should only have to override it if you are using something other 
+// You should only have to override it if you are using something other
 // than 8-bit vtkUnsignedCharArray for the frame buffer.
 int vtkVideoSource::RequestData(
   vtkInformation *vtkNotUsed(request),
@@ -1037,9 +1037,9 @@ int vtkVideoSource::RequestData(
     {
     saveOutputExtent[i] = outputExtent[i];
     }
-  // clip to extent to the Z size of one frame  
-  outputExtent[4] = this->FrameOutputExtent[4]; 
-  outputExtent[5] = this->FrameOutputExtent[5]; 
+  // clip to extent to the Z size of one frame
+  outputExtent[4] = this->FrameOutputExtent[4];
+  outputExtent[5] = this->FrameOutputExtent[5];
 
   int frameExtentX = this->FrameBufferExtent[1]-this->FrameBufferExtent[0]+1;
   int frameExtentY = this->FrameBufferExtent[3]-this->FrameBufferExtent[2]+1;
@@ -1093,8 +1093,8 @@ int vtkVideoSource::RequestData(
     outPadY = 0;
     }
 
-  int outX = frameExtentX - inPadX; 
-  int outY = frameExtentY - inPadY; 
+  int outX = frameExtentX - inPadX;
+  int outY = frameExtentY - inPadY;
   int outZ; // do outZ later
 
   if (outX > extentX - outPadX)
@@ -1117,7 +1117,7 @@ int vtkVideoSource::RequestData(
     }
 
   // ditto for number of scalar components
-  if (data->GetNumberOfScalarComponents() != 
+  if (data->GetNumberOfScalarComponents() !=
       this->LastNumberOfScalarComponents)
     {
     this->LastNumberOfScalarComponents = data->GetNumberOfScalarComponents();
@@ -1132,7 +1132,7 @@ int vtkVideoSource::RequestData(
            (saveOutputExtent[3]-saveOutputExtent[2]+1)*
            (saveOutputExtent[5]-saveOutputExtent[4]+1)*outIncX);
     this->OutputNeedsInitialization = 0;
-    } 
+    }
 
   // we have to modify the outputExtent of the first frame,
   // because it might be complete (it will be restored after
@@ -1143,7 +1143,7 @@ int vtkVideoSource::RequestData(
   this->FrameBufferMutex->Lock();
 
   int index = this->FrameBufferIndex;
-  this->FrameTimeStamp = 
+  this->FrameTimeStamp =
     this->FrameBufferTimeStamps[index % this->FrameBufferSize];
 
   int frame;
@@ -1152,8 +1152,8 @@ int vtkVideoSource::RequestData(
     if (frame == finalFrame)
       {
       outputExtent[5] = finalOutputExtent5;
-      } 
-    
+      }
+
     vtkDataArray *frameBuffer = reinterpret_cast<vtkDataArray *>(this->FrameBuffer[(index + frame) % this->FrameBufferSize]);
 
     char *inPtr = reinterpret_cast<char*>(frameBuffer->GetVoidPointer(0));
@@ -1162,7 +1162,7 @@ int vtkVideoSource::RequestData(
     extentZ = outputExtent[5]-outputExtent[4]+1;
     inPadZ = 0;
     outPadZ = -outputExtent[4];
-    
+
     if (outPadZ < 0)
       {
       inPadZ -= outPadZ;
@@ -1209,7 +1209,7 @@ int vtkVideoSource::RequestData(
         outPtrTmp = outPtr;
         for (j = 0; j < outY; j++)
           {
-          if (outX > 0) 
+          if (outX > 0)
             {
             this->UnpackRasterLine(outPtrTmp,inPtrTmp,inPadX,outX);
             }
diff --git a/Rendering/vtkFreeTypeTools.cxx b/Rendering/vtkFreeTypeTools.cxx
index 7443693..681fae6 100644
--- a/Rendering/vtkFreeTypeTools.cxx
+++ b/Rendering/vtkFreeTypeTools.cxx
@@ -222,7 +222,7 @@ vtkFreeTypeToolsFaceRequester(FTC_FaceID face_id,
   // Map the ID to a text property
   vtkSmartPointer<vtkTextProperty> tprop =
       vtkSmartPointer<vtkTextProperty>::New();
-  self->MapIdToTextProperty(reinterpret_cast<unsigned long>(face_id), tprop);
+  self->MapIdToTextProperty(reinterpret_cast<intptr_t>(face_id), tprop);
 
   // Fonts, organized by [Family][Bold][Italic]
   static EmbeddedFontStruct EmbeddedFonts[3][2][2] =
diff --git a/Rendering/vtkFreeTypeUtilities.cxx b/Rendering/vtkFreeTypeUtilities.cxx
index 629e5da..2d140a8 100644
--- a/Rendering/vtkFreeTypeUtilities.cxx
+++ b/Rendering/vtkFreeTypeUtilities.cxx
@@ -337,7 +337,7 @@ vtkFreeTypeUtilitiesFaceRequester(FTC_FaceID face_id,
   // Map the ID to a text property
 
   vtkTextProperty *tprop = vtkTextProperty::New();
-  self->MapIdToTextProperty(reinterpret_cast<unsigned long>(face_id), tprop);
+  self->MapIdToTextProperty(reinterpret_cast<intptr_t>(face_id), tprop);
 
   // Fonts, organized by [Family][Bold][Italic]
 
diff --git a/Rendering/vtkWin32OpenGLRenderWindow.cxx b/Rendering/vtkWin32OpenGLRenderWindow.cxx
index a4485d2..6b6e6b4 100644
--- a/Rendering/vtkWin32OpenGLRenderWindow.cxx
+++ b/Rendering/vtkWin32OpenGLRenderWindow.cxx
@@ -75,9 +75,9 @@ vtkWin32OpenGLRenderWindow::~vtkWin32OpenGLRenderWindow()
 void vtkWin32OpenGLRenderWindow::Clean()
 {
   GLuint id;
-  
+
   /* finish OpenGL rendering */
-  if (this->ContextId) 
+  if (this->ContextId)
     {
     this->MakeCurrent();
 
@@ -86,7 +86,7 @@ void vtkWin32OpenGLRenderWindow::Clean()
       {
       glDisable((GLenum)cur_light);
       }
-    
+
     /* now delete all textures */
     glDisable(GL_TEXTURE_2D);
     for (int i = 1; i < this->TextureResourceIds->GetNumberOfIds(); i++)
@@ -106,16 +106,16 @@ void vtkWin32OpenGLRenderWindow::Clean()
       }
 
     this->CleanUpRenderers();
-    
+
     // Note: wglMakeCurrent(NULL,NULL) is valid according to the documentation
     // and works with nVidia and ATI but not with Intel. Passing an existing
     // device context works in any case.
     // see VTK Bug 7119.
-    if(wglMakeCurrent(this->DeviceContext,NULL)!=TRUE) 
+    if(wglMakeCurrent(this->DeviceContext,NULL)!=TRUE)
       {
       vtkErrorMacro("wglMakeCurrent failed in Clean(), error: " << GetLastError());
       }
-    if (wglDeleteContext(this->ContextId) != TRUE) 
+    if (wglDeleteContext(this->ContextId) != TRUE)
       {
       vtkErrorMacro("wglDeleteContext failed in Clean(), error: " << GetLastError());
       }
@@ -136,7 +136,7 @@ void vtkWin32OpenGLRenderWindow::CleanUpRenderers()
   // destructor)
   vtkRenderer *ren;
   vtkCollectionSimpleIterator rsit;
-  for (this->Renderers->InitTraversal(rsit); 
+  for (this->Renderers->InitTraversal(rsit);
        (ren = this->Renderers->GetNextRenderer(rsit));)
     {
     ren->SetRenderWindow(NULL);
@@ -144,13 +144,13 @@ void vtkWin32OpenGLRenderWindow::CleanUpRenderers()
     }
 }
 
-LRESULT APIENTRY vtkWin32OpenGLRenderWindow::WndProc(HWND hWnd, UINT message, 
-                                                     WPARAM wParam, 
+LRESULT APIENTRY vtkWin32OpenGLRenderWindow::WndProc(HWND hWnd, UINT message,
+                                                     WPARAM wParam,
                                                      LPARAM lParam)
 {
   LRESULT res;
 
-  vtkWin32OpenGLRenderWindow *me = 
+  vtkWin32OpenGLRenderWindow *me =
     (vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(hWnd,sizeof(vtkLONG));
 
   if (me && me->GetReferenceCount()>0)
@@ -199,7 +199,7 @@ int vtkWin32OpenGLRenderWindow::GetEventPending()
       return 1;
       }
     }
-  
+
   return 0;
 }
 
@@ -216,21 +216,21 @@ void vtkWin32OpenGLRenderWindow::MakeCurrent()
                     " than the one doing the picking, this can causes crashes"
                     " and/or bad pick results");
       }
-    else 
+    else
       {
-      if (wglMakeCurrent(this->DeviceContext, this->ContextId) != TRUE) 
+      if (wglMakeCurrent(this->DeviceContext, this->ContextId) != TRUE)
         {
         LPVOID lpMsgBuf;
-        ::FormatMessage( 
-          FORMAT_MESSAGE_ALLOCATE_BUFFER | 
-          FORMAT_MESSAGE_FROM_SYSTEM | 
+        ::FormatMessage(
+          FORMAT_MESSAGE_ALLOCATE_BUFFER |
+          FORMAT_MESSAGE_FROM_SYSTEM |
           FORMAT_MESSAGE_IGNORE_INSERTS,
           NULL,
           GetLastError(),
           MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
           (LPTSTR) &lpMsgBuf,
           0,
-          NULL 
+          NULL
           );
         if(lpMsgBuf)
           {
@@ -243,7 +243,7 @@ void vtkWin32OpenGLRenderWindow::MakeCurrent()
           delete [] wmsg;
           delete [] wtemp;
 #else
-          vtkErrorMacro("wglMakeCurrent failed in MakeCurrent(), error: " 
+          vtkErrorMacro("wglMakeCurrent failed in MakeCurrent(), error: "
                         << (LPCTSTR)lpMsgBuf);
 #endif
           ::LocalFree( lpMsgBuf );
@@ -289,13 +289,13 @@ void vtkWin32OpenGLRenderWindow::SetSize(int x, int y)
           }
         }
       }
-    
+
     else if (this->Mapped)
       {
       if (!resizing)
         {
         resizing = 1;
-        
+
         if (this->ParentId)
           {
           SetWindowExtEx(this->DeviceContext,x,y,NULL);
@@ -330,7 +330,7 @@ void vtkWin32OpenGLRenderWindow::SetPosition(int x, int y)
       if (!resizing)
         {
         resizing = 1;
-        
+
         SetWindowPos(this->WindowId,HWND_TOP,x,y,
                      0, 0, SWP_NOSIZE | SWP_NOZORDER);
         resizing = 0;
@@ -426,7 +426,7 @@ const char* vtkWin32OpenGLRenderWindow::ReportCapabilities()
   if (pfd.cColorBits <= 8)
     {
     strm << "class:  PseudoColor" << endl;
-    } 
+    }
   else
     {
     strm << "class:  TrueColor" << endl;
@@ -447,14 +447,14 @@ const char* vtkWin32OpenGLRenderWindow::ReportCapabilities()
   strm << "double buffer:  False" << endl;
   }
   if (pfd.dwFlags & PFD_STEREO) {
-  strm << "stereo:  True" << endl;  
+  strm << "stereo:  True" << endl;
   } else {
   strm << "stereo:  False" << endl;
   }
   if (pfd.dwFlags & PFD_GENERIC_FORMAT) {
-  strm << "hardware acceleration:  False" << endl; 
+  strm << "hardware acceleration:  False" << endl;
   } else {
-  strm << "hardware acceleration:  True" << endl; 
+  strm << "hardware acceleration:  True" << endl;
   }
   strm << "rgba:  redSize=" << static_cast<int>(pfd.cRedBits) << " greenSize=" << static_cast<int>(pfd.cGreenBits) << "blueSize=" << static_cast<int>(pfd.cBlueBits) << "alphaSize=" << static_cast<int>(pfd.cAlphaBits) << endl;
   strm << "aux buffers:  " << static_cast<int>(pfd.cAuxBuffers)<< endl;
@@ -463,17 +463,17 @@ const char* vtkWin32OpenGLRenderWindow::ReportCapabilities()
   strm << "accum:  redSize=" << static_cast<int>(pfd.cAccumRedBits) << " greenSize=" << static_cast<int>(pfd.cAccumGreenBits) << "blueSize=" << static_cast<int>(pfd.cAccumBlueBits) << "alphaSize=" << static_cast<int>(pfd.cAccumAlphaBits) << endl;
 
   delete[] this->Capabilities;
-  
+
   size_t len = strm.str().length() + 1;
   this->Capabilities = new char[len];
   strncpy(this->Capabilities, strm.str().c_str(), len);
-  
+
   return this->Capabilities;
 }
 
- 
-void vtkWin32OpenGLRenderWindow::SetupPixelFormat(HDC hDC, DWORD dwFlags, 
-                                                  int debug, int bpp, 
+
+void vtkWin32OpenGLRenderWindow::SetupPixelFormat(HDC hDC, DWORD dwFlags,
+                                                  int debug, int bpp,
                                                   int zbpp)
 {
   PIXELFORMATDESCRIPTOR pfd = {
@@ -505,12 +505,12 @@ void vtkWin32OpenGLRenderWindow::SetupPixelFormat(HDC hDC, DWORD dwFlags,
     if (!(pfd.dwFlags & PFD_SUPPORT_OPENGL))
       {
 #ifdef UNICODE
-      MessageBox(WindowFromDC(hDC), 
+      MessageBox(WindowFromDC(hDC),
                  L"Invalid pixel format, no OpenGL support",
                  L"Error",
                  MB_ICONERROR | MB_OK);
 #else
-      MessageBox(WindowFromDC(hDC), 
+      MessageBox(WindowFromDC(hDC),
                  "Invalid pixel format, no OpenGL support",
                  "Error",
                  MB_ICONERROR | MB_OK);
@@ -524,11 +524,11 @@ void vtkWin32OpenGLRenderWindow::SetupPixelFormat(HDC hDC, DWORD dwFlags,
         {
         exit(1);
         }
-      }         
+      }
     }
   else
     {
-    // hDC has no current PixelFormat, so 
+    // hDC has no current PixelFormat, so
     pixelFormat = ChoosePixelFormat(hDC, &pfd);
     if (pixelFormat == 0)
       {
@@ -549,8 +549,8 @@ void vtkWin32OpenGLRenderWindow::SetupPixelFormat(HDC hDC, DWORD dwFlags,
         exit(1);
         }
       }
-    DescribePixelFormat(hDC, pixelFormat,sizeof(pfd), &pfd); 
-    if (SetPixelFormat(hDC, pixelFormat, &pfd) != TRUE) 
+    DescribePixelFormat(hDC, pixelFormat,sizeof(pfd), &pfd);
+    if (SetPixelFormat(hDC, pixelFormat, &pfd) != TRUE)
       {
       // int err = GetLastError();
 #ifdef UNICODE
@@ -626,10 +626,10 @@ void vtkWin32OpenGLRenderWindow::SetupPalette(HDC hDC)
 }
 
 
-LRESULT vtkWin32OpenGLRenderWindow::MessageProc(HWND hWnd, UINT message, 
+LRESULT vtkWin32OpenGLRenderWindow::MessageProc(HWND hWnd, UINT message,
                                                 WPARAM wParam, LPARAM lParam)
 {
-  switch (message) 
+  switch (message)
     {
     case WM_CREATE:
     {
@@ -648,18 +648,18 @@ LRESULT vtkWin32OpenGLRenderWindow::MessageProc(HWND hWnd, UINT message,
       return 0;
     case WM_SIZE:
       /* track window size changes */
-      if (this->ContextId) 
+      if (this->ContextId)
         {
         this->SetSize((int) LOWORD(lParam),(int) HIWORD(lParam));
         return 0;
         }
     case WM_PALETTECHANGED:
       /* realize palette if this is *not* the current window */
-      if (this->ContextId && this->Palette && (HWND) wParam != hWnd) 
+      if (this->ContextId && this->Palette && (HWND) wParam != hWnd)
         {
         SelectPalette(this->DeviceContext, this->OldPalette, FALSE);
         UnrealizeObject(this->Palette);
-        this->OldPalette = SelectPalette(this->DeviceContext, 
+        this->OldPalette = SelectPalette(this->DeviceContext,
                                          this->Palette, FALSE);
         RealizePalette(this->DeviceContext);
         this->Render();
@@ -667,11 +667,11 @@ LRESULT vtkWin32OpenGLRenderWindow::MessageProc(HWND hWnd, UINT message,
       break;
     case WM_QUERYNEWPALETTE:
       /* realize palette if this is the current window */
-      if (this->ContextId && this->Palette) 
+      if (this->ContextId && this->Palette)
         {
         SelectPalette(this->DeviceContext, this->OldPalette, FALSE);
         UnrealizeObject(this->Palette);
-        this->OldPalette = SelectPalette(this->DeviceContext, 
+        this->OldPalette = SelectPalette(this->DeviceContext,
                                          this->Palette, FALSE);
         RealizePalette(this->DeviceContext);
         this->Render();
@@ -682,7 +682,7 @@ LRESULT vtkWin32OpenGLRenderWindow::MessageProc(HWND hWnd, UINT message,
     {
     PAINTSTRUCT ps;
     BeginPaint(hWnd, &ps);
-    if (this->ContextId) 
+    if (this->ContextId)
       {
       this->Render();
       }
@@ -730,20 +730,20 @@ void vtkWin32OpenGLRenderWindow::CreateAWindow()
     {
     static int count = 1;
     char *windowName;
-    
+
     if (!this->WindowId)
       {
       WNDCLASS wndClass;
       this->DeviceContext = 0;
-      
-      int len = static_cast<int>(strlen("Visualization Toolkit - Win32OpenGL #")) 
+
+      int len = static_cast<int>(strlen("Visualization Toolkit - Win32OpenGL #"))
         + (int)ceil( (double) log10( (double)(count+1) ) )
-        + 1; 
+        + 1;
       windowName = new char [ len ];
       sprintf(windowName,"Visualization Toolkit - Win32OpenGL #%i",count++);
       this->SetWindowName(windowName);
       delete [] windowName;
-      
+
       // has the class been registered ?
 #ifdef UNICODE
       if (!GetClassInfo(this->ApplicationInstance,L"vtkOpenGL",&wndClass))
@@ -770,7 +770,7 @@ void vtkWin32OpenGLRenderWindow::CreateAWindow()
           wndClass.cbWndExtra = 2 * sizeof(vtkLONG);
           RegisterClass(&wndClass);
           }
-      
+
 #ifdef UNICODE
       wchar_t *wname = new wchar_t [mbstowcs(NULL, this->WindowName, 32000)+1];
       mbstowcs(wname, this->WindowName, 32000);
@@ -779,7 +779,7 @@ void vtkWin32OpenGLRenderWindow::CreateAWindow()
       int y = ((this->Position[1] >= 0) ? this->Position[1] : 5);
       int height = ((this->Size[1] > 0) ? this->Size[1] : 300);
       int width = ((this->Size[0] > 0) ? this->Size[0] : 300);
-      
+
       /* create window */
       if (this->ParentId)
         {
@@ -812,7 +812,7 @@ void vtkWin32OpenGLRenderWindow::CreateAWindow()
         this->WindowId = CreateWindow(
           L"vtkOpenGL", wname, style,
           x,y, width+2*GetSystemMetrics(SM_CXFRAME),
-          height+2*GetSystemMetrics(SM_CYFRAME) 
+          height+2*GetSystemMetrics(SM_CYFRAME)
           +GetSystemMetrics(SM_CYCAPTION),
           NULL, NULL, this->ApplicationInstance, NULL);
 #else
@@ -827,14 +827,14 @@ void vtkWin32OpenGLRenderWindow::CreateAWindow()
 #ifdef UNICODE
       delete [] wname;
 #endif
-      
+
       if (!this->WindowId)
         {
         vtkErrorMacro("Could not create window, error:  " << GetLastError());
         return;
         }
       // extract the create info
-      
+
       /* display window */
       if(!this->OffScreenRendering)
         {
@@ -842,7 +842,7 @@ void vtkWin32OpenGLRenderWindow::CreateAWindow()
         }
       //UpdateWindow(this->WindowId);
       this->OwnWindow = 1;
-      vtkSetWindowLong(this->WindowId,sizeof(vtkLONG),(vtkLONG)this);
+      vtkSetWindowLong(this->WindowId,sizeof(vtkLONG),(intptr_t)this);
       }
     if (!this->DeviceContext)
       {
@@ -862,16 +862,16 @@ void vtkWin32OpenGLRenderWindow::CreateAWindow()
       }
     this->SetupPalette(this->DeviceContext);
     this->ContextId = wglCreateContext(this->DeviceContext);
-    if (this->ContextId == NULL) 
+    if (this->ContextId == NULL)
       {
       vtkErrorMacro("wglCreateContext failed in CreateAWindow(), error: " << GetLastError());
       }
     this->MakeCurrent();
-    
+
     // wipe out any existing display lists
     vtkRenderer* ren;
     vtkCollectionSimpleIterator rsit;
-    for (this->Renderers->InitTraversal(rsit); 
+    for (this->Renderers->InitTraversal(rsit);
          (ren = this->Renderers->GetNextRenderer(rsit));)
       {
       ren->SetRenderWindow(0);
@@ -889,20 +889,20 @@ void vtkWin32OpenGLRenderWindow::CreateAWindow()
 
 // Initialize the window for rendering.
 void vtkWin32OpenGLRenderWindow::WindowInitialize()
-{ 
+{
   // create our own window if not already set
   this->OwnWindow = 0;
   if (!this->MFChandledWindow)
     {
     this->InitializeApplication();
     this->CreateAWindow();
-    }   
-  else 
+    }
+  else
     {
     this->MakeCurrent(); // hsr
     this->OpenGLInit();
     }
-  
+
   // set the DPI
   this->SetDPI(GetDeviceCaps(this->DeviceContext, LOGPIXELSY));
 }
@@ -910,7 +910,7 @@ void vtkWin32OpenGLRenderWindow::WindowInitialize()
 // Initialize the rendering window.
 void vtkWin32OpenGLRenderWindow::Initialize (void)
 {
-  // make sure we havent already been initialized 
+  // make sure we havent already been initialized
   if (!this->OffScreenRendering && !this->ContextId)
     {
     this->WindowInitialize();
@@ -955,7 +955,7 @@ void vtkWin32OpenGLRenderWindow::DestroyWindow()
         ReleaseDC(this->WindowId, this->DeviceContext);
         // can't set WindowId=NULL, needed for DestroyWindow
         this->DeviceContext = NULL;
-        
+
         // clear the extra data before calling destroy
         vtkSetWindowLong(this->WindowId,sizeof(vtkLONG),(vtkLONG)0);
         if(this->OwnWindow)
@@ -971,18 +971,18 @@ void vtkWin32OpenGLRenderWindow::DestroyWindow()
 // Get the current size of the window.
 int *vtkWin32OpenGLRenderWindow::GetSize(void)
 {
-  // if we aren't mapped then just return the ivar 
+  // if we aren't mapped then just return the ivar
   if (this->Mapped)
     {
     RECT rect;
 
-    //  Find the current window size 
+    //  Find the current window size
     if (GetClientRect(this->WindowId, &rect))
-      {    
+      {
       this->Size[0] = rect.right;
       this->Size[1] = rect.bottom;
       }
-    else 
+    else
       {
       this->Size[0] = 0;
       this->Size[1] = 0;
@@ -999,23 +999,23 @@ int *vtkWin32OpenGLRenderWindow::GetScreenSize(void)
   RECT rect;
 
   SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
-                            
+
   this->Size[0] = rect.right - rect.left;
   this->Size[1] = rect.bottom - rect.top;
-  
+
   return this->Size;
 }
 
 // Get the position in screen coordinates of the window.
 int *vtkWin32OpenGLRenderWindow::GetPosition(void)
 {
-  // if we aren't mapped then just return the ivar 
+  // if we aren't mapped then just return the ivar
   if (!this->Mapped)
     {
     return this->Position;
     }
 
-  //  Find the current window position 
+  //  Find the current window position
   //  x,y,&this->Position[0],&this->Position[1],&child);
 
   return this->Position;
@@ -1025,34 +1025,34 @@ int *vtkWin32OpenGLRenderWindow::GetPosition(void)
 void vtkWin32OpenGLRenderWindow::SetFullScreen(int arg)
 {
   int *temp;
-  
+
   if (this->FullScreen == arg)
     {
     return;
     }
-  
+
   if (!this->Mapped)
     {
     this->PrefFullScreen();
     return;
     }
 
-  // set the mode 
+  // set the mode
   this->FullScreen = arg;
   if (this->FullScreen <= 0)
     {
     this->Position[0] = this->OldScreen[0];
     this->Position[1] = this->OldScreen[1];
-    this->Size[0] = this->OldScreen[2]; 
+    this->Size[0] = this->OldScreen[2];
     this->Size[1] = this->OldScreen[3];
     this->Borders = this->OldScreen[4];
     }
   else
     {
-    // if window already up get its values 
+    // if window already up get its values
     if (this->WindowId)
       {
-      temp = this->GetPosition();      
+      temp = this->GetPosition();
       this->OldScreen[0] = temp[0];
       this->OldScreen[1] = temp[1];
 
@@ -1060,8 +1060,8 @@ void vtkWin32OpenGLRenderWindow::SetFullScreen(int arg)
       this->PrefFullScreen();
       }
     }
-  
-  // remap the window 
+
+  // remap the window
   this->WindowRemap();
 
   this->Modified();
@@ -1092,14 +1092,14 @@ void vtkWin32OpenGLRenderWindow::PrefFullScreen()
 
   size = this->GetScreenSize();
 
-  // use full screen 
+  // use full screen
   this->Position[0] = 0;
   this->Position[1] = 0;
   this->Size[0] = size[0] - 2*GetSystemMetrics(SM_CXFRAME);
-  this->Size[1] = size[1] - 
+  this->Size[1] = size[1] -
     2*GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYCAPTION);
 
-  // don't show borders 
+  // don't show borders
   this->Borders = 0;
 }
 
@@ -1108,8 +1108,8 @@ void vtkWin32OpenGLRenderWindow::WindowRemap()
 {
   // close everything down
   this->Finalize();
-  
-  // set the default windowid 
+
+  // set the default windowid
   this->WindowId = this->NextWindowId;
   this->NextWindowId = 0;
 
@@ -1129,7 +1129,7 @@ void vtkWin32OpenGLRenderWindow::PrintSelf(ostream& os, vtkIndent indent)
 // Get the window id.
 HWND vtkWin32OpenGLRenderWindow::GetWindowId()
 {
-  vtkDebugMacro(<< "Returning WindowId of " << this->WindowId << "\n"); 
+  vtkDebugMacro(<< "Returning WindowId of " << this->WindowId << "\n");
 
   return this->WindowId;
 }
@@ -1138,11 +1138,11 @@ HWND vtkWin32OpenGLRenderWindow::GetWindowId()
 void vtkWin32OpenGLRenderWindow::SetWindowId(HWND arg)
 {
   vtkDebugMacro(<< "Setting WindowId to " << arg << "\n");
-  
+
   if (arg != this->WindowId)
     {
     this->WindowId = arg;
-    if (this->ContextId) 
+    if (this->ContextId)
       {
       wglDeleteContext(this->ContextId);
       }
@@ -1155,24 +1155,24 @@ void vtkWin32OpenGLRenderWindow::SetWindowId(HWND arg)
 void vtkWin32OpenGLRenderWindow::SetWindowInfo(char *info)
 {
   int tmp;
-  
+
   sscanf(info,"%i",&tmp);
 
   this->WindowId = (HWND)tmp;
-  vtkDebugMacro(<< "Setting WindowId to " << this->WindowId << "\n"); 
+  vtkDebugMacro(<< "Setting WindowId to " << this->WindowId << "\n");
 }
 
 void vtkWin32OpenGLRenderWindow::SetNextWindowInfo(char *info)
 {
   int tmp;
-  
+
   sscanf(info,"%i",&tmp);
 
   this->SetNextWindowId((HWND)tmp);
 }
 
 void vtkWin32OpenGLRenderWindow::SetDisplayId(void * arg)
-{ 
+{
   this->DeviceContext = (HDC) arg;
 }
 
@@ -1181,7 +1181,7 @@ void vtkWin32OpenGLRenderWindow::SetContextId(HGLRC arg)
   this->ContextId = arg;
 }
 
-void vtkWin32OpenGLRenderWindow::SetDeviceContext(HDC arg) 
+void vtkWin32OpenGLRenderWindow::SetDeviceContext(HDC arg)
 {
   this->DeviceContext = arg;
   this->MFChandledWindow = TRUE;
@@ -1191,17 +1191,17 @@ void vtkWin32OpenGLRenderWindow::SetDeviceContext(HDC arg)
 void vtkWin32OpenGLRenderWindow::SetParentInfo(char *info)
 {
   int tmp;
-  
+
   sscanf(info,"%i",&tmp);
 
   this->ParentId = (HWND)tmp;
-  vtkDebugMacro(<< "Setting ParentId to " << this->ParentId << "\n"); 
+  vtkDebugMacro(<< "Setting ParentId to " << this->ParentId << "\n");
 }
 
 // Set the window id to a pre-existing window.
 void vtkWin32OpenGLRenderWindow::SetParentId(HWND arg)
 {
-  vtkDebugMacro(<< "Setting ParentId to " << arg << "\n"); 
+  vtkDebugMacro(<< "Setting ParentId to " << arg << "\n");
 
   this->ParentId = arg;
 }
@@ -1209,7 +1209,7 @@ void vtkWin32OpenGLRenderWindow::SetParentId(HWND arg)
 // Set the window id of the new window once a WindowRemap is done.
 void vtkWin32OpenGLRenderWindow::SetNextWindowId(HWND arg)
 {
-  vtkDebugMacro(<< "Setting NextWindowId to " << arg << "\n"); 
+  vtkDebugMacro(<< "Setting NextWindowId to " << arg << "\n");
 
   this->NextWindowId = arg;
 }
@@ -1228,7 +1228,7 @@ void vtkWin32OpenGLRenderWindow::Start(void)
     this->Initialize();
     }
 
-  // set the current window 
+  // set the current window
   this->MakeCurrent();
 }
 
@@ -1296,13 +1296,13 @@ void vtkWin32OpenGLRenderWindow::CreateOffScreenWindow(int width,
     DeleteDC(dc);
     }
   this->CreatingOffScreenWindow = status;
-} 
+}
 
 void vtkWin32OpenGLRenderWindow::CreateOffScreenDC(int xsize, int ysize,
                                                    HDC aHdc)
 {
   int dataWidth = ((xsize*3+3)/4)*4;
-  
+
   this->MemoryDataHeader.bmiHeader.biSize = 40;
   this->MemoryDataHeader.bmiHeader.biWidth = xsize;
   this->MemoryDataHeader.bmiHeader.biHeight = ysize;
@@ -1314,7 +1314,7 @@ void vtkWin32OpenGLRenderWindow::CreateOffScreenDC(int xsize, int ysize,
   this->MemoryDataHeader.bmiHeader.biSizeImage = dataWidth*ysize;
   this->MemoryDataHeader.bmiHeader.biXPelsPerMeter = 10000;
   this->MemoryDataHeader.bmiHeader.biYPelsPerMeter = 10000;
-  
+
   HBITMAP dib = CreateDIBSection(aHdc,
                                  &this->MemoryDataHeader, DIB_RGB_COLORS,
                                  (void **)(&(this->MemoryData)),  NULL, 0);
@@ -1330,13 +1330,13 @@ void vtkWin32OpenGLRenderWindow::CreateOffScreenDC(HBITMAP hbmp, HDC aHdc)
   GetObject(hbmp, sizeof(BITMAP), &bm);
 
   this->MemoryBuffer = hbmp;
-  
+
   // Create a compatible device context
   this->MemoryHdc = (HDC)CreateCompatibleDC(aHdc);
-  
+
   // Put the bitmap into the device context
   SelectObject(this->MemoryHdc, this->MemoryBuffer);
-  
+
   // Renderers will need to redraw anything cached in display lists
   this->CleanUpRenderers();
 
@@ -1344,15 +1344,15 @@ void vtkWin32OpenGLRenderWindow::CreateOffScreenDC(HBITMAP hbmp, HDC aHdc)
   this->Mapped =0;
   this->Size[0] = bm.bmWidth;
   this->Size[1] = bm.bmHeight;
-  
+
   this->DeviceContext = this->MemoryHdc;
   this->DoubleBuffer = 0;
-  this->SetupPixelFormat(this->DeviceContext, 
-                         PFD_SUPPORT_OPENGL | PFD_SUPPORT_GDI | 
+  this->SetupPixelFormat(this->DeviceContext,
+                         PFD_SUPPORT_OPENGL | PFD_SUPPORT_GDI |
                          PFD_DRAW_TO_BITMAP, this->GetDebug(), 24, 32);
   this->SetupPalette(this->DeviceContext);
   this->ContextId = wglCreateContext(this->DeviceContext);
-  if (this->ContextId == NULL) 
+  if (this->ContextId == NULL)
     {
     vtkErrorMacro("wglCreateContext failed in CreateOffScreenDC(), error: " << GetLastError());
     }
@@ -1391,7 +1391,7 @@ void vtkWin32OpenGLRenderWindow::SetupMemoryRendering(HBITMAP hbmp)
   this->ScreenContextId = this->ContextId;
 
   this->CreateOffScreenDC(hbmp, dc);
-  DeleteDC(dc); 
+  DeleteDC(dc);
 }
 
 HDC vtkWin32OpenGLRenderWindow::GetMemoryDC()
@@ -1411,15 +1411,15 @@ void vtkWin32OpenGLRenderWindow::CleanUpOffScreenRendering(void)
       {
       return;
       }
-      
+
     GdiFlush();
-      
+
     // we need to release resources
     this->CleanUpRenderers();
     DeleteDC(this->MemoryHdc);
     this->MemoryHdc = (HDC)0;
     DeleteObject(this->MemoryBuffer);
-    if (wglDeleteContext(this->ContextId) != TRUE) 
+    if (wglDeleteContext(this->ContextId) != TRUE)
       {
       vtkErrorMacro("wglDeleteContext failed in CleanUpOffScreenRendering(), error: " << GetLastError());
       }
@@ -1429,7 +1429,7 @@ void vtkWin32OpenGLRenderWindow::CleanUpOffScreenRendering(void)
 
 void vtkWin32OpenGLRenderWindow::ResumeScreenRendering(void)
 {
-  // release OpenGL graphics resources before switch back to on-screen. 
+  // release OpenGL graphics resources before switch back to on-screen.
   if(this->ContextId!=0)
     {
       this->MakeCurrent();
@@ -1467,10 +1467,10 @@ void vtkWin32OpenGLRenderWindow::ShowCursor()
   this->CursorHidden = 0;
 
   ::ShowCursor(!this->CursorHidden);
-}                                  
+}
 
 //----------------------------------------------------------------------------
-void vtkWin32OpenGLRenderWindow::SetCursorPosition(int x, int y) 
+void vtkWin32OpenGLRenderWindow::SetCursorPosition(int x, int y)
 {
   int *size = this->GetSize();
 
@@ -1517,7 +1517,7 @@ void vtkWin32OpenGLRenderWindow::SetCurrentCursor(int shape)
       cursorName = IDC_SIZEALL;
       break;
     case VTK_CURSOR_HAND:
-#if(WINVER >= 0x0500)      
+#if(WINVER >= 0x0500)
       cursorName = IDC_HAND;
 #else
       cursorName = IDC_ARROW;
@@ -1527,10 +1527,10 @@ void vtkWin32OpenGLRenderWindow::SetCurrentCursor(int shape)
       cursorName = IDC_CROSS;
       break;
     }
-  
+
   if (cursorName)
     {
-    HANDLE cursor = 
+    HANDLE cursor =
       LoadImage(0,cursorName,IMAGE_CURSOR,0,0,LR_SHARED | LR_DEFAULTSIZE);
     SetCursor((HCURSOR)cursor);
     }
diff --git a/Rendering/vtkWin32RenderWindowInteractor.cxx b/Rendering/vtkWin32RenderWindowInteractor.cxx
index a53bbc8..8a3dc63 100644
--- a/Rendering/vtkWin32RenderWindowInteractor.cxx
+++ b/Rendering/vtkWin32RenderWindowInteractor.cxx
@@ -17,10 +17,12 @@
 #include <string.h>
 #include <math.h>
 
-#define _WIN32_WINNT 0x0400  // for trackmouseevent support  requires Win95 with IE 3.0 or greater.
-
 #include "vtkWin32OpenGLRenderWindow.h"
 
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0400  // for trackmouseevent support  requires Win95 with IE 3.0 or greater.
+#endif
+
 // Mouse wheel support
 // In an ideal world we would just have to include <zmouse.h>, but it is not
 // always available with all compilers/headers
@@ -31,7 +33,7 @@
 #  define GET_WHEEL_DELTA_WPARAM(wparam) ((short)HIWORD (wparam))
 #endif  //GET_WHEEL_DELTA_WPARAM
 
-// MSVC does the right thing without the forward declaration when it 
+// MSVC does the right thing without the forward declaration when it
 // sees it in the friend decl in vtkWin32RenderWindowInteractor, but
 // GCC needs to see the declaration beforehand. It has to do with the
 // CALLBACK attribute.
@@ -60,42 +62,42 @@ void (*vtkWin32RenderWindowInteractor::ClassExitMethodArgDelete)(void *) = (void
 
 //----------------------------------------------------------------------------
 // Construct object so that light follows camera motion.
-vtkWin32RenderWindowInteractor::vtkWin32RenderWindowInteractor() 
+vtkWin32RenderWindowInteractor::vtkWin32RenderWindowInteractor()
 {
   this->WindowId           = 0;
   this->InstallMessageProc = 1;
   this->MouseInWindow = 0;
   this->StartedMessageLoop = 0;
-  
+
 #ifdef VTK_USE_TDX
   this->Device=vtkTDxWinDevice::New();
 #endif
 }
 
 //----------------------------------------------------------------------------
-vtkWin32RenderWindowInteractor::~vtkWin32RenderWindowInteractor() 
+vtkWin32RenderWindowInteractor::~vtkWin32RenderWindowInteractor()
 {
   vtkWin32OpenGLRenderWindow *tmp;
 
   // we need to release any hold we have on a windows event loop
-  if (this->WindowId && this->Enabled && this->InstallMessageProc) 
+  if (this->WindowId && this->Enabled && this->InstallMessageProc)
     {
     vtkWin32OpenGLRenderWindow *ren;
     ren = static_cast<vtkWin32OpenGLRenderWindow *>(this->RenderWindow);
     tmp = (vtkWin32OpenGLRenderWindow *)(vtkGetWindowLong(this->WindowId,sizeof(vtkLONG)));
     // watch for odd conditions
-    if ((tmp != ren) && (ren != NULL)) 
+    if ((tmp != ren) && (ren != NULL))
       {
       // OK someone else has a hold on our event handler
       // so lets have them handle this stuff
       // well send a USER message to the other
       // event handler so that it can properly
       // call this event handler if required
-      CallWindowProc(this->OldProc,this->WindowId,WM_USER+14,28,(LONG)this->OldProc);
+      CallWindowProc(this->OldProc,this->WindowId,WM_USER+14,28,(intptr_t)this->OldProc);
       }
-    else 
+    else
       {
-      vtkSetWindowLong(this->WindowId,vtkGWL_WNDPROC,(vtkLONG)this->OldProc);
+      vtkSetWindowLong(this->WindowId,vtkGWL_WNDPROC,(intptr_t)this->OldProc);
       }
     this->Enabled = 0;
     }
@@ -105,7 +107,7 @@ vtkWin32RenderWindowInteractor::~vtkWin32RenderWindowInteractor()
 }
 
 //----------------------------------------------------------------------------
-void  vtkWin32RenderWindowInteractor::Start() 
+void  vtkWin32RenderWindowInteractor::Start()
 {
   // Let the compositing handle the event loop if it wants to.
   if (this->HasObserver(vtkCommand::StartEvent) && !this->HandleEventLoop)
@@ -132,18 +134,18 @@ void  vtkWin32RenderWindowInteractor::Start()
 
 //----------------------------------------------------------------------------
 // Begin processing keyboard strokes.
-void vtkWin32RenderWindowInteractor::Initialize() 
+void vtkWin32RenderWindowInteractor::Initialize()
 {
   vtkWin32OpenGLRenderWindow *ren;
   int *size;
 
   // make sure we have a RenderWindow and camera
-  if ( ! this->RenderWindow) 
+  if ( ! this->RenderWindow)
     {
     vtkErrorMacro(<<"No renderer defined!");
     return;
     }
-  if (this->Initialized) 
+  if (this->Initialized)
     {
     return;
     }
@@ -160,35 +162,35 @@ void vtkWin32RenderWindowInteractor::Initialize()
 }
 
 //----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::Enable() 
+void vtkWin32RenderWindowInteractor::Enable()
 {
   vtkWin32OpenGLRenderWindow *ren;
   vtkWin32OpenGLRenderWindow *tmp;
-  if (this->Enabled) 
+  if (this->Enabled)
     {
     return;
     }
-  if (this->InstallMessageProc) 
+  if (this->InstallMessageProc)
     {
     // add our callback
     ren = (vtkWin32OpenGLRenderWindow *)(this->RenderWindow);
     this->OldProc = (WNDPROC)vtkGetWindowLong(this->WindowId,vtkGWL_WNDPROC);
     tmp=(vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(this->WindowId,sizeof(vtkLONG));
     // watch for odd conditions
-    if (tmp != ren) 
+    if (tmp != ren)
       {
       // OK someone else has a hold on our event handler
       // so lets have them handle this stuff
       // well send a USER message to the other
       // event handler so that it can properly
       // call this event handler if required
-      CallWindowProc(this->OldProc,this->WindowId,WM_USER+12,24,(LONG)vtkHandleMessage);
+      CallWindowProc(this->OldProc,this->WindowId,WM_USER+12,24,(intptr_t)vtkHandleMessage);
       }
-    else 
+    else
       {
-      vtkSetWindowLong(this->WindowId,vtkGWL_WNDPROC,(vtkLONG)vtkHandleMessage);
+      vtkSetWindowLong(this->WindowId,vtkGWL_WNDPROC,(intptr_t)vtkHandleMessage);
       }
-    
+
 #ifdef VTK_USE_TDX
     if(this->UseTDx)
       {
@@ -197,7 +199,7 @@ void vtkWin32RenderWindowInteractor::Enable()
       this->Device->StartListening();
       }
 #endif
-    
+
     // in case the size of the window has changed while we were away
     int *size;
     size = ren->GetSize();
@@ -210,33 +212,33 @@ void vtkWin32RenderWindowInteractor::Enable()
 
 
 //----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::Disable() 
+void vtkWin32RenderWindowInteractor::Disable()
 {
   vtkWin32OpenGLRenderWindow *tmp;
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
-  
-  if (this->InstallMessageProc && this->Enabled && this->WindowId) 
+
+  if (this->InstallMessageProc && this->Enabled && this->WindowId)
     {
     // we need to release any hold we have on a windows event loop
     vtkWin32OpenGLRenderWindow *ren;
     ren = (vtkWin32OpenGLRenderWindow *)(this->RenderWindow);
     tmp = (vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(this->WindowId,sizeof(vtkLONG));
     // watch for odd conditions
-    if ((tmp != ren) && (ren != NULL)) 
+    if ((tmp != ren) && (ren != NULL))
       {
       // OK someone else has a hold on our event handler
       // so lets have them handle this stuff
       // well send a USER message to the other
       // event handler so that it can properly
       // call this event handler if required
-      CallWindowProc(this->OldProc,this->WindowId,WM_USER+14,28,(LONG)this->OldProc);
+      CallWindowProc(this->OldProc,this->WindowId,WM_USER+14,28,(intptr_t)this->OldProc);
       }
-    else 
+    else
       {
-      vtkSetWindowLong(this->WindowId,vtkGWL_WNDPROC,(vtkLONG)this->OldProc);
+      vtkSetWindowLong(this->WindowId,vtkGWL_WNDPROC,(intptr_t)this->OldProc);
       }
 #ifdef VTK_USE_TDX
     if(this->Device->GetInitialized())
@@ -270,7 +272,7 @@ int vtkWin32RenderWindowInteractor::InternalCreateTimer(int timerId, int vtkNotU
 }
 
 //----------------------------------------------------------------------------
-int vtkWin32RenderWindowInteractor::InternalDestroyTimer(int platformTimerId) 
+int vtkWin32RenderWindowInteractor::InternalDestroyTimer(int platformTimerId)
 {
   return KillTimer(this->WindowId,platformTimerId);
 }
@@ -282,42 +284,42 @@ int vtkWin32RenderWindowInteractor::InternalDestroyTimer(int platformTimerId)
 // this ascii code to keysym table is meant to mimic Tk
 
 static const char *AsciiToKeySymTable[] = {
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-  "space", "exclam", "quotedbl", "numbersign", 
-  "dollar", "percent", "ampersand", "quoteright", 
-  "parenleft", "parenright", "asterisk", "plus", 
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  "space", "exclam", "quotedbl", "numbersign",
+  "dollar", "percent", "ampersand", "quoteright",
+  "parenleft", "parenright", "asterisk", "plus",
   "comma", "minus", "period", "slash",
-  "0", "1", "2", "3", "4", "5", "6", "7", 
+  "0", "1", "2", "3", "4", "5", "6", "7",
   "8", "9", "colon", "semicolon", "less", "equal", "greater", "question",
-  "at", "A", "B", "C", "D", "E", "F", "G", 
+  "at", "A", "B", "C", "D", "E", "F", "G",
   "H", "I", "J", "K", "L", "M", "N", "O",
   "P", "Q", "R", "S", "T", "U", "V", "W",
-  "X", "Y", "Z", "bracketleft", 
+  "X", "Y", "Z", "bracketleft",
   "backslash", "bracketright", "asciicircum", "underscore",
   "quoteleft", "a", "b", "c", "d", "e", "f", "g",
   "h", "i", "j", "k", "l", "m", "n", "o",
   "p", "q", "r", "s", "t", "u", "v", "w",
   "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Delete",
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-  
+
 // this virtual key code to keysym table is meant to mimic Tk
 
 static const char *VKeyCodeToKeySymTable[] = {
   0, 0, 0, "Cancel", 0, 0, 0, 0,
   "BackSpace", "Tab", 0, 0, "Clear", "Return", 0, 0,
-  "Shift_L", "Control_L", "Alt_L", "Pause", "Caps_Lock", 0,0,0, 
+  "Shift_L", "Control_L", "Alt_L", "Pause", "Caps_Lock", 0,0,0,
   0, 0, 0, "Escape", 0, 0, 0, 0,
   "space", "Prior", "Next", "End", "Home", "Left", "Up", "Right",
   "Down", "Select", 0, "Execute", "Snapshot", "Insert", "Delete", "Help",
-  "0", "1", "2", "3", "4", "5", "6", "7", 
+  "0", "1", "2", "3", "4", "5", "6", "7",
   "8", "9", 0, 0, 0, 0, 0, 0,
   0, "a", "b", "c", "d", "e", "f", "g",
   "h", "i", "j", "k", "l", "m", "n", "o",
@@ -326,7 +328,7 @@ static const char *VKeyCodeToKeySymTable[] = {
   "KP_0", "KP_1", "KP_2", "KP_3", "KP_4", "KP_5", "KP_6", "KP_7",
   "KP_8", "KP_9", "asterisk", "plus", "bar", "minus", "period", "slash",
   "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8",
-  "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16", 
+  "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16",
   "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24",
   0, 0, 0, 0, 0, 0, 0, 0,
   "Num_Lock", "Scroll_Lock", 0, 0, 0, 0, 0, 0,
@@ -341,20 +343,20 @@ static const char *VKeyCodeToKeySymTable[] = {
 //-------------------------------------------------------------
 // Event loop handlers
 //-------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnMouseMove(HWND hWnd, UINT nFlags, 
-                                                 int X, int Y) 
+void vtkWin32RenderWindowInteractor::OnMouseMove(HWND hWnd, UINT nFlags,
+                                                 int X, int Y)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
 
-  this->SetEventInformationFlipY(X, 
-                                 Y, 
-                                 nFlags & MK_CONTROL, 
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
                                  nFlags & MK_SHIFT);
   this->SetAltKey(GetKeyState(VK_MENU) & (~1));
-  if (!this->MouseInWindow && 
+  if (!this->MouseInWindow &&
       (X >= 0 && X < this->Size[0] && Y >= 0 && Y < this->Size[1]))
     {
     this->InvokeEvent(vtkCommand::EnterEvent, NULL);
@@ -366,15 +368,15 @@ void vtkWin32RenderWindowInteractor::OnMouseMove(HWND hWnd, UINT nFlags,
     tme.hwndTrack = hWnd;
     TrackMouseEvent(&tme);
     }
- 
+
   this->InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
 }
 
 //----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnNCMouseMove(HWND, UINT nFlags, 
-                                                   int X, int Y) 
+void vtkWin32RenderWindowInteractor::OnNCMouseMove(HWND, UINT nFlags,
+                                                   int X, int Y)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
@@ -382,9 +384,9 @@ void vtkWin32RenderWindowInteractor::OnNCMouseMove(HWND, UINT nFlags,
   int *pos = this->RenderWindow->GetPosition();
   if (this->MouseInWindow)
     {
-    this->SetEventInformationFlipY(X - pos[0], 
+    this->SetEventInformationFlipY(X - pos[0],
                                    Y - pos[1],
-                                   nFlags & MK_CONTROL, 
+                                   nFlags & MK_CONTROL,
                                    nFlags & MK_SHIFT);
     this->SetAltKey(GetKeyState(VK_MENU) & (~1));
     this->InvokeEvent(vtkCommand::LeaveEvent, NULL);
@@ -393,50 +395,50 @@ void vtkWin32RenderWindowInteractor::OnNCMouseMove(HWND, UINT nFlags,
 }
 
 //----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnMouseWheelForward(HWND,UINT nFlags, 
-                                                   int X, int Y) 
+void vtkWin32RenderWindowInteractor::OnMouseWheelForward(HWND,UINT nFlags,
+                                                   int X, int Y)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
-  this->SetEventInformationFlipY(X, 
-                                 Y, 
-                                 nFlags & MK_CONTROL, 
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
                                  nFlags & MK_SHIFT);
   this->SetAltKey(GetKeyState(VK_MENU) & (~1));
   this->InvokeEvent(vtkCommand::MouseWheelForwardEvent,NULL);
 }
 
 //----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnMouseWheelBackward(HWND,UINT nFlags, 
-                                                   int X, int Y) 
+void vtkWin32RenderWindowInteractor::OnMouseWheelBackward(HWND,UINT nFlags,
+                                                   int X, int Y)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
-  this->SetEventInformationFlipY(X, 
-                                 Y, 
-                                 nFlags & MK_CONTROL, 
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
                                  nFlags & MK_SHIFT);
   this->SetAltKey(GetKeyState(VK_MENU) & (~1));
   this->InvokeEvent(vtkCommand::MouseWheelBackwardEvent,NULL);
 }
 
 //----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnLButtonDown(HWND wnd,UINT nFlags, 
-                                                   int X, int Y, int repeat) 
+void vtkWin32RenderWindowInteractor::OnLButtonDown(HWND wnd,UINT nFlags,
+                                                   int X, int Y, int repeat)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
   SetFocus(wnd);
   SetCapture(wnd);
-  this->SetEventInformationFlipY(X, 
-                                 Y, 
-                                 nFlags & MK_CONTROL, 
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
                                  nFlags & MK_SHIFT,
                                  0, repeat);
   this->SetAltKey(GetKeyState(VK_MENU) & (~1));
@@ -444,16 +446,16 @@ void vtkWin32RenderWindowInteractor::OnLButtonDown(HWND wnd,UINT nFlags,
 }
 
 //----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnLButtonUp(HWND,UINT nFlags, 
-                                                 int X, int Y) 
+void vtkWin32RenderWindowInteractor::OnLButtonUp(HWND,UINT nFlags,
+                                                 int X, int Y)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
-  this->SetEventInformationFlipY(X, 
-                                 Y, 
-                                 nFlags & MK_CONTROL, 
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
                                  nFlags & MK_SHIFT);
   this->SetAltKey(GetKeyState(VK_MENU) & (~1));
   this->InvokeEvent(vtkCommand::LeftButtonReleaseEvent,NULL);
@@ -461,18 +463,18 @@ void vtkWin32RenderWindowInteractor::OnLButtonUp(HWND,UINT nFlags,
 }
 
 //----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnMButtonDown(HWND wnd,UINT nFlags, 
-                                                   int X, int Y, int repeat) 
+void vtkWin32RenderWindowInteractor::OnMButtonDown(HWND wnd,UINT nFlags,
+                                                   int X, int Y, int repeat)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
   SetFocus(wnd);
   SetCapture(wnd);
-  this->SetEventInformationFlipY(X, 
-                                 Y, 
-                                 nFlags & MK_CONTROL, 
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
                                  nFlags & MK_SHIFT,
                                  0, repeat);
   this->SetAltKey(GetKeyState(VK_MENU) & (~1));
@@ -480,16 +482,16 @@ void vtkWin32RenderWindowInteractor::OnMButtonDown(HWND wnd,UINT nFlags,
 }
 
 //----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnMButtonUp(HWND,UINT nFlags, 
-                                                 int X, int Y) 
+void vtkWin32RenderWindowInteractor::OnMButtonUp(HWND,UINT nFlags,
+                                                 int X, int Y)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
-  this->SetEventInformationFlipY(X, 
-                                 Y, 
-                                 nFlags & MK_CONTROL, 
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
                                  nFlags & MK_SHIFT);
   this->SetAltKey(GetKeyState(VK_MENU) & (~1));
   this->InvokeEvent(vtkCommand::MiddleButtonReleaseEvent,NULL);
@@ -497,18 +499,18 @@ void vtkWin32RenderWindowInteractor::OnMButtonUp(HWND,UINT nFlags,
 }
 
 //----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnRButtonDown(HWND wnd,UINT nFlags, 
-                                                   int X, int Y, int repeat) 
+void vtkWin32RenderWindowInteractor::OnRButtonDown(HWND wnd,UINT nFlags,
+                                                   int X, int Y, int repeat)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
   SetFocus(wnd);
   SetCapture(wnd);
-  this->SetEventInformationFlipY(X, 
-                                 Y, 
-                                 nFlags & MK_CONTROL, 
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
                                  nFlags & MK_SHIFT,
                                  0, repeat);
   this->SetAltKey(GetKeyState(VK_MENU) & (~1));
@@ -516,16 +518,16 @@ void vtkWin32RenderWindowInteractor::OnRButtonDown(HWND wnd,UINT nFlags,
 }
 
 //----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnRButtonUp(HWND,UINT nFlags, 
-                                                 int X, int Y) 
+void vtkWin32RenderWindowInteractor::OnRButtonUp(HWND,UINT nFlags,
+                                                 int X, int Y)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
-  this->SetEventInformationFlipY(X, 
-                                 Y, 
-                                 nFlags & MK_CONTROL, 
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
                                  nFlags & MK_SHIFT);
   this->SetAltKey(GetKeyState(VK_MENU) & (~1));
   this->InvokeEvent(vtkCommand::RightButtonReleaseEvent,NULL);
@@ -542,15 +544,15 @@ void vtkWin32RenderWindowInteractor::OnSize(HWND,UINT, int X, int Y) {
 }
 
 //----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnTimer(HWND,UINT timerId) 
+void vtkWin32RenderWindowInteractor::OnTimer(HWND,UINT timerId)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
   int tid = static_cast<int>(timerId);
   this->InvokeEvent(vtkCommand::TimerEvent,(void*)&tid);
-  
+
   // Here we deal with one-shot versus repeating timers
   if ( this->IsOneShotTimer(tid) )
     {
@@ -578,7 +580,7 @@ void vtkWin32RenderWindowInteractor::OnKeyDown(HWND, UINT vCode, UINT nRepCnt, U
       nChar = 0;
       }
 #endif
-  } 
+  }
   const char *keysym = AsciiToKeySymTable[(unsigned char)nChar];
   if (keysym == 0)
     {
@@ -588,10 +590,10 @@ void vtkWin32RenderWindowInteractor::OnKeyDown(HWND, UINT vCode, UINT nRepCnt, U
     {
     keysym = "None";
     }
-  this->SetKeyEventInformation(ctrl, 
-                               shift, 
-                               nChar, 
-                               nRepCnt, 
+  this->SetKeyEventInformation(ctrl,
+                               shift,
+                               nChar,
+                               nRepCnt,
                                keysym);
   this->SetAltKey(alt);
   this->InvokeEvent(vtkCommand::KeyPressEvent, NULL);
@@ -627,10 +629,10 @@ void vtkWin32RenderWindowInteractor::OnKeyUp(HWND, UINT vCode, UINT nRepCnt, UIN
     {
     keysym = "None";
     }
-  this->SetKeyEventInformation(ctrl, 
-                               shift, 
-                               nChar, 
-                               nRepCnt, 
+  this->SetKeyEventInformation(ctrl,
+                               shift,
+                               nChar,
+                               nRepCnt,
                                keysym);
   this->SetAltKey(alt);
   this->InvokeEvent(vtkCommand::KeyReleaseEvent, NULL);
@@ -645,11 +647,11 @@ void vtkWin32RenderWindowInteractor::OnChar(HWND,UINT nChar,
     return;
     }
   int ctrl  = GetKeyState(VK_CONTROL) & (~1);
-  int shift = GetKeyState(VK_SHIFT) & (~1); 
+  int shift = GetKeyState(VK_SHIFT) & (~1);
   int alt = GetKeyState(VK_MENU) & (~1);
-  this->SetKeyEventInformation(ctrl, 
-                               shift, 
-                               nChar, 
+  this->SetKeyEventInformation(ctrl,
+                               shift,
+                               nChar,
                                nRepCnt);
   this->SetAltKey(alt);
   this->InvokeEvent(vtkCommand::CharEvent, NULL);
@@ -658,11 +660,11 @@ void vtkWin32RenderWindowInteractor::OnChar(HWND,UINT nChar,
 //----------------------------------------------------------------------------
 void vtkWin32RenderWindowInteractor::OnFocus(HWND,UINT)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
-  
+
 #ifdef VTK_USE_TDX
   if(this->Device->GetInitialized() && !this->Device->GetIsListening())
     {
@@ -674,7 +676,7 @@ void vtkWin32RenderWindowInteractor::OnFocus(HWND,UINT)
 //----------------------------------------------------------------------------
 void vtkWin32RenderWindowInteractor::OnKillFocus(HWND,UINT)
 {
-  if (!this->Enabled) 
+  if (!this->Enabled)
     {
     return;
     }
@@ -688,8 +690,8 @@ void vtkWin32RenderWindowInteractor::OnKillFocus(HWND,UINT)
 
 //----------------------------------------------------------------------------
 // This is only called when InstallMessageProc is true
-LRESULT CALLBACK vtkHandleMessage(HWND hWnd,UINT uMsg, WPARAM wParam, 
-                                  LPARAM lParam) 
+LRESULT CALLBACK vtkHandleMessage(HWND hWnd,UINT uMsg, WPARAM wParam,
+                                  LPARAM lParam)
 {
   LRESULT res = 0;
   vtkWin32OpenGLRenderWindow *ren;
@@ -713,33 +715,33 @@ LRESULT CALLBACK vtkHandleMessage(HWND hWnd,UINT uMsg, WPARAM wParam,
 }
 
 #ifndef MAKEPOINTS
-#define MAKEPOINTS(l)   (*((POINTS FAR *) & (l))) 
+#define MAKEPOINTS(l)   (*((POINTS FAR *) & (l)))
 #endif
 
 //----------------------------------------------------------------------------
-LRESULT CALLBACK vtkHandleMessage2(HWND hWnd,UINT uMsg, WPARAM wParam, 
-                                   LPARAM lParam, 
-                                   vtkWin32RenderWindowInteractor *me) 
+LRESULT CALLBACK vtkHandleMessage2(HWND hWnd,UINT uMsg, WPARAM wParam,
+                                   LPARAM lParam,
+                                   vtkWin32RenderWindowInteractor *me)
 {
-  if ((uMsg == WM_USER+13)&&(wParam == 26)) 
+  if ((uMsg == WM_USER+13)&&(wParam == 26))
     {
     // someone is telling us to set our OldProc
     me->OldProc = (WNDPROC)lParam;
     return 1;
     }
-  
-  switch (uMsg) 
+
+  switch (uMsg)
     {
     case WM_PAINT:
       me->Render();
       return CallWindowProc(me->OldProc,hWnd,uMsg,wParam,lParam);
       break;
-      
+
     case WM_SIZE:
       me->OnSize(hWnd,wParam,LOWORD(lParam),HIWORD(lParam));
       return CallWindowProc(me->OldProc,hWnd,uMsg,wParam,lParam);
       break;
-      
+
     case WM_LBUTTONDBLCLK:
       me->OnLButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 1);
       break;
@@ -747,7 +749,7 @@ LRESULT CALLBACK vtkHandleMessage2(HWND hWnd,UINT uMsg, WPARAM wParam,
     case WM_LBUTTONDOWN:
       me->OnLButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 0);
       break;
-      
+
     case WM_LBUTTONUP:
       me->OnLButtonUp(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
       break;
@@ -759,11 +761,11 @@ LRESULT CALLBACK vtkHandleMessage2(HWND hWnd,UINT uMsg, WPARAM wParam,
     case WM_MBUTTONDOWN:
       me->OnMButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 0);
       break;
-      
+
     case WM_MBUTTONUP:
       me->OnMButtonUp(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
       break;
-      
+
     case WM_RBUTTONDBLCLK:
       me->OnRButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 1);
       break;
@@ -771,7 +773,7 @@ LRESULT CALLBACK vtkHandleMessage2(HWND hWnd,UINT uMsg, WPARAM wParam,
     case WM_RBUTTONDOWN:
       me->OnRButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 0);
       break;
-      
+
     case WM_RBUTTONUP:
       me->OnRButtonUp(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
       break;
@@ -811,7 +813,7 @@ LRESULT CALLBACK vtkHandleMessage2(HWND hWnd,UINT uMsg, WPARAM wParam,
     case WM_CHAR:
       me->OnChar(hWnd,wParam,LOWORD(lParam),HIWORD(lParam));
       break;
-      
+
     case WM_KEYDOWN:
     case WM_SYSKEYDOWN:
       me->OnKeyDown(hWnd,wParam,LOWORD(lParam),HIWORD(lParam));
@@ -823,7 +825,7 @@ LRESULT CALLBACK vtkHandleMessage2(HWND hWnd,UINT uMsg, WPARAM wParam,
       break;
 
     case WM_TIMER:
-      me->OnTimer(hWnd,wParam);    
+      me->OnTimer(hWnd,wParam);
       break;
 
     case WM_ACTIVATE:
@@ -836,25 +838,25 @@ LRESULT CALLBACK vtkHandleMessage2(HWND hWnd,UINT uMsg, WPARAM wParam,
         me->OnFocus(hWnd,wParam);
         }
       break;
-      
+
     case WM_SETFOCUS:
       // occurs when SetFocus() is called on the current window
       me->OnFocus(hWnd,wParam);
       break;
-      
+
     case WM_KILLFOCUS:
       // occurs when the focus was on the current window and SetFocus() is
-      // called on another window. 
+      // called on another window.
       me->OnKillFocus(hWnd,wParam);
       break;
-      
+
     default:
-      if (me) 
+      if (me)
         {
         return CallWindowProc(me->OldProc,hWnd,uMsg,wParam,lParam);
         }
     };
-  
+
   return 0;
 }