Commit 7257d4c89e52aa727df25564109cecc4d33b9543

Daniel Stone 2010-06-21T14:28:34

Use CARD32 instead of Atom, move geom headers in Use CARD32 instead of Atom/KeySym/et al to avoid type size confusion between server and non-server code; relatedly, move the geometry headers in from kbproto, so every non-simple type (i.e. structs containing nothing more than basic types) is now copied into xkbcommon. Signed-off-by: Daniel Stone <daniel@fooishbar.org>

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
diff --git a/include/X11/extensions/XKBcommon.h b/include/X11/extensions/XKBcommon.h
index 2881458..49887fe 100644
--- a/include/X11/extensions/XKBcommon.h
+++ b/include/X11/extensions/XKBcommon.h
@@ -25,18 +25,43 @@ sale, use or other dealings in this Software without prior written
 authorization from the authors.
 */
 
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+
+
 #ifndef _XKBCOMMON_H_
 #define _XKBCOMMON_H_
 
 #include <stdint.h>
 #include <stdio.h>
 #include <X11/Xfuncproto.h>
+#include <X11/Xmd.h>
 #include <X11/extensions/XKBstrcommon.h>
 #include <X11/extensions/XKBrulescommon.h>
 
-#define KeySym CARD32
-#define Atom CARD32
-
 /* Action structures used in the server */
 
 #define XkbcAnyActionDataSize 18
@@ -121,17 +146,27 @@ typedef union _XkbcAction {
     XkbPtrAction             ptr; /* XXX delete for DeviceValuator */
     XkbPtrBtnAction          btn; /* XXX delete for DeviceBtn */
     XkbMessageAction         msg; /* XXX just delete */
-    unsigned char           type;
+    unsigned char            type;
 } XkbcAction;
 
+typedef struct _XkbcKeyType {
+    XkbModsRec              mods;
+    unsigned char           num_levels;
+    unsigned char           map_count;
+    XkbKTMapEntryPtr        map;
+    XkbModsPtr              preserve;
+    CARD32                  name;
+    CARD32                 *level_names;
+} XkbcKeyTypeRec, *XkbcKeyTypePtr;
+
 typedef struct _XkbcSymInterpretRec {
     CARD32          sym;
     unsigned char   flags;
     unsigned char   match;
     unsigned char   mods;
     unsigned char   virtual_mod;
-    XkbcAnyAction    act;
-} XkbcSymInterpretRec,*XkbcSymInterpretPtr;
+    XkbcAnyAction   act;
+} XkbcSymInterpretRec, *XkbcSymInterpretPtr;
 
 typedef struct _XkbcCompatMapRec {
     XkbcSymInterpretPtr      sym_interpret;
@@ -143,7 +178,7 @@ typedef struct _XkbcCompatMapRec {
 typedef struct _XkbcClientMapRec {
     unsigned char            size_types;
     unsigned char            num_types;
-    XkbKeyTypePtr            types;
+    XkbcKeyTypePtr           types;
 
     unsigned short           size_syms;
     unsigned short           num_syms;
@@ -172,6 +207,265 @@ typedef struct _XkbcServerMapRec {
     uint32_t            *vmodmap;
 } XkbcServerMapRec, *XkbcServerMapPtr;
 
+typedef struct _XkbcNamesRec {
+    CARD32            keycodes;
+    CARD32            geometry;
+    CARD32            symbols;
+    CARD32            types;
+    CARD32            compat;
+    CARD32            vmods[XkbNumVirtualMods];
+    CARD32            indicators[XkbNumIndicators];
+    CARD32            groups[XkbNumKbdGroups];
+    XkbKeyNamePtr     keys;
+    XkbKeyAliasPtr    key_aliases;
+    CARD32           *radio_groups;
+    CARD32            phys_symbols;
+
+    unsigned char     num_keys;
+    unsigned char     num_key_aliases;
+    unsigned short    num_rg;
+} XkbcNamesRec, *XkbcNamesPtr;
+
+typedef	struct _XkbcProperty {
+	char	*name;
+	char	*value;
+} XkbcPropertyRec, *XkbcPropertyPtr;
+
+typedef struct _XkbcColor {
+	unsigned int 	pixel;
+	char *		spec;
+} XkbcColorRec, *XkbcColorPtr;
+
+typedef	struct _XkbcPoint {
+	short	x;
+	short	y;
+} XkbcPointRec, *XkbcPointPtr;
+
+typedef struct	_XkbcBounds {
+	short	x1,y1;
+	short	x2,y2;
+} XkbcBoundsRec, *XkbcBoundsPtr;
+#define	XkbBoundsWidth(b)	(((b)->x2)-((b)->x1))
+#define	XkbBoundsHeight(b)	(((b)->y2)-((b)->y1))
+
+typedef struct _XkbcOutline {
+	unsigned short	num_points;
+	unsigned short	sz_points;
+	unsigned short	corner_radius;
+	XkbcPointPtr	points;
+} XkbcOutlineRec, *XkbcOutlinePtr;
+
+typedef struct _XkbcShape {
+	CARD32		 name;
+	unsigned short	 num_outlines;
+	unsigned short	 sz_outlines;
+	XkbcOutlinePtr	 outlines;
+	XkbcOutlinePtr	 approx;
+	XkbcOutlinePtr	 primary;
+	XkbcBoundsRec	 bounds;
+} XkbcShapeRec, *XkbcShapePtr;
+#define	XkbOutlineIndex(s,o)	((int)((o)-&(s)->outlines[0]))
+
+typedef struct _XkbcShapeDoodad {
+	CARD32		 name;
+	unsigned char	 type;
+	unsigned char	 priority;
+	short		 top;
+	short		 left;
+	short		 angle;
+	unsigned short	 color_ndx;
+	unsigned short	 shape_ndx;
+} XkbcShapeDoodadRec, *XkbcShapeDoodadPtr;
+#define	XkbShapeDoodadColor(g,d)	(&(g)->colors[(d)->color_ndx])
+#define	XkbShapeDoodadShape(g,d)	(&(g)->shapes[(d)->shape_ndx])
+#define	XkbSetShapeDoodadColor(g,d,c)	((d)->color_ndx= (c)-&(g)->colors[0])
+#define	XkbSetShapeDoodadShape(g,d,s)	((d)->shape_ndx= (s)-&(g)->shapes[0])
+
+typedef struct _XkbcTextDoodad {
+	CARD32		 name;
+	unsigned char	 type;
+	unsigned char	 priority;
+	short		 top;
+	short		 left;
+	short		 angle;
+	short		 width;
+	short		 height;
+	unsigned short	 color_ndx;
+	char *		 text;
+	char *		 font;
+} XkbcTextDoodadRec, *XkbcTextDoodadPtr;
+#define	XkbTextDoodadColor(g,d)	(&(g)->colors[(d)->color_ndx])
+#define	XkbSetTextDoodadColor(g,d,c)	((d)->color_ndx= (c)-&(g)->colors[0])
+
+typedef struct _XkbcIndicatorDoodad {
+	CARD32		 name;
+	unsigned char	 type;
+	unsigned char	 priority;
+	short		 top;
+	short		 left;
+	short		 angle;
+	unsigned short	 shape_ndx;
+	unsigned short	 on_color_ndx;
+	unsigned short	 off_color_ndx;
+} XkbcIndicatorDoodadRec, *XkbcIndicatorDoodadPtr;
+#define	XkbIndicatorDoodadShape(g,d)	(&(g)->shapes[(d)->shape_ndx])
+#define	XkbIndicatorDoodadOnColor(g,d)	(&(g)->colors[(d)->on_color_ndx])
+#define	XkbIndicatorDoodadOffColor(g,d)	(&(g)->colors[(d)->off_color_ndx])
+#define	XkbSetIndicatorDoodadOnColor(g,d,c) \
+				((d)->on_color_ndx= (c)-&(g)->colors[0])
+#define	XkbSetIndicatorDoodadOffColor(g,d,c) \
+				((d)->off_color_ndx= (c)-&(g)->colors[0])
+#define	XkbSetIndicatorDoodadShape(g,d,s) \
+				((d)->shape_ndx= (s)-&(g)->shapes[0])
+
+typedef struct _XkbcLogoDoodad {
+	CARD32		 name;
+	unsigned char	 type;
+	unsigned char	 priority;
+	short		 top;
+	short		 left;
+	short		 angle;
+	unsigned short	 color_ndx;
+	unsigned short	 shape_ndx;
+	char *		 logo_name;
+} XkbcLogoDoodadRec, *XkbcLogoDoodadPtr;
+#define	XkbLogoDoodadColor(g,d)		(&(g)->colors[(d)->color_ndx])
+#define	XkbLogoDoodadShape(g,d)		(&(g)->shapes[(d)->shape_ndx])
+#define	XkbSetLogoDoodadColor(g,d,c)	((d)->color_ndx= (c)-&(g)->colors[0])
+#define	XkbSetLogoDoodadShape(g,d,s)	((d)->shape_ndx= (s)-&(g)->shapes[0])
+
+typedef struct _XkbcAnyDoodad {
+	CARD32		 name;
+	unsigned char	 type;
+	unsigned char	 priority;
+	short		 top;
+	short		 left;
+	short		 angle;
+} XkbcAnyDoodadRec, *XkbcAnyDoodadPtr;
+
+typedef union _XkbcDoodad {
+	XkbcAnyDoodadRec	any;
+	XkbcShapeDoodadRec	shape;
+	XkbcTextDoodadRec	text;
+	XkbcIndicatorDoodadRec	indicator;
+	XkbcLogoDoodadRec	logo;
+} XkbcDoodadRec, *XkbcDoodadPtr;
+
+#define	XkbUnknownDoodad	0
+#define	XkbOutlineDoodad	1
+#define	XkbSolidDoodad		2
+#define	XkbTextDoodad		3
+#define	XkbIndicatorDoodad	4
+#define	XkbLogoDoodad		5
+
+typedef struct _XkbcKey {
+	XkbKeyNameRec	 name;
+	short		 gap;
+	unsigned char	 shape_ndx;
+	unsigned char	 color_ndx;
+} XkbcKeyRec, *XkbcKeyPtr;
+#define	XkbKeyShape(g,k)	(&(g)->shapes[(k)->shape_ndx])
+#define	XkbKeyColor(g,k)	(&(g)->colors[(k)->color_ndx])
+#define	XkbSetKeyShape(g,k,s)	((k)->shape_ndx= (s)-&(g)->shapes[0])
+#define	XkbSetKeyColor(g,k,c)	((k)->color_ndx= (c)-&(g)->colors[0])
+
+typedef struct _XkbRow {
+	short	 	top;
+	short	 	left;
+	unsigned short	num_keys;
+	unsigned short	sz_keys;
+	int		vertical;
+	XkbcKeyPtr	keys;
+	XkbcBoundsRec	bounds;
+} XkbcRowRec, *XkbcRowPtr;
+
+typedef struct _XkbcSection {
+	CARD32		 name;
+	unsigned char	 priority;
+	short	 	 top;
+	short	 	 left;
+	unsigned short	 width;
+	unsigned short	 height;
+	short	 	 angle;
+	unsigned short	 num_rows;
+	unsigned short	 num_doodads;
+	unsigned short	 num_overlays;
+	unsigned short	 sz_rows;
+	unsigned short	 sz_doodads;
+	unsigned short	 sz_overlays;
+	XkbcRowPtr	 rows;
+	XkbcDoodadPtr	 doodads;
+	XkbcBoundsRec	 bounds;
+	struct _XkbOverlay *overlays;
+} XkbcSectionRec, *XkbcSectionPtr;
+
+typedef	struct _XkbcOverlayKey {
+	XkbKeyNameRec	over;
+	XkbKeyNameRec	under;
+} XkbcOverlayKeyRec, *XkbcOverlayKeyPtr;
+
+typedef struct _XkbOverlayRow {
+	unsigned short		row_under;
+	unsigned short		num_keys;
+	unsigned short		sz_keys;
+	XkbcOverlayKeyPtr	keys;
+} XkbcOverlayRowRec, *XkbcOverlayRowPtr;
+
+typedef struct _XkbOverlay {
+	CARD32			name;
+	XkbcSectionPtr		section_under;
+	unsigned short		num_rows;
+	unsigned short		sz_rows;
+	XkbcOverlayRowPtr	rows;
+	XkbcBoundsPtr		bounds;
+} XkbcOverlayRec, *XkbcOverlayPtr;
+
+typedef struct _XkbcGeometry {
+	CARD32		 name;
+	unsigned short	 width_mm;
+	unsigned short	 height_mm;
+	char *		 label_font;
+	XkbcColorPtr	 label_color;
+	XkbcColorPtr	 base_color;
+	unsigned short	 sz_properties;
+	unsigned short	 sz_colors;
+	unsigned short	 sz_shapes;
+	unsigned short   sz_sections;
+	unsigned short	 sz_doodads;
+	unsigned short	 sz_key_aliases;
+	unsigned short	 num_properties;
+	unsigned short	 num_colors;
+	unsigned short	 num_shapes;
+	unsigned short	 num_sections;
+	unsigned short	 num_doodads;
+	unsigned short	 num_key_aliases;
+	XkbcPropertyPtr	 properties;
+	XkbcColorPtr	 colors;
+	XkbcShapePtr	 shapes;
+	XkbcSectionPtr	 sections;
+	XkbcDoodadPtr	 doodads;
+	XkbKeyAliasPtr	 key_aliases;
+} XkbcGeometryRec, *XkbcGeometryPtr;
+#define	XkbGeomColorIndex(g,c)	((int)((c)-&(g)->colors[0]))
+
+#define	XkbGeomPropertiesMask	(1<<0)
+#define	XkbGeomColorsMask	(1<<1)
+#define	XkbGeomShapesMask	(1<<2)
+#define	XkbGeomSectionsMask	(1<<3)
+#define	XkbGeomDoodadsMask	(1<<4)
+#define	XkbGeomKeyAliasesMask	(1<<5)
+#define	XkbGeomAllMask		(0x3f)
+
+typedef struct _XkbcGeometrySizes {
+	unsigned int	which;
+	unsigned short	num_properties;
+	unsigned short	num_colors;
+	unsigned short	num_shapes;
+	unsigned short	num_sections;
+	unsigned short	num_doodads;
+	unsigned short	num_key_aliases;
+} XkbcGeometrySizesRec, *XkbcGeometrySizesPtr;
+
 /* Common keyboard description structure */
 typedef struct _XkbcDesc {
     unsigned int        defined;
@@ -184,9 +478,9 @@ typedef struct _XkbcDesc {
     XkbcServerMapPtr    server;
     XkbcClientMapPtr    map;
     XkbIndicatorPtr     indicators;
-    XkbNamesPtr         names;
+    XkbcNamesPtr        names;
     XkbcCompatMapPtr    compat;
-    XkbGeometryPtr      geom;
+    XkbcGeometryPtr     geom;
 } XkbcDescRec, *XkbcDescPtr;
 
 _XFUNCPROTOBEGIN
@@ -250,7 +544,4 @@ XkbcStringToKeysym(const char *s);
 
 _XFUNCPROTOEND
 
-#undef KeySym
-#undef Atom
-
 #endif /* _XKBCOMMON_H_ */
diff --git a/src/alloc.c b/src/alloc.c
index 1d1d069..b0393b9 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -117,13 +117,13 @@ XkbcFreeCompatMap(XkbcDescPtr xkb, unsigned which, Bool freeMap)
 int
 XkbcAllocNames(XkbcDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases)
 {
-    XkbNamesPtr names;
+    XkbcNamesPtr names;
 
     if (!xkb)
         return BadMatch;
 
     if (!xkb->names) {
-        xkb->names = _XkbTypedCalloc(1, XkbNamesRec);
+        xkb->names = _XkbTypedCalloc(1, XkbcNamesRec);
         if (!xkb->names)
             return BadAlloc;
     }
@@ -131,7 +131,7 @@ XkbcAllocNames(XkbcDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases)
 
     if ((which & XkbKTLevelNamesMask) && xkb->map && xkb->map->types) {
         int i;
-        XkbKeyTypePtr type;
+        XkbcKeyTypePtr type;
 
         type = xkb->map->types;
         for (i = 0; i < xkb->map->num_types; i++, type++) {
@@ -206,7 +206,7 @@ XkbcAllocNames(XkbcDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases)
 void
 XkbcFreeNames(XkbcDescPtr xkb, unsigned which, Bool freeMap)
 {
-    XkbNamesPtr names;
+    XkbcNamesPtr names;
 
     if (!xkb || !xkb->names)
         return;
@@ -220,7 +220,7 @@ XkbcFreeNames(XkbcDescPtr xkb, unsigned which, Bool freeMap)
 
         if (map && map->types) {
             int i;
-            XkbKeyTypePtr type = map->types;
+            XkbcKeyTypePtr type = map->types;
 
             for (i = 0; i < map->num_types; i++, type++) {
                 if (type->level_names) {
diff --git a/src/galloc.c b/src/galloc.c
index a81d9ba..59cde7c 100644
--- a/src/galloc.c
+++ b/src/galloc.c
@@ -115,7 +115,7 @@ _XkbFreeGeomNonLeafElems(Bool freeAll, int first, int count,
 static void
 _XkbClearProperty(char *prop_in)
 {
-    XkbPropertyPtr prop = (XkbPropertyPtr)prop_in;
+    XkbcPropertyPtr prop = (XkbcPropertyPtr)prop_in;
 
     if (prop->name) {
         _XkbFree(prop->name);
@@ -128,17 +128,17 @@ _XkbClearProperty(char *prop_in)
 }
 
 void
-XkbcFreeGeomProperties(XkbGeometryPtr geom, int first, int count, Bool freeAll)
+XkbcFreeGeomProperties(XkbcGeometryPtr geom, int first, int count, Bool freeAll)
 {
     _XkbFreeGeomNonLeafElems(freeAll, first, count,
                              &geom->num_properties, &geom->sz_properties,
                              (char **)&geom->properties,
-                             sizeof(XkbPropertyRec),
+                             sizeof(XkbcPropertyRec),
                              _XkbClearProperty);
 }
 
 void
-XkbcFreeGeomKeyAliases(XkbGeometryPtr geom, int first, int count, Bool freeAll)
+XkbcFreeGeomKeyAliases(XkbcGeometryPtr geom, int first, int count, Bool freeAll)
 {
     _XkbFreeGeomLeafElems(freeAll, first, count,
                           &geom->num_key_aliases, &geom->sz_key_aliases,
@@ -149,92 +149,92 @@ XkbcFreeGeomKeyAliases(XkbGeometryPtr geom, int first, int count, Bool freeAll)
 static void
 _XkbClearColor(char *color_in)
 {
-    XkbColorPtr color = (XkbColorPtr)color_in;
+    XkbcColorPtr color = (XkbcColorPtr)color_in;
 
     if (color->spec)
         _XkbFree(color->spec);
 }
 
 void
-XkbcFreeGeomColors(XkbGeometryPtr geom, int first, int count, Bool freeAll)
+XkbcFreeGeomColors(XkbcGeometryPtr geom, int first, int count, Bool freeAll)
 {
     _XkbFreeGeomNonLeafElems(freeAll, first, count,
                              &geom->num_colors, &geom->sz_colors,
-                             (char **)&geom->colors, sizeof(XkbColorRec),
+                             (char **)&geom->colors, sizeof(XkbcColorRec),
                              _XkbClearColor);
 }
 
 void
-XkbcFreeGeomPoints(XkbOutlinePtr outline, int first, int count, Bool freeAll)
+XkbcFreeGeomPoints(XkbcOutlinePtr outline, int first, int count, Bool freeAll)
 {
     _XkbFreeGeomLeafElems(freeAll, first, count,
                           &outline->num_points, &outline->sz_points,
-                          (char **)&outline->points, sizeof(XkbPointRec));
+                          (char **)&outline->points, sizeof(XkbcPointRec));
 }
 
 static void
 _XkbClearOutline(char *outline_in)
 {
-    XkbOutlinePtr outline = (XkbOutlinePtr)outline_in;
+    XkbcOutlinePtr outline = (XkbcOutlinePtr)outline_in;
 
     if (outline->points)
         XkbcFreeGeomPoints(outline, 0, outline->num_points, True);
 }
 
 void
-XkbcFreeGeomOutlines(XkbShapePtr shape, int first, int count, Bool freeAll)
+XkbcFreeGeomOutlines(XkbcShapePtr shape, int first, int count, Bool freeAll)
 {
     _XkbFreeGeomNonLeafElems(freeAll, first, count,
                              &shape->num_outlines, &shape->sz_outlines,
-                             (char **)&shape->outlines, sizeof(XkbOutlineRec),
+                             (char **)&shape->outlines, sizeof(XkbcOutlineRec),
                              _XkbClearOutline);
 }
 
 static void
 _XkbClearShape(char *shape_in)
 {
-    XkbShapePtr shape = (XkbShapePtr)shape_in;
+    XkbcShapePtr shape = (XkbcShapePtr)shape_in;
 
     if (shape->outlines)
         XkbcFreeGeomOutlines(shape, 0, shape->num_outlines, True);
 }
 
 void
-XkbcFreeGeomShapes(XkbGeometryPtr geom, int first, int count, Bool freeAll)
+XkbcFreeGeomShapes(XkbcGeometryPtr geom, int first, int count, Bool freeAll)
 {
     _XkbFreeGeomNonLeafElems(freeAll, first, count,
                              &geom->num_shapes, &geom->sz_shapes,
-                             (char **)&geom->shapes, sizeof(XkbShapeRec),
+                             (char **)&geom->shapes, sizeof(XkbcShapeRec),
                              _XkbClearShape);
 }
 
 void
-XkbcFreeGeomOverlayKeys(XkbOverlayRowPtr row, int first, int count,
+XkbcFreeGeomOverlayKeys(XkbcOverlayRowPtr row, int first, int count,
                         Bool freeAll)
 {
     _XkbFreeGeomLeafElems(freeAll, first, count,
                           &row->num_keys, &row->sz_keys,
-                          (char **)&row->keys, sizeof(XkbOverlayKeyRec));
+                          (char **)&row->keys, sizeof(XkbcOverlayKeyRec));
 }
 
 
 static void
 _XkbClearOverlayRow(char *row_in)
 {
-    XkbOverlayRowPtr row = (XkbOverlayRowPtr)row_in;
+    XkbcOverlayRowPtr row = (XkbcOverlayRowPtr)row_in;
 
     if (row->keys)
         XkbcFreeGeomOverlayKeys(row, 0, row->num_keys, True);
 }
 
 void
-XkbcFreeGeomOverlayRows(XkbOverlayPtr overlay, int first, int count,
+XkbcFreeGeomOverlayRows(XkbcOverlayPtr overlay, int first, int count,
                         Bool freeAll)
 {
     _XkbFreeGeomNonLeafElems(freeAll, first, count,
                              &overlay->num_rows, &overlay->sz_rows,
                              (char **)&overlay->rows,
-                             sizeof(XkbOverlayRowRec),
+                             sizeof(XkbcOverlayRowRec),
                              _XkbClearOverlayRow);
 }
 
@@ -242,47 +242,47 @@ XkbcFreeGeomOverlayRows(XkbOverlayPtr overlay, int first, int count,
 static void
 _XkbClearOverlay(char *overlay_in)
 {
-    XkbOverlayPtr overlay = (XkbOverlayPtr)overlay_in;
+    XkbcOverlayPtr overlay = (XkbcOverlayPtr)overlay_in;
 
     if (overlay->rows)
         XkbcFreeGeomOverlayRows(overlay, 0, overlay->num_rows, True);
 }
 
 void
-XkbcFreeGeomOverlays(XkbSectionPtr section, int first, int count, Bool freeAll)
+XkbcFreeGeomOverlays(XkbcSectionPtr section, int first, int count, Bool freeAll)
 {
     _XkbFreeGeomNonLeafElems(freeAll, first, count,
                              &section->num_overlays, &section->sz_overlays,
                              (char **)&section->overlays,
-                             sizeof(XkbOverlayRec),
+                             sizeof(XkbcOverlayRec),
                              _XkbClearOverlay);
 }
 
 
 void
-XkbcFreeGeomKeys(XkbRowPtr row, int first, int count, Bool freeAll)
+XkbcFreeGeomKeys(XkbcRowPtr row, int first, int count, Bool freeAll)
 {
     _XkbFreeGeomLeafElems(freeAll, first, count,
                           &row->num_keys, &row->sz_keys,
-                          (char **)&row->keys, sizeof(XkbKeyRec));
+                          (char **)&row->keys, sizeof(XkbcKeyRec));
 }
 
 
 static void
 _XkbClearRow(char *row_in)
 {
-    XkbRowPtr row = (XkbRowPtr)row_in;
+    XkbcRowPtr row = (XkbcRowPtr)row_in;
 
     if (row->keys)
         XkbcFreeGeomKeys(row, 0, row->num_keys, True);
 }
 
 void
-XkbcFreeGeomRows(XkbSectionPtr section, int first, int count, Bool freeAll)
+XkbcFreeGeomRows(XkbcSectionPtr section, int first, int count, Bool freeAll)
 {
     _XkbFreeGeomNonLeafElems(freeAll, first, count,
                              &section->num_rows, &section->sz_rows,
-                             (char **)&section->rows, sizeof(XkbRowRec),
+                             (char **)&section->rows, sizeof(XkbcRowRec),
                              _XkbClearRow);
 }
 
@@ -290,7 +290,7 @@ XkbcFreeGeomRows(XkbSectionPtr section, int first, int count, Bool freeAll)
 static void
 _XkbClearSection(char *section_in)
 {
-    XkbSectionPtr section = (XkbSectionPtr)section_in;
+    XkbcSectionPtr section = (XkbcSectionPtr)section_in;
 
     if (section->rows)
         XkbcFreeGeomRows(section, 0, section->num_rows, True);
@@ -301,11 +301,11 @@ _XkbClearSection(char *section_in)
 }
 
 void
-XkbcFreeGeomSections(XkbGeometryPtr geom, int first, int count, Bool freeAll)
+XkbcFreeGeomSections(XkbcGeometryPtr geom, int first, int count, Bool freeAll)
 {
     _XkbFreeGeomNonLeafElems(freeAll, first, count,
                              &geom->num_sections, &geom->sz_sections,
-                             (char **)&geom->sections, sizeof(XkbSectionRec),
+                             (char **)&geom->sections, sizeof(XkbcSectionRec),
                              _XkbClearSection);
 }
 
@@ -313,7 +313,7 @@ XkbcFreeGeomSections(XkbGeometryPtr geom, int first, int count, Bool freeAll)
 static void
 _XkbClearDoodad(char *doodad_in)
 {
-    XkbDoodadPtr doodad = (XkbDoodadPtr)doodad_in;
+    XkbcDoodadPtr doodad = (XkbcDoodadPtr)doodad_in;
 
     switch (doodad->any.type) {
     case XkbTextDoodad:
@@ -337,10 +337,10 @@ _XkbClearDoodad(char *doodad_in)
 }
 
 void
-XkbcFreeGeomDoodads(XkbDoodadPtr doodads, int nDoodads, Bool freeAll)
+XkbcFreeGeomDoodads(XkbcDoodadPtr doodads, int nDoodads, Bool freeAll)
 {
     int i;
-    XkbDoodadPtr doodad;
+    XkbcDoodadPtr doodad;
 
     if (doodads) {
         for (i = 0, doodad = doodads; i < nDoodads; i++, doodad++)
@@ -351,7 +351,7 @@ XkbcFreeGeomDoodads(XkbDoodadPtr doodads, int nDoodads, Bool freeAll)
 }
 
 void
-XkbcFreeGeometry(XkbGeometryPtr geom, unsigned which, Bool freeMap)
+XkbcFreeGeometry(XkbcGeometryPtr geom, unsigned which, Bool freeMap)
 {
     if (!geom)
         return;
@@ -424,23 +424,23 @@ _XkbGeomAlloc(char **old, unsigned short *num, unsigned short *total,
 #define _XkbAllocProps(g, n)    _XkbGeomAlloc((char **)&(g)->properties, \
                                               &(g)->num_properties, \
                                               &(g)->sz_properties, \
-                                              (n), sizeof(XkbPropertyRec))
+                                              (n), sizeof(XkbcPropertyRec))
 #define _XkbAllocColors(g, n)   _XkbGeomAlloc((char **)&(g)->colors, \
                                               &(g)->num_colors, \
                                               &(g)->sz_colors, \
-                                              (n), sizeof(XkbColorRec))
+                                              (n), sizeof(XkbcColorRec))
 #define _XkbAllocShapes(g, n)   _XkbGeomAlloc((char **)&(g)->shapes, \
                                               &(g)->num_shapes, \
                                               &(g)->sz_shapes, \
-                                              (n), sizeof(XkbShapeRec))
+                                              (n), sizeof(XkbcShapeRec))
 #define _XkbAllocSections(g, n) _XkbGeomAlloc((char **)&(g)->sections, \
                                               &(g)->num_sections, \
                                               &(g)->sz_sections, \
-                                              (n), sizeof(XkbSectionRec))
+                                              (n), sizeof(XkbcSectionRec))
 #define _XkbAllocDoodads(g, n)  _XkbGeomAlloc((char **)&(g)->doodads, \
                                               &(g)->num_doodads, \
                                               &(g)->sz_doodads, \
-                                              (n), sizeof(XkbDoodadRec))
+                                              (n), sizeof(XkbcDoodadRec))
 #define _XkbAllocKeyAliases(g, n)   _XkbGeomAlloc((char **)&(g)->key_aliases, \
                                                   &(g)->num_key_aliases, \
                                                   &(g)->sz_key_aliases, \
@@ -449,112 +449,112 @@ _XkbGeomAlloc(char **old, unsigned short *num, unsigned short *total,
 #define _XkbAllocOutlines(s, n) _XkbGeomAlloc((char **)&(s)->outlines, \
                                               &(s)->num_outlines, \
                                               &(s)->sz_outlines, \
-                                              (n), sizeof(XkbOutlineRec))
+                                              (n), sizeof(XkbcOutlineRec))
 #define _XkbAllocRows(s, n)     _XkbGeomAlloc((char **)&(s)->rows, \
                                               &(s)->num_rows, \
                                               &(s)->sz_rows, \
-                                              (n), sizeof(XkbRowRec))
+                                              (n), sizeof(XkbcRowRec))
 #define _XkbAllocPoints(o, n)   _XkbGeomAlloc((char **)&(o)->points, \
                                               &(o)->num_points, \
                                               &(o)->sz_points, \
-                                              (n), sizeof(XkbPointRec))
+                                              (n), sizeof(XkbcPointRec))
 #define _XkbAllocKeys(r, n)     _XkbGeomAlloc((char **)&(r)->keys, \
                                               &(r)->num_keys, \
                                               &(r)->sz_keys, \
-                                              (n), sizeof(XkbKeyRec))
+                                              (n), sizeof(XkbcKeyRec))
 #define _XkbAllocOverlays(s, n) _XkbGeomAlloc((char **)&(s)->overlays, \
                                               &(s)->num_overlays, \
                                               &(s)->sz_overlays, \
-                                              (n), sizeof(XkbOverlayRec))
+                                              (n), sizeof(XkbcOverlayRec))
 #define _XkbAllocOverlayRows(o, n)  _XkbGeomAlloc((char **)&(o)->rows, \
                                                   &(o)->num_rows, \
                                                   &(o)->sz_rows, \
-                                                  (n), sizeof(XkbOverlayRowRec))
+                                                  (n), sizeof(XkbcOverlayRowRec))
 #define _XkbAllocOverlayKeys(r, n)  _XkbGeomAlloc((char **)&(r)->keys, \
                                                   &(r)->num_keys, \
                                                   &(r)->sz_keys, \
-                                                  (n), sizeof(XkbOverlayKeyRec))
+                                                  (n), sizeof(XkbcOverlayKeyRec))
 
 int
-XkbcAllocGeomProps(XkbGeometryPtr geom, int nProps)
+XkbcAllocGeomProps(XkbcGeometryPtr geom, int nProps)
 {
     return _XkbAllocProps(geom, nProps);
 }
 
 int
-XkbcAllocGeomColors(XkbGeometryPtr geom, int nColors)
+XkbcAllocGeomColors(XkbcGeometryPtr geom, int nColors)
 {
     return _XkbAllocColors(geom, nColors);
 }
 
 int
-XkbcAllocGeomKeyAliases(XkbGeometryPtr geom, int nKeyAliases)
+XkbcAllocGeomKeyAliases(XkbcGeometryPtr geom, int nKeyAliases)
 {
     return _XkbAllocKeyAliases(geom, nKeyAliases);
 }
 
 int
-XkbcAllocGeomShapes(XkbGeometryPtr geom, int nShapes)
+XkbcAllocGeomShapes(XkbcGeometryPtr geom, int nShapes)
 {
     return _XkbAllocShapes(geom, nShapes);
 }
 
 int
-XkbcAllocGeomSections(XkbGeometryPtr geom, int nSections)
+XkbcAllocGeomSections(XkbcGeometryPtr geom, int nSections)
 {
     return _XkbAllocSections(geom, nSections);
 }
 
 int
-XkbcAllocGeomOverlays(XkbSectionPtr section, int nOverlays)
+XkbcAllocGeomOverlays(XkbcSectionPtr section, int nOverlays)
 {
     return _XkbAllocOverlays(section, nOverlays);
 }
 
 int
-XkbcAllocGeomOverlayRows(XkbOverlayPtr overlay, int nRows)
+XkbcAllocGeomOverlayRows(XkbcOverlayPtr overlay, int nRows)
 {
     return _XkbAllocOverlayRows(overlay, nRows);
 }
 
 int
-XkbcAllocGeomOverlayKeys(XkbOverlayRowPtr row, int nKeys)
+XkbcAllocGeomOverlayKeys(XkbcOverlayRowPtr row, int nKeys)
 {
     return _XkbAllocOverlayKeys(row, nKeys);
 }
 
 int
-XkbcAllocGeomDoodads(XkbGeometryPtr geom, int nDoodads)
+XkbcAllocGeomDoodads(XkbcGeometryPtr geom, int nDoodads)
 {
     return _XkbAllocDoodads(geom, nDoodads);
 }
 
 int
-XkbcAllocGeomSectionDoodads(XkbSectionPtr section, int nDoodads)
+XkbcAllocGeomSectionDoodads(XkbcSectionPtr section, int nDoodads)
 {
     return _XkbAllocDoodads(section, nDoodads);
 }
 
 int
-XkbcAllocGeomOutlines(XkbShapePtr shape, int nOL)
+XkbcAllocGeomOutlines(XkbcShapePtr shape, int nOL)
 {
     return _XkbAllocOutlines(shape, nOL);
 }
 
 int
-XkbcAllocGeomRows(XkbSectionPtr section, int nRows)
+XkbcAllocGeomRows(XkbcSectionPtr section, int nRows)
 {
     return _XkbAllocRows(section, nRows);
 }
 
 int
-XkbcAllocGeomPoints(XkbOutlinePtr ol, int nPts)
+XkbcAllocGeomPoints(XkbcOutlinePtr ol, int nPts)
 {
     return _XkbAllocPoints(ol, nPts);
 }
 
 int
-XkbcAllocGeomKeys(XkbRowPtr row, int nKeys)
+XkbcAllocGeomKeys(XkbcRowPtr row, int nKeys)
 {
     int ret = _XkbAllocKeys(row, nKeys);
     fprintf(stderr, "!!! allocated %d keys at %p\n", nKeys, row->keys);
@@ -562,13 +562,13 @@ XkbcAllocGeomKeys(XkbRowPtr row, int nKeys)
 }
 
 int
-XkbcAllocGeometry(XkbcDescPtr xkb, XkbGeometrySizesPtr sizes)
+XkbcAllocGeometry(XkbcDescPtr xkb, XkbcGeometrySizesPtr sizes)
 {
-    XkbGeometryPtr geom;
+    XkbcGeometryPtr geom;
     int rtrn;
 
     if (!xkb->geom) {
-        xkb->geom = _XkbTypedCalloc(1, XkbGeometryRec);
+        xkb->geom = _XkbTypedCalloc(1, XkbcGeometryRec);
         if (!xkb->geom)
             return BadAlloc;
     }
@@ -605,11 +605,11 @@ bail:
     return rtrn;
 }
 
-XkbPropertyPtr
-XkbcAddGeomProperty(XkbGeometryPtr geom,char *name,char *value)
+XkbcPropertyPtr
+XkbcAddGeomProperty(XkbcGeometryPtr geom,char *name,char *value)
 {
 register int i;
-register XkbPropertyPtr prop;
+register XkbcPropertyPtr prop;
 
     if ((!geom)||(!name)||(!value))
 	return NULL;
@@ -644,7 +644,7 @@ register XkbPropertyPtr prop;
 }
 
 XkbKeyAliasPtr
-XkbcAddGeomKeyAlias(XkbGeometryPtr geom,char *aliasStr,char *realStr)
+XkbcAddGeomKeyAlias(XkbcGeometryPtr geom,char *aliasStr,char *realStr)
 {
 register int i;
 register XkbKeyAliasPtr alias;
@@ -670,11 +670,11 @@ register XkbKeyAliasPtr alias;
     return alias;
 }
 
-XkbColorPtr
-XkbcAddGeomColor(XkbGeometryPtr geom,char *spec,unsigned int pixel)
+XkbcColorPtr
+XkbcAddGeomColor(XkbcGeometryPtr geom,char *spec,unsigned int pixel)
 {
 register int i;
-register XkbColorPtr color;
+register XkbcColorPtr color;
 
     if ((!geom)||(!spec))
 	return NULL;
@@ -698,10 +698,10 @@ register XkbColorPtr color;
     return color;
 }
 
-XkbOutlinePtr
-XkbcAddGeomOutline(XkbShapePtr shape,int sz_points)
+XkbcOutlinePtr
+XkbcAddGeomOutline(XkbcShapePtr shape,int sz_points)
 {
-XkbOutlinePtr	outline;
+XkbcOutlinePtr	outline;
 
     if ((!shape)||(sz_points<0))
 	return NULL;
@@ -710,17 +710,17 @@ XkbOutlinePtr	outline;
 	return NULL;
     }
     outline= &shape->outlines[shape->num_outlines];
-    bzero(outline,sizeof(XkbOutlineRec));
+    bzero(outline,sizeof(XkbcOutlineRec));
     if ((sz_points>0)&&(_XkbAllocPoints(outline,sz_points)!=Success))
 	return NULL;
     shape->num_outlines++;
     return outline;
 }
 
-XkbShapePtr
-XkbcAddGeomShape(XkbGeometryPtr geom,Atom name,int sz_outlines)
+XkbcShapePtr
+XkbcAddGeomShape(XkbcGeometryPtr geom,CARD32 name,int sz_outlines)
 {
-XkbShapePtr	shape;
+XkbcShapePtr	shape;
 register int	i;
 
     if ((!geom)||(!name)||(sz_outlines<0))
@@ -735,7 +735,7 @@ register int	i;
 					(_XkbAllocShapes(geom,1)!=Success))
 	return NULL;
     shape= &geom->shapes[geom->num_shapes];
-    bzero(shape,sizeof(XkbShapeRec));
+    bzero(shape,sizeof(XkbcShapeRec));
     if ((sz_outlines>0)&&(_XkbAllocOutlines(shape,sz_outlines)!=Success))
 	return NULL;
     shape->name= name;
@@ -744,23 +744,23 @@ register int	i;
     return shape;
 }
 
-XkbKeyPtr
-XkbcAddGeomKey(XkbRowPtr row)
+XkbcKeyPtr
+XkbcAddGeomKey(XkbcRowPtr row)
 {
-XkbKeyPtr	key;
+XkbcKeyPtr	key;
     if (!row)
 	return NULL;
     if ((row->num_keys>=row->sz_keys)&&(_XkbAllocKeys(row,1)!=Success))
 	return NULL;
     key= &row->keys[row->num_keys++];
-    bzero(key,sizeof(XkbKeyRec));
+    bzero(key,sizeof(XkbcKeyRec));
     return key;
 }
 
-XkbRowPtr
-XkbcAddGeomRow(XkbSectionPtr section,int sz_keys)
+XkbcRowPtr
+XkbcAddGeomRow(XkbcSectionPtr section,int sz_keys)
 {
-XkbRowPtr	row;
+XkbcRowPtr	row;
 
     if ((!section)||(sz_keys<0))
 	return NULL;
@@ -768,22 +768,22 @@ XkbRowPtr	row;
     					(_XkbAllocRows(section,1)!=Success))
 	return NULL;
     row= &section->rows[section->num_rows];
-    bzero(row,sizeof(XkbRowRec));
+    bzero(row,sizeof(XkbcRowRec));
     if ((sz_keys>0)&&(_XkbAllocKeys(row,sz_keys)!=Success))
 	return NULL;
     section->num_rows++;
     return row;
 }
 
-XkbSectionPtr
-XkbcAddGeomSection(	XkbGeometryPtr	geom,
-			Atom		name,
+XkbcSectionPtr
+XkbcAddGeomSection(	XkbcGeometryPtr	geom,
+			CARD32		name,
 			int		sz_rows,
 			int		sz_doodads,
 			int		sz_over)
 {
 register int	i;
-XkbSectionPtr	section;
+XkbcSectionPtr	section;
 
     if ((!geom)||(name==None)||(sz_rows<0))
 	return NULL;
@@ -815,10 +815,10 @@ XkbSectionPtr	section;
     return section;
 }
 
-XkbDoodadPtr
-XkbcAddGeomDoodad(XkbGeometryPtr geom,XkbSectionPtr section,Atom name)
+XkbcDoodadPtr
+XkbcAddGeomDoodad(XkbcGeometryPtr geom,XkbcSectionPtr section,CARD32 name)
 {
-XkbDoodadPtr	old,doodad;
+XkbcDoodadPtr	old,doodad;
 register int	i,nDoodads;
 
     if ((!geom)||(name==None))
@@ -848,21 +848,21 @@ register int	i,nDoodads;
 	    return NULL;
 	doodad= &geom->doodads[geom->num_doodads++];
     }
-    bzero(doodad,sizeof(XkbDoodadRec));
+    bzero(doodad,sizeof(XkbcDoodadRec));
     doodad->any.name= name;
     return doodad;
 }
 
-XkbOverlayKeyPtr
-XkbcAddGeomOverlayKey(	XkbOverlayPtr		overlay,
-			XkbOverlayRowPtr 	row,
+XkbcOverlayKeyPtr
+XkbcAddGeomOverlayKey(	XkbcOverlayPtr		overlay,
+			XkbcOverlayRowPtr 	row,
 			char *			over,
 			char *			under)
 {
 register int	i;
-XkbOverlayKeyPtr key;
-XkbSectionPtr	section;
-XkbRowPtr	row_under;
+XkbcOverlayKeyPtr key;
+XkbcSectionPtr	section;
+XkbcRowPtr	row_under;
 Bool		found;
 
     if ((!overlay)||(!row)||(!over)||(!under))
@@ -888,11 +888,11 @@ Bool		found;
     return key;
 }
 
-XkbOverlayRowPtr
-XkbcAddGeomOverlayRow(XkbOverlayPtr overlay,int row_under,int sz_keys)
+XkbcOverlayRowPtr
+XkbcAddGeomOverlayRow(XkbcOverlayPtr overlay,int row_under,int sz_keys)
 {
 register int		i;
-XkbOverlayRowPtr	row;
+XkbcOverlayRowPtr	row;
 
     if ((!overlay)||(sz_keys<0))
 	return NULL;
@@ -912,7 +912,7 @@ XkbOverlayRowPtr	row;
 				(_XkbAllocOverlayRows(overlay,1)!=Success))
 	return NULL;
     row= &overlay->rows[overlay->num_rows];
-    bzero(row,sizeof(XkbOverlayRowRec));
+    bzero(row,sizeof(XkbcOverlayRowRec));
     if ((sz_keys>0)&&(_XkbAllocOverlayKeys(row,sz_keys)!=Success))
 	return NULL;
     row->row_under= row_under;
@@ -920,11 +920,11 @@ XkbOverlayRowPtr	row;
     return row;
 }
 
-XkbOverlayPtr
-XkbcAddGeomOverlay(XkbSectionPtr section,Atom name,int sz_rows)
+XkbcOverlayPtr
+XkbcAddGeomOverlay(XkbcSectionPtr section,CARD32 name,int sz_rows)
 {
 register int	i;
-XkbOverlayPtr	overlay;
+XkbcOverlayPtr	overlay;
 
     if ((!section)||(name==None)||(sz_rows==0))
 	return NULL;
diff --git a/src/geom.c b/src/geom.c
index 9572f01..4793692 100644
--- a/src/geom.c
+++ b/src/geom.c
@@ -40,7 +40,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #endif
 
 static void
-_XkbCheckBounds(XkbBoundsPtr bounds, int x, int y)
+_XkbCheckBounds(XkbcBoundsPtr bounds, int x, int y)
 {
     if (x < bounds->x1)
         bounds->x1 = x;
@@ -53,11 +53,11 @@ _XkbCheckBounds(XkbBoundsPtr bounds, int x, int y)
 }
 
 Bool
-XkbcComputeShapeBounds(XkbShapePtr shape)
+XkbcComputeShapeBounds(XkbcShapePtr shape)
 {
     int o, p;
-    XkbOutlinePtr outline;
-    XkbPointPtr pt;
+    XkbcOutlinePtr outline;
+    XkbcPointPtr pt;
 
     if ((!shape) || (shape->num_outlines < 1))
         return False;
@@ -77,11 +77,11 @@ XkbcComputeShapeBounds(XkbShapePtr shape)
 }
 
 Bool
-XkbcComputeShapeTop(XkbShapePtr shape, XkbBoundsPtr bounds)
+XkbcComputeShapeTop(XkbcShapePtr shape, XkbcBoundsPtr bounds)
 {
     int p;
-    XkbOutlinePtr outline;
-    XkbPointPtr pt;
+    XkbcOutlinePtr outline;
+    XkbcPointPtr pt;
 
     if ((!shape) || (shape->num_outlines < 1))
         return False;
@@ -107,18 +107,18 @@ XkbcComputeShapeTop(XkbShapePtr shape, XkbBoundsPtr bounds)
 }
 
 Bool
-XkbcComputeRowBounds(XkbGeometryPtr geom, XkbSectionPtr section, XkbRowPtr row)
+XkbcComputeRowBounds(XkbcGeometryPtr geom, XkbcSectionPtr section, XkbcRowPtr row)
 {
     int k, pos;
-    XkbKeyPtr key;
-    XkbBoundsPtr bounds, sbounds;
+    XkbcKeyPtr key;
+    XkbcBoundsPtr bounds, sbounds;
 
     if (!geom || !section || !row)
         return False;
 
     pos = 0;
     bounds = &row->bounds;
-    bzero(bounds, sizeof(XkbBoundsRec));
+    bzero(bounds, sizeof(XkbcBoundsRec));
 
     for (key = row->keys, pos = k = 0; k < row->num_keys; k++, key++) {
         sbounds = &XkbKeyShape(geom, key)->bounds;
@@ -148,19 +148,19 @@ XkbcComputeRowBounds(XkbGeometryPtr geom, XkbSectionPtr section, XkbRowPtr row)
 }
 
 Bool
-XkbcComputeSectionBounds(XkbGeometryPtr geom, XkbSectionPtr section)
+XkbcComputeSectionBounds(XkbcGeometryPtr geom, XkbcSectionPtr section)
 {
     int i;
-    XkbShapePtr shape;
-    XkbRowPtr row;
-    XkbDoodadPtr doodad;
-    XkbBoundsPtr bounds, rbounds = NULL;
+    XkbcShapePtr shape;
+    XkbcRowPtr row;
+    XkbcDoodadPtr doodad;
+    XkbcBoundsPtr bounds, rbounds = NULL;
 
     if (!geom || !section)
         return False;
 
     bounds = &section->bounds;
-    bzero(bounds, sizeof(XkbBoundsRec));
+    bzero(bounds, sizeof(XkbcBoundsRec));
 
     for (i = 0, row = section->rows; i < section->num_rows; i++, row++) {
         if (!XkbcComputeRowBounds(geom, section, row))
@@ -175,7 +175,7 @@ XkbcComputeSectionBounds(XkbGeometryPtr geom, XkbSectionPtr section)
     for (i = 0, doodad = section->doodads; i < section->num_doodads;
          i++, doodad++)
     {
-        static XkbBoundsRec tbounds;
+        static XkbcBoundsRec tbounds;
 
         switch (doodad->any.type) {
         case XkbOutlineDoodad:
diff --git a/src/malloc.c b/src/malloc.c
index 0211264..7bcea7c 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -59,7 +59,7 @@ XkbcAllocClientMap(XkbcDescPtr xkb, unsigned which, unsigned nTotalTypes)
 
     if ((which & XkbKeyTypesMask) && (nTotalTypes > 0)) {
         if (!map->types) {
-            map->types = _XkbTypedCalloc(nTotalTypes, XkbKeyTypeRec);
+            map->types = _XkbTypedCalloc(nTotalTypes, XkbcKeyTypeRec);
             if (!map->types)
                 return BadAlloc;
 
@@ -67,10 +67,10 @@ XkbcAllocClientMap(XkbcDescPtr xkb, unsigned which, unsigned nTotalTypes)
             map->size_types = nTotalTypes;
         }
         else if (map->size_types < nTotalTypes) {
-            XkbKeyTypeRec *prev_types = map->types;
+            XkbcKeyTypeRec *prev_types = map->types;
 
             map->types = _XkbTypedRealloc(map->types, nTotalTypes,
-                                          XkbKeyTypeRec);
+                                          XkbcKeyTypeRec);
             if (!map->types) {
                 _XkbFree(prev_types);
                 map->num_types = map->size_types = 0;
@@ -79,7 +79,7 @@ XkbcAllocClientMap(XkbcDescPtr xkb, unsigned which, unsigned nTotalTypes)
 
             map->size_types = nTotalTypes;
             bzero(&map->types[map->num_types],
-                  (map->size_types - map->num_types) * sizeof(XkbKeyTypeRec));
+                  (map->size_types - map->num_types) * sizeof(XkbcKeyTypeRec));
         }
     }
 
@@ -231,7 +231,7 @@ XkbcAllocServerMap(XkbcDescPtr xkb, unsigned which, unsigned nNewActions)
 }
 
 int
-XkbcCopyKeyType(XkbKeyTypePtr from, XkbKeyTypePtr into)
+XkbcCopyKeyType(XkbcKeyTypePtr from, XkbcKeyTypePtr into)
 {
     if (!from || !into)
         return BadMatch;
@@ -279,7 +279,7 @@ XkbcCopyKeyType(XkbKeyTypePtr from, XkbKeyTypePtr into)
 }
 
 int
-XkbcCopyKeyTypes(XkbKeyTypePtr from, XkbKeyTypePtr into, int num_types)
+XkbcCopyKeyTypes(XkbcKeyTypePtr from, XkbcKeyTypePtr into, int num_types)
 {
     int i, rtrn;
 
@@ -298,7 +298,7 @@ int
 XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count,
                   Bool want_preserve, int new_num_lvls)
 {
-    XkbKeyTypePtr type;
+    XkbcKeyTypePtr type;
     KeyCode matchingKeys[XkbMaxKeyCount], nMatchingKeys;
 
     if ((type_ndx < 0) || (type_ndx >= xkb->map->num_types) ||
@@ -891,7 +891,7 @@ XkbcFreeClientMap(XkbcDescPtr xkb, unsigned what, Bool freeMap)
         if (map->types) {
             if (map->num_types > 0) {
                 int i;
-                XkbKeyTypePtr type;
+                XkbcKeyTypePtr type;
 
                 for (i = 0, type = map->types; i < map->num_types; i++, type++) {
                     if (type->map) {
diff --git a/src/misc.c b/src/misc.c
index d568fc8..2a1f9cd 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -56,7 +56,7 @@ static  XkbKTMapEntryRec mapKeypad[]= {
     { False, 0,         { 1, 0, NL_VMOD_MASK } }
 };
 
-static XkbKeyTypeRec canonicalTypes[XkbNumRequiredTypes] = {
+static XkbcKeyTypeRec canonicalTypes[XkbNumRequiredTypes] = {
     { { 0, 0, 0 },
       1,        /* num_levels */
       0,        /* map_count */
@@ -87,7 +87,7 @@ int
 XkbcInitCanonicalKeyTypes(XkbcDescPtr xkb, unsigned which, int keypadVMod)
 {
     XkbcClientMapPtr map;
-    XkbKeyTypePtr from,to;
+    XkbcKeyTypePtr from,to;
     int rtrn;
 
     if (!xkb)
@@ -116,7 +116,7 @@ XkbcInitCanonicalKeyTypes(XkbcDescPtr xkb, unsigned which, int keypadVMod)
                                &to[XkbAlphabeticIndex]);
 
     if ((which & XkbKeypadMask) && (rtrn == Success)) {
-        XkbKeyTypePtr type;
+        XkbcKeyTypePtr type;
 
         rtrn = XkbcCopyKeyType(&from[XkbKeypadIndex], &to[XkbKeypadIndex]);
         type = &to[XkbKeypadIndex];
diff --git a/src/xkb.c b/src/xkb.c
index 7ebe856..f5a1a0f 100644
--- a/src/xkb.c
+++ b/src/xkb.c
@@ -98,7 +98,7 @@ XkbcCanonicaliseComponents(XkbComponentNamesPtr names,
 }
 
 Bool
-XkbcComputeEffectiveMap(XkbcDescPtr xkb, XkbKeyTypePtr type,
+XkbcComputeEffectiveMap(XkbcDescPtr xkb, XkbcKeyTypePtr type,
                         unsigned char *map_rtrn)
 {
     int i;
diff --git a/src/xkballoc.h b/src/xkballoc.h
index 0decf87..af0166b 100644
--- a/src/xkballoc.h
+++ b/src/xkballoc.h
@@ -73,10 +73,10 @@ extern int
 XkbcAllocServerMap(XkbcDescPtr xkb, unsigned which, unsigned nNewActions);
 
 extern int
-XkbcCopyKeyType(XkbKeyTypePtr from, XkbKeyTypePtr into);
+XkbcCopyKeyType(XkbcKeyTypePtr from, XkbcKeyTypePtr into);
 
 extern int
-XkbcCopyKeyTypes(XkbKeyTypePtr from, XkbKeyTypePtr into, int num_types);
+XkbcCopyKeyTypes(XkbcKeyTypePtr from, XkbcKeyTypePtr into, int num_types);
 
 extern int
 XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count,
diff --git a/src/xkbcomp/alias.c b/src/xkbcomp/alias.c
index 97b7b48..665c34f 100644
--- a/src/xkbcomp/alias.c
+++ b/src/xkbcomp/alias.c
@@ -32,8 +32,6 @@
 #include "alias.h"
 #include "keycodes.h"
 
-#include <X11/extensions/XKBgeomcommon.h>
-
 static void
 HandleCollision(AliasInfo * old, AliasInfo * new)
 {
@@ -237,8 +235,8 @@ ApplyAliases(XkbcDescPtr xkb, Bool toGeom, AliasInfo ** info_in)
     {
         if (!xkb->geom)
         {
-            XkbGeometrySizesRec sizes;
-            bzero((char *) &sizes, sizeof(XkbGeometrySizesRec));
+            XkbcGeometrySizesRec sizes;
+            bzero((char *) &sizes, sizeof(XkbcGeometrySizesRec));
             sizes.which = XkbGeomKeyAliasesMask;
             sizes.num_key_aliases = nOld + nNew;
             status = XkbcAllocGeometry(xkb, &sizes);
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index 6d67d08..514868f 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -156,7 +156,7 @@ ExprResolveLhs(ExprDef * expr,
 
 Bool
 SimpleLookup(char * priv,
-             Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
+             CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
 {
     LookupEntry *entry;
     register char *str;
@@ -184,7 +184,7 @@ SimpleLookup(char * priv,
 
 Bool
 RadioLookup(char * priv,
-            Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
+            CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
 {
     register char *str;
     int rg;
@@ -212,7 +212,7 @@ RadioLookup(char * priv,
 
 int
 TableLookup(char * priv,
-            Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
+            CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
 {
     LookupTable *tbl = (LookupTable *) priv;
     register char *str;
@@ -233,7 +233,7 @@ TableLookup(char * priv,
     if (tbl == NULL)            /* didn't find a matching element */
         return False;
     priv = (char *) tbl->entries;
-    return SimpleLookup(priv, (Atom) None, field, type, val_rtrn);
+    return SimpleLookup(priv, (CARD32) None, field, type, val_rtrn);
 }
 
 static LookupEntry modIndexNames[] = {
@@ -251,7 +251,7 @@ static LookupEntry modIndexNames[] = {
 
 int
 LookupModIndex(char * priv,
-               Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
+               CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
 {
     return SimpleLookup((char *) modIndexNames, elem, field, type,
                         val_rtrn);
@@ -259,7 +259,7 @@ LookupModIndex(char * priv,
 
 int
 LookupModMask(char * priv,
-              Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
+              CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
 {
     char *str;
     Bool ret = True;
@@ -317,7 +317,7 @@ ExprResolveModIndex(ExprDef * expr,
         val_rtrn->ival = expr->value.ival;
         return True;
     case ExprIdent:
-        if (LookupModIndex(lookupPriv, (Atom) None, expr->value.str,
+        if (LookupModIndex(lookupPriv, (CARD32) None, expr->value.str,
                            (unsigned) TypeInt, val_rtrn))
         {
             return True;
@@ -915,7 +915,7 @@ ExprResolveEnum(ExprDef * expr, ExprResult * val_rtrn, LookupEntry * values)
                exprOpText(expr->op));
         return False;
     }
-    if (!SimpleLookup((char *) values, (Atom) None, expr->value.str,
+    if (!SimpleLookup((char *) values, (CARD32) None, expr->value.str,
                       (unsigned) TypeInt, val_rtrn))
     {
         int nOut = 0;
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index 6bec888..fb1fa97 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -36,8 +36,8 @@ typedef union _ExprResult
 } ExprResult;
 
 typedef Bool(*IdentLookupFunc) (char * /* priv */ ,
-                                Atom /* elem */ ,
-                                Atom /* field */ ,
+                                CARD32 /* elem */ ,
+                                CARD32 /* field */ ,
                                 unsigned /* type */ ,
                                 ExprResult *    /* val_rtrn */
     );
@@ -76,36 +76,36 @@ extern char *exprOpText(unsigned        /* type */
     );
 
 extern int RadioLookup(char * /* priv */ ,
-                       Atom /* elem */ ,
-                       Atom /* field */ ,
+                       CARD32 /* elem */ ,
+                       CARD32 /* field */ ,
                        unsigned /* type */ ,
                        ExprResult *     /* val_rtrn */
     );
 
 extern int SimpleLookup(char * /* priv */ ,
-                        Atom /* elem */ ,
-                        Atom /* field */ ,
+                        CARD32 /* elem */ ,
+                        CARD32 /* field */ ,
                         unsigned /* type */ ,
                         ExprResult *    /* val_rtrn */
     );
 
 extern int TableLookup(char * /* priv */ ,
-                       Atom /* elem */ ,
-                       Atom /* field */ ,
+                       CARD32 /* elem */ ,
+                       CARD32 /* field */ ,
                        unsigned /* type */ ,
                        ExprResult *     /* val_rtrn */
     );
 
 extern int LookupModIndex(char * /* priv */ ,
-                          Atom /* elem */ ,
-                          Atom /* field */ ,
+                          CARD32 /* elem */ ,
+                          CARD32 /* field */ ,
                           unsigned /* type */ ,
                           ExprResult *  /* val_rtrn */
     );
 
 extern int LookupModMask(char * /* priv */ ,
-                         Atom /* elem */ ,
-                         Atom /* field */ ,
+                         CARD32 /* elem */ ,
+                         CARD32 /* field */ ,
                          unsigned /* type */ ,
                          ExprResult *   /* val_rtrn */
     );
diff --git a/src/xkbcomp/geometry.c b/src/xkbcomp/geometry.c
index 5ba3f5b..59d446b 100644
--- a/src/xkbcomp/geometry.c
+++ b/src/xkbcomp/geometry.c
@@ -37,8 +37,6 @@
 #include "keycodes.h"
 #include "alias.h"
 
-#include <X11/extensions/XKBgeomcommon.h>
-
 #define	DFLT_FONT	"helvetica"
 #define	DFLT_SLANT	"r"
 #define	DFLT_WEIGHT	"medium"
@@ -60,13 +58,13 @@ typedef struct _PropertyInfo
 typedef struct _ShapeInfo
 {
     CommonInfo defs;
-    Atom name;
+    CARD32 name;
     short index;
     unsigned short nOutlines;
     unsigned short szOutlines;
-    XkbOutlinePtr outlines;
-    XkbOutlinePtr approx;
-    XkbOutlinePtr primary;
+    XkbcOutlinePtr outlines;
+    XkbcOutlinePtr approx;
+    XkbcOutlinePtr primary;
     int dfltCornerRadius;
 } ShapeInfo;
 
@@ -99,7 +97,7 @@ typedef struct _ShapeInfo
 typedef struct _DoodadInfo
 {
     CommonInfo defs;
-    Atom name;
+    CARD32 name;
     unsigned char type;
     unsigned char priority;
     short top;
@@ -108,18 +106,18 @@ typedef struct _DoodadInfo
     unsigned short corner;
     unsigned short width;
     unsigned short height;
-    Atom shape;
-    Atom color;
-    Atom offColor;
-    Atom text;
-    Atom font;
-    Atom fontSlant;
-    Atom fontWeight;
-    Atom fontSetWidth;
-    Atom fontVariant;
+    CARD32 shape;
+    CARD32 color;
+    CARD32 offColor;
+    CARD32 text;
+    CARD32 font;
+    CARD32 fontSlant;
+    CARD32 fontWeight;
+    CARD32 fontSetWidth;
+    CARD32 fontVariant;
     unsigned short fontSize;
-    Atom fontEncoding;
-    Atom fontSpec;
+    CARD32 fontEncoding;
+    CARD32 fontSpec;
     char *logoName;
     struct _SectionInfo *section;
 } DoodadInfo;
@@ -139,8 +137,8 @@ typedef struct _KeyInfo
     char name[8];
     short gap;
     short index;
-    Atom shape;
-    Atom color;
+    CARD32 shape;
+    CARD32 color;
     struct _RowInfo *row;
 } KeyInfo;
 #define	keyText(k)	((k)&&(k)->name[0]?(k)->name:"default")
@@ -177,7 +175,7 @@ typedef struct _OverlayKeyInfo
 typedef struct _OverlayInfo
 {
     CommonInfo defs;
-    Atom name;
+    CARD32 name;
     unsigned short nRows;
     unsigned short nKeys;
     OverlayKeyInfo *keys;
@@ -197,7 +195,7 @@ typedef struct _OverlayInfo
 typedef struct _SectionInfo
 {
     CommonInfo defs;
-    Atom name;
+    CARD32 name;
     unsigned short top;
     unsigned short left;
     unsigned short width;
@@ -235,16 +233,16 @@ typedef struct _GeometryInfo
     DoodadInfo *doodads;
     int widthMM;
     int heightMM;
-    Atom font;
-    Atom fontSlant;
-    Atom fontWeight;
-    Atom fontSetWidth;
-    Atom fontVariant;
+    CARD32 font;
+    CARD32 fontSlant;
+    CARD32 fontWeight;
+    CARD32 fontSetWidth;
+    CARD32 fontVariant;
     unsigned fontSize;
-    Atom fontEncoding;
-    Atom fontSpec;
-    Atom baseColor;
-    Atom labelColor;
+    CARD32 fontEncoding;
+    CARD32 fontSpec;
+    CARD32 baseColor;
+    CARD32 labelColor;
     int dfltCornerRadius;
     SectionInfo dfltSection;
     DoodadInfo *dfltDoodads;
@@ -430,7 +428,7 @@ FindDoodadByType(DoodadInfo * di, unsigned type)
 }
 
 static DoodadInfo *
-FindDoodadByName(DoodadInfo * di, Atom name)
+FindDoodadByName(DoodadInfo * di, CARD32 name)
 {
     while (di)
     {
@@ -796,7 +794,7 @@ NextShape(GeometryInfo * info)
 }
 
 static ShapeInfo *
-FindShape(GeometryInfo * info, Atom name, const char *type, const char *which)
+FindShape(GeometryInfo * info, CARD32 name, const char *type, const char *which)
 {
     ShapeInfo *old;
 
@@ -1512,7 +1510,7 @@ SetTextDoodadField(DoodadInfo * di,
     char *typeName = "text doodad";
     union
     {
-        Atom *str;
+        CARD32 *str;
         short *ival;
         unsigned short *uval;
     } pField;
@@ -2120,7 +2118,7 @@ HandleGeometryVar(VarDef * stmt, XkbcDescPtr xkb, GeometryInfo * info)
     ExprResult elem, field, tmp;
     ExprDef *ndx;
     DoodadInfo *di;
-    Atom *pField = NULL;
+    CARD32 *pField = NULL;
     int ret;
 
     if (ExprResolveLhs(stmt->name, &elem, &field, &ndx) == 0)
@@ -2400,7 +2398,7 @@ HandleShapeBody(ShapeDef * def, ShapeInfo * si, unsigned merge,
 {
     OutlineDef *ol;
     int nOut, nPt;
-    XkbOutlinePtr outline;
+    XkbcOutlinePtr outline;
     ExprDef *pt;
 
     if (def->nOutlines < 1)
@@ -2410,7 +2408,7 @@ HandleShapeBody(ShapeDef * def, ShapeInfo * si, unsigned merge,
         return True;
     }
     si->nOutlines = def->nOutlines;
-    si->outlines = uTypedCalloc(def->nOutlines, XkbOutlineRec);
+    si->outlines = uTypedCalloc(def->nOutlines, XkbcOutlineRec);
     if (!si->outlines)
     {
         ERROR("Couldn't allocate outlines for \"%s\"\n", shText(si));
@@ -2430,7 +2428,7 @@ HandleShapeBody(ShapeDef * def, ShapeInfo * si, unsigned merge,
         outline = &si->outlines[nOut++];
         outline->num_points = ol->nPoints;
         outline->corner_radius = si->dfltCornerRadius;
-        outline->points = uTypedCalloc(ol->nPoints, XkbPointRec);
+        outline->points = uTypedCalloc(ol->nPoints, XkbcPointRec);
         if (!outline->points)
         {
             ERROR("Can't allocate points for \"%s\"\n", shText(si));
@@ -2925,12 +2923,12 @@ HandleGeometryFile(XkbFile * file,
 /***====================================================================***/
 
 static Bool
-CopyShapeDef(XkbGeometryPtr geom, ShapeInfo * si)
+CopyShapeDef(XkbcGeometryPtr geom, ShapeInfo * si)
 {
     register int i, n;
-    XkbShapePtr shape;
-    XkbOutlinePtr old_outline, outline;
-    Atom name;
+    XkbcShapePtr shape;
+    XkbcOutlinePtr old_outline, outline;
+    CARD32 name;
 
     si->index = geom->num_shapes;
     name = si->name;
@@ -2952,7 +2950,7 @@ CopyShapeDef(XkbGeometryPtr geom, ShapeInfo * si)
             return False;
         }
         n = old_outline->num_points;
-        memcpy(outline->points, old_outline->points, n * sizeof(XkbPointRec));
+        memcpy(outline->points, old_outline->points, n * sizeof(XkbcPointRec));
         outline->num_points = old_outline->num_points;
         outline->corner_radius = old_outline->corner_radius;
     }
@@ -3257,10 +3255,10 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info)
 #define	FONT_TEMPLATE	"-*-%s-%s-%s-%s-%s-*-%d-*-*-*-*-%s"
 
 static char *
-FontFromParts(Atom fontTok,
-              Atom weightTok,
-              Atom slantTok,
-              Atom setWidthTok, Atom varTok, int size, Atom encodingTok)
+FontFromParts(CARD32 fontTok,
+              CARD32 weightTok,
+              CARD32 slantTok,
+              CARD32 setWidthTok, CARD32 varTok, int size, CARD32 encodingTok)
 {
     int totalSize;
     char *font, *weight, *slant, *setWidth, *variant, *encoding;
@@ -3287,13 +3285,13 @@ FontFromParts(Atom fontTok,
 }
 
 static Bool
-CopyDoodadDef(XkbGeometryPtr geom,
-              XkbSectionPtr section, DoodadInfo * di, GeometryInfo * info)
+CopyDoodadDef(XkbcGeometryPtr geom,
+              XkbcSectionPtr section, DoodadInfo * di, GeometryInfo * info)
 {
-    Atom name;
-    XkbDoodadPtr doodad;
-    XkbColorPtr color;
-    XkbShapePtr shape;
+    CARD32 name;
+    XkbcDoodadPtr doodad;
+    XkbcColorPtr color;
+    XkbcShapePtr shape;
     ShapeInfo *si;
 
     if (!VerifyDoodadInfo(di, info))
@@ -3375,15 +3373,15 @@ CopyDoodadDef(XkbGeometryPtr geom,
 /***====================================================================***/
 
 static Bool
-VerifyOverlayInfo(XkbGeometryPtr geom,
-                  XkbSectionPtr section,
+VerifyOverlayInfo(XkbcGeometryPtr geom,
+                  XkbcSectionPtr section,
                   OverlayInfo * oi,
                   GeometryInfo * info, short rowMap[256], short rowSize[256])
 {
     register OverlayKeyInfo *ki, *next;
     unsigned long oKey, uKey, sKey;
-    XkbRowPtr row;
-    XkbKeyPtr key;
+    XkbcRowPtr row;
+    XkbcKeyPtr key;
     int r, k;
 
     /* find out which row each key is in */
@@ -3472,13 +3470,13 @@ VerifyOverlayInfo(XkbGeometryPtr geom,
 }
 
 static Bool
-CopyOverlayDef(XkbGeometryPtr geom,
-               XkbSectionPtr section, OverlayInfo * oi, GeometryInfo * info)
+CopyOverlayDef(XkbcGeometryPtr geom,
+               XkbcSectionPtr section, OverlayInfo * oi, GeometryInfo * info)
 {
-    Atom name;
-    XkbOverlayPtr ol;
-    XkbOverlayRowPtr row;
-    XkbOverlayKeyPtr key;
+    CARD32 name;
+    XkbcOverlayPtr ol;
+    XkbcOverlayRowPtr row;
+    XkbcOverlayKeyPtr key;
     OverlayKeyInfo *ki;
     short rowMap[256], rowSize[256];
     int i;
@@ -3514,7 +3512,7 @@ CopyOverlayDef(XkbGeometryPtr geom,
     {
         row = &ol->rows[ki->overlayRow];
         key = &row->keys[row->num_keys++];
-        bzero(key, sizeof(XkbOverlayKeyRec));
+        bzero(key, sizeof(XkbcOverlayKeyRec));
         strncpy(key->over.name, ki->over, XkbKeyNameLength);
         strncpy(key->under.name, ki->under, XkbKeyNameLength);
     }
@@ -3524,11 +3522,11 @@ CopyOverlayDef(XkbGeometryPtr geom,
 /***====================================================================***/
 
 static Bool
-CopySectionDef(XkbGeometryPtr geom, SectionInfo * si, GeometryInfo * info)
+CopySectionDef(XkbcGeometryPtr geom, SectionInfo * si, GeometryInfo * info)
 {
-    XkbSectionPtr section;
-    XkbRowPtr row;
-    XkbKeyPtr key;
+    XkbcSectionPtr section;
+    XkbcRowPtr row;
+    XkbcKeyPtr key;
     KeyInfo *ki;
     RowInfo *ri;
 
@@ -3560,7 +3558,7 @@ CopySectionDef(XkbGeometryPtr geom, SectionInfo * si, GeometryInfo * info)
         row->vertical = ri->vertical;
         for (ki = ri->keys; ki != NULL; ki = (KeyInfo *) ki->defs.next)
         {
-            XkbColorPtr color;
+            XkbcColorPtr color;
             if ((ki->defs.defined & _GK_Name) == 0)
             {
                 ERROR("Key %d of row %d in section %s has no name\n",
@@ -3636,8 +3634,8 @@ CompileGeometry(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
 
     if (info.errorCount == 0)
     {
-        XkbGeometryPtr geom;
-        XkbGeometrySizesRec sizes;
+        XkbcGeometryPtr geom;
+        XkbcGeometrySizesRec sizes;
         bzero(&sizes, sizeof(sizes));
         sizes.which = XkbGeomAllMask;
         sizes.num_properties = info.nProps;
diff --git a/src/xkbcomp/indicators.c b/src/xkbcomp/indicators.c
index 726d37b..e2e8488 100644
--- a/src/xkbcomp/indicators.c
+++ b/src/xkbcomp/indicators.c
@@ -513,7 +513,7 @@ BindIndicators(XkbcDescPtr xkb, Bool force, LEDInfo *unbound,
             if ((xkb->names != NULL) &&
                 (xkb->names->indicators[led->indicator - 1] != led->name))
             {
-                Atom old = xkb->names->indicators[led->indicator - 1];
+                CARD32 old = xkb->names->indicators[led->indicator - 1];
                 ERROR("Multiple names bound to indicator %d\n",
                        (unsigned int) led->indicator);
                 ACTION("Using %s, ignoring %s\n",
diff --git a/src/xkbcomp/indicators.h b/src/xkbcomp/indicators.h
index f9c2195..23d879e 100644
--- a/src/xkbcomp/indicators.h
+++ b/src/xkbcomp/indicators.h
@@ -40,7 +40,7 @@
 typedef struct _LEDInfo
 {
     CommonInfo defs;
-    Atom name;
+    CARD32 name;
     unsigned char indicator;
     unsigned char flags;
     unsigned char which_mods;
diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c
index 70bcdbe..e8b6df2 100644
--- a/src/xkbcomp/keycodes.c
+++ b/src/xkbcomp/keycodes.c
@@ -60,7 +60,7 @@ typedef struct _IndicatorNameInfo
 {
     CommonInfo defs;
     int ndx;
-    Atom name;
+    CARD32 name;
     Bool virtual;
 } IndicatorNameInfo;
 
@@ -142,7 +142,7 @@ FindIndicatorByIndex(KeyNamesInfo * info, int ndx)
 }
 
 static IndicatorNameInfo *
-FindIndicatorByName(KeyNamesInfo * info, Atom name)
+FindIndicatorByName(KeyNamesInfo * info, CARD32 name)
 {
     IndicatorNameInfo *old;
 
@@ -227,7 +227,7 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
             else
             {
                 const char *oldType, *newType;
-                Atom using, ignoring;
+                CARD32 using, ignoring;
                 if (old->virtual)
                     oldType = "virtual indicator";
                 else
@@ -857,7 +857,7 @@ CompileKeycodes(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
         }
         else
         {
-            WSGO("Cannot create XkbNamesRec in CompileKeycodes\n");
+            WSGO("Cannot create XkbcNamesRec in CompileKeycodes\n");
             return False;
         }
         if (info.leds)
diff --git a/src/xkbcomp/keytypes.c b/src/xkbcomp/keytypes.c
index dec9893..786052c 100644
--- a/src/xkbcomp/keytypes.c
+++ b/src/xkbcomp/keytypes.c
@@ -52,7 +52,7 @@ typedef struct _PreserveInfo
 typedef struct _KeyTypeInfo
 {
     CommonInfo defs;
-    Atom name;
+    CARD32 name;
     int fileID;
     unsigned mask;
     unsigned vmask;
@@ -63,7 +63,7 @@ typedef struct _KeyTypeInfo
     XkbKTMapEntryPtr entries;
     PreserveInfo *preserve;
     int szNames;
-    Atom *lvlNames;
+    CARD32 *lvlNames;
 } KeyTypeInfo;
 
 typedef struct _KeyTypesInfo
@@ -78,10 +78,10 @@ typedef struct _KeyTypesInfo
     VModInfo vmods;
 } KeyTypesInfo;
 
-Atom tok_ONE_LEVEL;
-Atom tok_TWO_LEVEL;
-Atom tok_ALPHABETIC;
-Atom tok_KEYPAD;
+CARD32 tok_ONE_LEVEL;
+CARD32 tok_TWO_LEVEL;
+CARD32 tok_ALPHABETIC;
+CARD32 tok_KEYPAD;
 
 /***====================================================================***/
 
@@ -108,7 +108,7 @@ extern Bool AddPreserve(XkbcDescPtr /* xkb */ ,
 
 extern Bool AddLevelName(KeyTypeInfo * /* type */ ,
                          unsigned /* level */ ,
-                         Atom /* name */ ,
+                         CARD32 /* name */ ,
                          Bool /* clobber */ ,
                          Bool   /* report */
     );
@@ -168,10 +168,10 @@ InitKeyTypesInfo(KeyTypesInfo * info, XkbcDescPtr xkb, KeyTypesInfo * from)
         }
         if (from->dflt.lvlNames)
         {
-            info->dflt.lvlNames = uTypedCalloc(from->dflt.szNames, Atom);
+            info->dflt.lvlNames = uTypedCalloc(from->dflt.szNames, CARD32);
             if (info->dflt.lvlNames)
             {
-                register unsigned sz = from->dflt.szNames * sizeof(Atom);
+                register unsigned sz = from->dflt.szNames * sizeof(CARD32);
                 memcpy(info->dflt.lvlNames, from->dflt.lvlNames, sz);
             }
         }
@@ -783,12 +783,12 @@ SetPreserve(KeyTypeInfo * type,
 
 Bool
 AddLevelName(KeyTypeInfo * type,
-             unsigned level, Atom name, Bool clobber, Bool report)
+             unsigned level, CARD32 name, Bool clobber, Bool report)
 {
     if ((type->lvlNames == NULL) || (type->szNames <= level))
     {
         type->lvlNames =
-            uTypedRecalloc(type->lvlNames, type->szNames, level + 1, Atom);
+            uTypedRecalloc(type->lvlNames, type->szNames, level + 1, CARD32);
         if (type->lvlNames == NULL)
         {
             ERROR("Couldn't allocate level names for type %s\n",
@@ -837,7 +837,7 @@ SetLevelName(KeyTypeInfo * type, ExprDef * arrayNdx, ExprDef * value)
 {
     ExprResult rtrn;
     unsigned level;
-    Atom level_name;
+    CARD32 level_name;
 
     if (arrayNdx == NULL)
         return ReportTypeShouldBeArray(type, "level name");
@@ -1126,7 +1126,7 @@ HandleKeyTypesFile(XkbFile * file,
 }
 
 static Bool
-CopyDefToKeyType(XkbcDescPtr xkb, XkbKeyTypePtr type, KeyTypeInfo * def)
+CopyDefToKeyType(XkbcDescPtr xkb, XkbcKeyTypePtr type, KeyTypeInfo * def)
 {
     register int i;
     PreserveInfo *pre;
@@ -1177,7 +1177,7 @@ CopyDefToKeyType(XkbcDescPtr xkb, XkbKeyTypePtr type, KeyTypeInfo * def)
     }
     else
         type->preserve = NULL;
-    type->name = (Atom) def->name;
+    type->name = (CARD32) def->name;
     if (def->szNames > 0)
     {
         type->level_names = uTypedCalloc(def->numLevels, CARD32);
@@ -1211,7 +1211,7 @@ CompileKeyTypes(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
     {
         register int i;
         register KeyTypeInfo *def;
-        register XkbKeyTypePtr type, next;
+        register XkbcKeyTypePtr type, next;
 
         if (info.name != NULL)
         {
diff --git a/src/xkbcomp/listing.c b/src/xkbcomp/listing.c
index a2bb9fc..9683aa5 100644
--- a/src/xkbcomp/listing.c
+++ b/src/xkbcomp/listing.c
@@ -122,7 +122,6 @@ SOFTWARE.
 #include "parseutils.h"
 #include "misc.h"
 #include "tokens.h"
-#include <X11/extensions/XKBgeomcommon.h>
 
 #ifndef DFLT_XKB_CONFIG_ROOT
 #define DFLT_XKB_CONFIG_ROOT "/usr/share/X11/xkb"
diff --git a/src/xkbcomp/misc.c b/src/xkbcomp/misc.c
index 73766d5..abb0a0a 100644
--- a/src/xkbcomp/misc.c
+++ b/src/xkbcomp/misc.c
@@ -34,8 +34,6 @@
 #include <X11/keysym.h>
 #include "parseutils.h"
 
-#include <X11/extensions/XKBgeomcommon.h>
-
 /***====================================================================***/
 
 /**
diff --git a/src/xkbcomp/parseutils.c b/src/xkbcomp/parseutils.c
index f2847e2..b3a7c0b 100644
--- a/src/xkbcomp/parseutils.c
+++ b/src/xkbcomp/parseutils.c
@@ -29,7 +29,6 @@
 #include "xkbmisc.h"
 #include "xkbpath.h"
 #include <X11/keysym.h>
-#include <X11/extensions/XKBgeomcommon.h>
 #include <X11/Xalloca.h>
 
 XkbFile *rtrnValue;
@@ -167,7 +166,7 @@ KeyAliasCreate(char *alias, char *real)
 }
 
 VModDef *
-VModCreate(Atom name, ExprDef * value)
+VModCreate(CARD32 name, ExprDef * value)
 {
     VModDef *def;
     def = uTypedAlloc(VModDef);
@@ -207,7 +206,7 @@ VarCreate(ExprDef * name, ExprDef * value)
 }
 
 VarDef *
-BoolVarCreate(Atom nameToken, unsigned set)
+BoolVarCreate(CARD32 nameToken, unsigned set)
 {
     ExprDef *name, *value;
 
@@ -240,7 +239,7 @@ InterpCreate(char *sym, ExprDef * match)
 }
 
 KeyTypeDef *
-KeyTypeCreate(Atom name, VarDef * body)
+KeyTypeCreate(CARD32 name, VarDef * body)
 {
     KeyTypeDef *def;
 
@@ -307,7 +306,7 @@ GroupCompatCreate(int group, ExprDef * val)
 }
 
 ModMapDef *
-ModMapCreate(Atom modifier, ExprDef * keys)
+ModMapCreate(CARD32 modifier, ExprDef * keys)
 {
     ModMapDef *def;
 
@@ -329,7 +328,7 @@ ModMapCreate(Atom modifier, ExprDef * keys)
 }
 
 IndicatorMapDef *
-IndicatorMapCreate(Atom name, VarDef * body)
+IndicatorMapCreate(CARD32 name, VarDef * body)
 {
     IndicatorMapDef *def;
 
@@ -374,7 +373,7 @@ IndicatorNameCreate(int ndx, ExprDef * name, Bool virtual)
 }
 
 ExprDef *
-ActionCreate(Atom name, ExprDef * args)
+ActionCreate(CARD32 name, ExprDef * args)
 {
     ExprDef *act;
 
@@ -414,7 +413,7 @@ CreateKeysymList(char *sym)
 }
 
 ShapeDef *
-ShapeDeclCreate(Atom name, OutlineDef * outlines)
+ShapeDeclCreate(CARD32 name, OutlineDef * outlines)
 {
     ShapeDef *shape;
     OutlineDef *ol;
@@ -439,7 +438,7 @@ ShapeDeclCreate(Atom name, OutlineDef * outlines)
 }
 
 OutlineDef *
-OutlineCreate(Atom field, ExprDef * points)
+OutlineCreate(CARD32 field, ExprDef * points)
 {
     OutlineDef *outline;
     ExprDef *pt;
@@ -517,7 +516,7 @@ RowDeclCreate(KeyDef * keys)
 }
 
 SectionDef *
-SectionDeclCreate(Atom name, RowDef * rows)
+SectionDeclCreate(CARD32 name, RowDef * rows)
 {
     SectionDef *section;
     RowDef *row;
@@ -561,7 +560,7 @@ OverlayKeyCreate(char *under, char *over)
 }
 
 OverlayDef *
-OverlayDeclCreate(Atom name, OverlayKeyDef * keys)
+OverlayDeclCreate(CARD32 name, OverlayKeyDef * keys)
 {
     OverlayDef *ol;
     OverlayKeyDef *key;
@@ -583,7 +582,7 @@ OverlayDeclCreate(Atom name, OverlayKeyDef * keys)
 }
 
 DoodadDef *
-DoodadCreate(unsigned type, Atom name, VarDef * body)
+DoodadCreate(unsigned type, CARD32 name, VarDef * body)
 {
     DoodadDef *doodad;
 
diff --git a/src/xkbcomp/parseutils.h b/src/xkbcomp/parseutils.h
index d96a20b..623347a 100644
--- a/src/xkbcomp/parseutils.h
+++ b/src/xkbcomp/parseutils.h
@@ -76,7 +76,7 @@ extern KeyAliasDef *KeyAliasCreate(char * /* alias */ ,
                                    char *       /* real */
     );
 
-extern VModDef *VModCreate(Atom /* name */ ,
+extern VModDef *VModCreate(CARD32 /* name */ ,
                            ExprDef *    /* value */
     );
 
@@ -84,7 +84,7 @@ extern VarDef *VarCreate(ExprDef * /* name */ ,
                          ExprDef *      /* value */
     );
 
-extern VarDef *BoolVarCreate(Atom /* nameToken */ ,
+extern VarDef *BoolVarCreate(CARD32 /* nameToken */ ,
                              unsigned   /* set */
     );
 
@@ -92,7 +92,7 @@ extern InterpDef *InterpCreate(char * /* sym */ ,
                                ExprDef *        /* match */
     );
 
-extern KeyTypeDef *KeyTypeCreate(Atom /* name */ ,
+extern KeyTypeDef *KeyTypeCreate(CARD32 /* name */ ,
                                  VarDef *       /* body */
     );
 
@@ -104,11 +104,11 @@ extern GroupCompatDef *GroupCompatCreate(int /* group */ ,
                                          ExprDef *      /* def */
     );
 
-extern ModMapDef *ModMapCreate(Atom /* modifier */ ,
+extern ModMapDef *ModMapCreate(CARD32 /* modifier */ ,
                                ExprDef *        /* keys */
     );
 
-extern IndicatorMapDef *IndicatorMapCreate(Atom /* name */ ,
+extern IndicatorMapDef *IndicatorMapCreate(CARD32 /* name */ ,
                                            VarDef *     /* body */
     );
 
@@ -117,18 +117,18 @@ extern IndicatorNameDef *IndicatorNameCreate(int /* ndx */ ,
                                              Bool       /* virtual */
     );
 
-extern ExprDef *ActionCreate(Atom /* name */ ,
+extern ExprDef *ActionCreate(CARD32 /* name */ ,
                              ExprDef *  /* args */
     );
 
 extern ExprDef *CreateKeysymList(char * /* sym */
     );
 
-extern ShapeDef *ShapeDeclCreate(Atom /* name */ ,
+extern ShapeDef *ShapeDeclCreate(CARD32 /* name */ ,
                                  OutlineDef *   /* outlines */
     );
 
-extern OutlineDef *OutlineCreate(Atom /* field */ ,
+extern OutlineDef *OutlineCreate(CARD32 /* field */ ,
                                  ExprDef *      /* points */
     );
 
@@ -143,7 +143,7 @@ extern KeyDef *KeyDeclMerge(KeyDef * /* into */ ,
 extern RowDef *RowDeclCreate(KeyDef *   /* keys */
     );
 
-extern SectionDef *SectionDeclCreate(Atom /* name */ ,
+extern SectionDef *SectionDeclCreate(CARD32 /* name */ ,
                                      RowDef *   /* rows */
     );
 
@@ -151,12 +151,12 @@ extern OverlayKeyDef *OverlayKeyCreate(char * /* under */ ,
                                        char *   /* over  */
     );
 
-extern OverlayDef *OverlayDeclCreate(Atom /* name */ ,
+extern OverlayDef *OverlayDeclCreate(CARD32 /* name */ ,
                                      OverlayKeyDef *    /* rows */
     );
 
 extern DoodadDef *DoodadCreate(unsigned /* type */ ,
-                               Atom /* name */ ,
+                               CARD32 /* name */ ,
                                VarDef * /* body */
     );
 
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 69964ad..e85c29f 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -42,9 +42,9 @@
 #include "misc.h"
 #include "alias.h"
 
-extern Atom tok_ONE_LEVEL;
-extern Atom tok_TWO_LEVEL;
-extern Atom tok_KEYPAD;
+extern CARD32 tok_ONE_LEVEL;
+extern CARD32 tok_TWO_LEVEL;
+extern CARD32 tok_KEYPAD;
 
 /***====================================================================***/
 
@@ -72,13 +72,13 @@ typedef struct _KeyInfo
     short numLevels[XkbNumKbdGroups];
     CARD32 *syms[XkbNumKbdGroups];
     XkbcAction *acts[XkbNumKbdGroups];
-    Atom types[XkbNumKbdGroups];
+    CARD32 types[XkbNumKbdGroups];
     unsigned repeat;
     XkbBehavior behavior;
     unsigned short vmodmap;
     unsigned long nameForOverlayKey;
     unsigned long allowNone;
-    Atom dfltType;
+    CARD32 dfltType;
 } KeyInfo;
 
 /**
@@ -234,7 +234,7 @@ typedef struct _SymbolsInfo
     KeyInfo dflt;
     VModInfo vmods;
     ActionInfo *action;
-    Atom groupNames[XkbNumKbdGroups];
+    CARD32 groupNames[XkbNumKbdGroups];
 
     ModMapEntry *modMap;
     AliasInfo *aliases;
@@ -540,7 +540,7 @@ MergeKeys(SymbolsInfo * info, KeyInfo * into, KeyInfo * from)
             if ((into->types[i] != None) && (report) &&
                 (into->types[i] != from->types[i]))
             {
-                Atom use, ignore;
+                CARD32 use, ignore;
                 collide |= _Key_Types;
                 if (from->defs.merge != MergeAugment)
                 {
@@ -1569,7 +1569,7 @@ SetExplicitGroup(SymbolsInfo * info, KeyInfo * key)
             if (key->acts[i] != NULL)
                 uFree(key->acts[i]);
             key->acts[i] = (XkbcAction *) NULL;
-            key->types[i] = (Atom) 0;
+            key->types[i] = (CARD32) 0;
         }
     }
     key->typesDefined = key->symsDefined = key->actsDefined = 1 << group;
@@ -1581,7 +1581,7 @@ SetExplicitGroup(SymbolsInfo * info, KeyInfo * key)
     key->acts[group] = key->acts[0];
     key->acts[0] = (XkbcAction *) NULL;
     key->types[group] = key->types[0];
-    key->types[0] = (Atom) 0;
+    key->types[0] = (CARD32) 0;
     return True;
 }
 
@@ -1756,7 +1756,7 @@ FindKeyForSymbol(XkbcDescPtr xkb, CARD32 sym, unsigned int *kc_rtrn)
  * @return True if found, False otherwise.
  */
 static Bool
-FindNamedType(XkbcDescPtr xkb, Atom name, unsigned *type_rtrn)
+FindNamedType(XkbcDescPtr xkb, CARD32 name, unsigned *type_rtrn)
 {
     register unsigned n;
 
@@ -1764,7 +1764,7 @@ FindNamedType(XkbcDescPtr xkb, Atom name, unsigned *type_rtrn)
     {
         for (n = 0; n < xkb->map->num_types; n++)
         {
-            if (xkb->map->types[n].name == (Atom) name)
+            if (xkb->map->types[n].name == (CARD32) name)
             {
                 *type_rtrn = n;
                 return True;
@@ -1791,7 +1791,7 @@ FindNamedType(XkbcDescPtr xkb, Atom name, unsigned *type_rtrn)
  * @returns True if a type could be found, False otherwise.
  */
 static Bool
-FindAutomaticType(int width, CARD32 * syms, Atom * typeNameRtrn,
+FindAutomaticType(int width, CARD32 * syms, CARD32 * typeNameRtrn,
                   Bool * autoType)
 {
     *autoType = False;
@@ -1936,7 +1936,7 @@ PrepareKeyDef(KeyInfo * key)
             if (key->acts[i] != NULL)
                 uFree(key->acts[i]);
             key->acts[i] = (XkbcAction *) NULL;
-            key->types[i] = (Atom) 0;
+            key->types[i] = (CARD32) 0;
         }
         key->symsDefined &= 1;
         key->actsDefined &= 1;
@@ -1955,7 +1955,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
 {
     register int i;
     unsigned okc, kc, width, tmp, nGroups;
-    XkbKeyTypePtr type;
+    XkbcKeyTypePtr type;
     Bool haveActions, autoType, useAlias;
     CARD32 *outSyms;
     XkbcAction *outActs;
diff --git a/src/xkbcomp/tokens.h b/src/xkbcomp/tokens.h
index c87437b..9e554ab 100644
--- a/src/xkbcomp/tokens.h
+++ b/src/xkbcomp/tokens.h
@@ -27,6 +27,7 @@
 #define	TOKENS_H 1
 
 #include <X11/Xdefs.h>
+#include <X11/Xmd.h>
 
 #define	END_OF_FILE	0
 #define	ERROR_TOK	255
@@ -98,9 +99,9 @@
 #define	FUNCTION_KEYS		76
 #define	ALTERNATE_GROUP		77
 
-extern Atom tok_ONE_LEVEL;
-extern Atom tok_TWO_LEVEL;
-extern Atom tok_ALPHABETIC;
-extern Atom tok_KEYPAD;
+extern CARD32 tok_ONE_LEVEL;
+extern CARD32 tok_TWO_LEVEL;
+extern CARD32 tok_ALPHABETIC;
+extern CARD32 tok_KEYPAD;
 
 #endif
diff --git a/src/xkbcomp/vmod.c b/src/xkbcomp/vmod.c
index a7c1827..74011ca 100644
--- a/src/xkbcomp/vmod.c
+++ b/src/xkbcomp/vmod.c
@@ -85,7 +85,7 @@ HandleVModDef(VModDef * stmt, unsigned mergeMode, VModInfo * info)
     register int i, bit, nextFree;
     ExprResult mod;
     XkbcServerMapPtr srv;
-    XkbNamesPtr names;
+    XkbcNamesPtr names;
 
     srv = info->xkb->server;
     names = info->xkb->names;
@@ -164,7 +164,7 @@ HandleVModDef(VModDef * stmt, unsigned mergeMode, VModInfo * info)
  */
 int
 LookupVModIndex(char * priv,
-                Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
+                CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
 {
     int i;
     XkbcDescPtr xkb;
@@ -203,7 +203,7 @@ LookupVModIndex(char * priv,
  */
 int
 LookupVModMask(char * priv,
-               Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
+               CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
 {
     if (LookupVModIndex(priv, elem, field, type, val_rtrn))
     {
@@ -217,7 +217,7 @@ LookupVModMask(char * priv,
 int
 FindKeypadVMod(XkbcDescPtr xkb)
 {
-    Atom name;
+    CARD32 name;
     ExprResult rtrn;
 
     name = XkbcInternAtom("NumLock", False);
@@ -231,7 +231,7 @@ FindKeypadVMod(XkbcDescPtr xkb)
 Bool
 ResolveVirtualModifier(ExprDef * def, ExprResult * val_rtrn, VModInfo * info)
 {
-    XkbNamesPtr names;
+    XkbcNamesPtr names;
 
     names = info->xkb->names;
     if (def->op == ExprIdent)
diff --git a/src/xkbcomp/vmod.h b/src/xkbcomp/vmod.h
index 61bd353..b2c76ba 100644
--- a/src/xkbcomp/vmod.h
+++ b/src/xkbcomp/vmod.h
@@ -54,15 +54,15 @@ extern Bool ApplyVModDefs(VModInfo * /* info */ ,
     );
 
 extern int LookupVModIndex(char * /* priv */ ,
-                           Atom /* elem */ ,
-                           Atom /* field */ ,
+                           CARD32 /* elem */ ,
+                           CARD32 /* field */ ,
                            unsigned /* type */ ,
                            ExprResult * /* val_rtrn */
     );
 
 extern int LookupVModMask(char * /* priv */ ,
-                          Atom /* elem */ ,
-                          Atom /* field */ ,
+                          CARD32 /* elem */ ,
+                          CARD32 /* field */ ,
                           unsigned /* type */ ,
                           ExprResult *  /* val_rtrn */
     );
diff --git a/src/xkbcomp/xkbcomp.c b/src/xkbcomp/xkbcomp.c
index b780ff9..f8109d4 100644
--- a/src/xkbcomp/xkbcomp.c
+++ b/src/xkbcomp/xkbcomp.c
@@ -200,6 +200,8 @@ XkbcCompileKeymapFromComponents(const XkbComponentNamesPtr ktcsg)
     XkbFile *file, *mapToUse;
     XkbcDescPtr xkb;
 
+    uSetErrorFile(NULL);
+
     if (!ktcsg || ISEMPTY(ktcsg->keycodes)) {
         ERROR("keycodes required to generate XKB keymap\n");
         goto fail;
diff --git a/src/xkbcomp/xkbcomp.h b/src/xkbcomp/xkbcomp.h
index d44f989..ba39a0b 100644
--- a/src/xkbcomp/xkbcomp.h
+++ b/src/xkbcomp/xkbcomp.h
@@ -140,18 +140,18 @@ typedef struct _Expr
         } binary;
         struct
         {
-            Atom element;
-            Atom field;
+            CARD32 element;
+            CARD32 field;
         } field;
         struct
         {
-            Atom element;
-            Atom field;
+            CARD32 element;
+            CARD32 field;
             struct _Expr *entry;
         } array;
         struct
         {
-            Atom name;
+            CARD32 name;
             struct _Expr *args;
         } action;
         struct
@@ -166,7 +166,7 @@ typedef struct _Expr
             int y;
         } coord;
         struct _Expr *child;
-        Atom str;
+        CARD32 str;
         unsigned uval;
         int ival;
         char keyName[5];
@@ -186,7 +186,7 @@ typedef struct _VModDef
 {
     ParseCommon common;
     unsigned merge;
-    Atom name;
+    CARD32 name;
     ExprDef *value;
 } VModDef;
 
@@ -210,7 +210,7 @@ typedef struct _KeyTypeDef
 {
     ParseCommon common;
     unsigned merge;
-    Atom name;
+    CARD32 name;
     VarDef *body;
 } KeyTypeDef;
 
@@ -226,7 +226,7 @@ typedef struct _ModMapDef
 {
     ParseCommon common;
     unsigned merge;
-    Atom modifier;
+    CARD32 modifier;
     ExprDef *keys;
 } ModMapDef;
 
@@ -242,7 +242,7 @@ typedef struct _InterpDef
 {
     ParseCommon common;
     unsigned merge;
-    CARD32 sym;
+    char *sym;
     ExprDef *match;
     VarDef *def;
 } InterpDef;
@@ -259,7 +259,7 @@ typedef struct _IndicatorNameDef
 typedef struct _OutlineDef
 {
     ParseCommon common;
-    Atom field;
+    CARD32 field;
     int nPoints;
     ExprDef *points;
 } OutlineDef;
@@ -268,7 +268,7 @@ typedef struct _ShapeDef
 {
     ParseCommon common;
     unsigned merge;
-    Atom name;
+    CARD32 name;
     int nOutlines;
     OutlineDef *outlines;
 } ShapeDef;
@@ -292,7 +292,7 @@ typedef struct _SectionDef
 {
     ParseCommon common;
     unsigned merge;
-    Atom name;
+    CARD32 name;
     int nRows;
     RowDef *rows;
 } SectionDef;
@@ -308,7 +308,7 @@ typedef struct _OverlayDef
 {
     ParseCommon common;
     unsigned merge;
-    Atom name;
+    CARD32 name;
     int nKeys;
     OverlayKeyDef *keys;
 } OverlayDef;
@@ -318,7 +318,7 @@ typedef struct _DoodadDef
     ParseCommon common;
     unsigned merge;
     unsigned type;
-    Atom name;
+    CARD32 name;
     VarDef *body;
 } DoodadDef;
 
diff --git a/src/xkbcomp/xkbparse.y b/src/xkbcomp/xkbparse.y
index 32f8f0a..ae37f7a 100644
--- a/src/xkbcomp/xkbparse.y
+++ b/src/xkbcomp/xkbparse.y
@@ -97,7 +97,6 @@
 #include "xkbmisc.h"
 #include <X11/Xlib.h>
 #include <X11/keysym.h>
-#include <X11/extensions/XKBgeomcommon.h>
 #include <stdlib.h>
 
 unsigned int parseDebug;
diff --git a/src/xkbgeom.h b/src/xkbgeom.h
index 5a80f32..ae6e169 100644
--- a/src/xkbgeom.h
+++ b/src/xkbgeom.h
@@ -30,149 +30,148 @@ authorization from the authors.
 #include <X11/X.h>
 #include <X11/Xdefs.h>
 #include <X11/extensions/XKBstrcommon.h>
-#include <X11/extensions/XKBgeomcommon.h>
 #include <X11/extensions/XKBrulescommon.h>
 #include "X11/extensions/XKBcommon.h"
 
 extern void
-XkbcFreeGeomProperties(XkbGeometryPtr geom, int first, int count, Bool freeAll);
+XkbcFreeGeomProperties(XkbcGeometryPtr geom, int first, int count, Bool freeAll);
 
 extern void
-XkbcFreeGeomKeyAliases(XkbGeometryPtr geom, int first, int count, Bool freeAll);
+XkbcFreeGeomKeyAliases(XkbcGeometryPtr geom, int first, int count, Bool freeAll);
 
 extern void
-XkbcFreeGeomColors(XkbGeometryPtr geom, int first, int count, Bool freeAll);
+XkbcFreeGeomColors(XkbcGeometryPtr geom, int first, int count, Bool freeAll);
 
 extern void
-XkbcFreeGeomPoints(XkbOutlinePtr outline, int first, int count, Bool freeAll);
+XkbcFreeGeomPoints(XkbcOutlinePtr outline, int first, int count, Bool freeAll);
 
 extern void
-XkbcFreeGeomOutlines(XkbShapePtr shape, int first, int count, Bool freeAll);
+XkbcFreeGeomOutlines(XkbcShapePtr shape, int first, int count, Bool freeAll);
 
 extern void
-XkbcFreeGeomShapes(XkbGeometryPtr geom, int first, int count, Bool freeAll);
+XkbcFreeGeomShapes(XkbcGeometryPtr geom, int first, int count, Bool freeAll);
 
 extern void
-XkbcFreeGeomOverlayKeys(XkbOverlayRowPtr row, int first, int count,
+XkbcFreeGeomOverlayKeys(XkbcOverlayRowPtr row, int first, int count,
                         Bool freeAll);
 
 extern void
-XkbcFreeGeomOverlayRows(XkbOverlayPtr overlay, int first, int count,
+XkbcFreeGeomOverlayRows(XkbcOverlayPtr overlay, int first, int count,
                         Bool freeAll);
 
 extern void
-XkbcFreeGeomOverlays(XkbSectionPtr section, int first, int count, Bool freeAll);
+XkbcFreeGeomOverlays(XkbcSectionPtr section, int first, int count, Bool freeAll);
 
 extern void
-XkbcFreeGeomKeys(XkbRowPtr row, int first, int count, Bool freeAll);
+XkbcFreeGeomKeys(XkbcRowPtr row, int first, int count, Bool freeAll);
 
 extern void
-XkbcFreeGeomRows(XkbSectionPtr section, int first, int count, Bool freeAll);
+XkbcFreeGeomRows(XkbcSectionPtr section, int first, int count, Bool freeAll);
 
 extern void
-XkbcFreeGeomSections(XkbGeometryPtr geom, int first, int count, Bool freeAll);
+XkbcFreeGeomSections(XkbcGeometryPtr geom, int first, int count, Bool freeAll);
 
 extern void
-XkbcFreeGeomDoodads(XkbDoodadPtr doodads, int nDoodads, Bool freeAll);
+XkbcFreeGeomDoodads(XkbcDoodadPtr doodads, int nDoodads, Bool freeAll);
 
 extern void
-XkbcFreeGeometry(XkbGeometryPtr geom, unsigned which, Bool freeMap);
+XkbcFreeGeometry(XkbcGeometryPtr geom, unsigned which, Bool freeMap);
 
 extern int
-XkbcAllocGeomProps(XkbGeometryPtr geom, int nProps);
+XkbcAllocGeomProps(XkbcGeometryPtr geom, int nProps);
 
 extern int
-XkbcAllocGeomColors(XkbGeometryPtr geom, int nColors);
+XkbcAllocGeomColors(XkbcGeometryPtr geom, int nColors);
 
 extern int
-XkbcAllocGeomKeyAliases(XkbGeometryPtr geom, int nKeyAliases);
+XkbcAllocGeomKeyAliases(XkbcGeometryPtr geom, int nKeyAliases);
 
 extern int
-XkbcAllocGeomShapes(XkbGeometryPtr geom, int nShapes);
+XkbcAllocGeomShapes(XkbcGeometryPtr geom, int nShapes);
 
 extern int
-XkbcAllocGeomSections(XkbGeometryPtr geom, int nSections);
+XkbcAllocGeomSections(XkbcGeometryPtr geom, int nSections);
 
 extern int
-XkbcAllocGeomOverlays(XkbSectionPtr section, int nOverlays);
+XkbcAllocGeomOverlays(XkbcSectionPtr section, int nOverlays);
 
 extern int
-XkbcAllocGeomOverlayRows(XkbOverlayPtr overlay, int nRows);
+XkbcAllocGeomOverlayRows(XkbcOverlayPtr overlay, int nRows);
 
 extern int
-XkbcAllocGeomOverlayKeys(XkbOverlayRowPtr row, int nKeys);
+XkbcAllocGeomOverlayKeys(XkbcOverlayRowPtr row, int nKeys);
 
 extern int
-XkbcAllocGeomDoodads(XkbGeometryPtr geom, int nDoodads);
+XkbcAllocGeomDoodads(XkbcGeometryPtr geom, int nDoodads);
 
 extern int
-XkbcAllocGeomSectionDoodads(XkbSectionPtr section, int nDoodads);
+XkbcAllocGeomSectionDoodads(XkbcSectionPtr section, int nDoodads);
 
 extern int
-XkbcAllocGeomOutlines(XkbShapePtr shape, int nOL);
+XkbcAllocGeomOutlines(XkbcShapePtr shape, int nOL);
 
 extern int
-XkbcAllocGeomRows(XkbSectionPtr section, int nRows);
+XkbcAllocGeomRows(XkbcSectionPtr section, int nRows);
 
 extern int
-XkbcAllocGeomPoints(XkbOutlinePtr ol, int nPts);
+XkbcAllocGeomPoints(XkbcOutlinePtr ol, int nPts);
 
 extern int
-XkbcAllocGeomKeys(XkbRowPtr row, int nKeys);
+XkbcAllocGeomKeys(XkbcRowPtr row, int nKeys);
 
 extern int
-XkbcAllocGeometry(XkbcDescPtr xkb, XkbGeometrySizesPtr sizes);
+XkbcAllocGeometry(XkbcDescPtr xkb, XkbcGeometrySizesPtr sizes);
 
-extern XkbPropertyPtr
-XkbcAddGeomProperty(XkbGeometryPtr geom, char *name, char *value);
+extern XkbcPropertyPtr
+XkbcAddGeomProperty(XkbcGeometryPtr geom, char *name, char *value);
 
 extern XkbKeyAliasPtr
-XkbcAddGeomKeyAlias(XkbGeometryPtr geom, char *aliasStr, char *realStr);
+XkbcAddGeomKeyAlias(XkbcGeometryPtr geom, char *aliasStr, char *realStr);
 
-extern XkbColorPtr
-XkbcAddGeomColor(XkbGeometryPtr geom, char *spec, unsigned int pixel);
+extern XkbcColorPtr
+XkbcAddGeomColor(XkbcGeometryPtr geom, char *spec, unsigned int pixel);
 
-extern XkbOutlinePtr
-XkbcAddGeomOutline(XkbShapePtr shape, int sz_points);
+extern XkbcOutlinePtr
+XkbcAddGeomOutline(XkbcShapePtr shape, int sz_points);
 
-extern XkbShapePtr
-XkbcAddGeomShape(XkbGeometryPtr geom, Atom name, int sz_outlines);
+extern XkbcShapePtr
+XkbcAddGeomShape(XkbcGeometryPtr geom, CARD32 name, int sz_outlines);
 
-extern XkbKeyPtr
-XkbcAddGeomKey(XkbRowPtr row);
+extern XkbcKeyPtr
+XkbcAddGeomKey(XkbcRowPtr row);
 
-extern XkbRowPtr
-XkbcAddGeomRow(XkbSectionPtr section, int sz_keys);
+extern XkbcRowPtr
+XkbcAddGeomRow(XkbcSectionPtr section, int sz_keys);
 
-extern XkbSectionPtr
-XkbcAddGeomSection(XkbGeometryPtr geom, Atom name,
+extern XkbcSectionPtr
+XkbcAddGeomSection(XkbcGeometryPtr geom, CARD32 name,
                    int sz_rows, int sz_doodads, int sz_over);
 
-extern XkbDoodadPtr
-XkbcAddGeomDoodad(XkbGeometryPtr geom, XkbSectionPtr section, Atom name);
+extern XkbcDoodadPtr
+XkbcAddGeomDoodad(XkbcGeometryPtr geom, XkbcSectionPtr section, CARD32 name);
 
-extern XkbOverlayKeyPtr
-XkbcAddGeomOverlayKey(XkbOverlayPtr overlay, XkbOverlayRowPtr row,
+extern XkbcOverlayKeyPtr
+XkbcAddGeomOverlayKey(XkbcOverlayPtr overlay, XkbcOverlayRowPtr row,
                       char *over, char *under);
 
-extern XkbOverlayRowPtr
-XkbcAddGeomOverlayRow(XkbOverlayPtr overlay, int row_under, int sz_keys);
+extern XkbcOverlayRowPtr
+XkbcAddGeomOverlayRow(XkbcOverlayPtr overlay, int row_under, int sz_keys);
 
-extern XkbOverlayPtr
-XkbcAddGeomOverlay(XkbSectionPtr section, Atom name, int sz_rows);
+extern XkbcOverlayPtr
+XkbcAddGeomOverlay(XkbcSectionPtr section, CARD32 name, int sz_rows);
 
 /***====================================================================***/
 
 extern Bool
-XkbcComputeShapeBounds(XkbShapePtr shape);
+XkbcComputeShapeBounds(XkbcShapePtr shape);
 
 extern Bool
-XkbcComputeShapeTop(XkbShapePtr shape, XkbBoundsPtr bounds);
+XkbcComputeShapeTop(XkbcShapePtr shape, XkbcBoundsPtr bounds);
 
 extern Bool
-XkbcComputeRowBounds(XkbGeometryPtr geom, XkbSectionPtr section, XkbRowPtr row);
+XkbcComputeRowBounds(XkbcGeometryPtr geom, XkbcSectionPtr section, XkbcRowPtr row);
 
 extern Bool
-XkbcComputeSectionBounds(XkbGeometryPtr geom, XkbSectionPtr section);
+XkbcComputeSectionBounds(XkbcGeometryPtr geom, XkbcSectionPtr section);
 
 #endif /* _XKBGEOM_H_ */
diff --git a/src/xkbmisc.h b/src/xkbmisc.h
index 028e90b..0ea61a2 100644
--- a/src/xkbmisc.h
+++ b/src/xkbmisc.h
@@ -36,7 +36,7 @@ authorization from the authors.
 /***====================================================================***/
 
 extern Bool
-XkbcComputeEffectiveMap(XkbcDescPtr xkb, XkbKeyTypePtr type,
+XkbcComputeEffectiveMap(XkbcDescPtr xkb, XkbcKeyTypePtr type,
                         unsigned char *map_rtrn);
 
 /***====================================================================***/