Commit 46e5e164d6611c88e422dcb9f3bae0b0d926a08c

Dan Nicholson 2009-03-28T12:39:21

Copy XkbAddGeom* functions from XKBlib These are needed by the geometry compiler in xkbcomp.

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
diff --git a/include/X11/extensions/XKBcommon.h b/include/X11/extensions/XKBcommon.h
index 502ede0..5e37ea4 100644
--- a/include/X11/extensions/XKBcommon.h
+++ b/include/X11/extensions/XKBcommon.h
@@ -191,6 +191,44 @@ XkbcAllocGeomKeys(XkbRowPtr row, int nKeys);
 extern int
 XkbcAllocGeometry(XkbcDescPtr xkb, XkbGeometrySizesPtr sizes);
 
+extern XkbPropertyPtr
+XkbcAddGeomProperty(XkbGeometryPtr geom, char *name, char *value);
+
+extern XkbKeyAliasPtr
+XkbcAddGeomKeyAlias(XkbGeometryPtr geom, char *aliasStr, char *realStr);
+
+extern XkbColorPtr
+XkbcAddGeomColor(XkbGeometryPtr geom, char *spec, unsigned int pixel);
+
+extern XkbOutlinePtr
+XkbcAddGeomOutline(XkbShapePtr shape, int sz_points);
+
+extern XkbShapePtr
+XkbcAddGeomShape(XkbGeometryPtr geom, Atom name, int sz_outlines);
+
+extern XkbKeyPtr
+XkbcAddGeomKey(XkbRowPtr row);
+
+extern XkbRowPtr
+XkbcAddGeomRow(XkbSectionPtr section, int sz_keys);
+
+extern XkbSectionPtr
+XkbcAddGeomSection(XkbGeometryPtr geom, Atom name,
+                   int sz_rows, int sz_doodads, int sz_over);
+
+extern XkbDoodadPtr
+XkbcAddGeomDoodad(XkbGeometryPtr geom, XkbSectionPtr section, Atom name);
+
+extern XkbOverlayKeyPtr
+XkbcAddGeomOverlayKey(XkbOverlayPtr overlay, XkbOverlayRowPtr row,
+                      char *over, char *under);
+
+extern XkbOverlayRowPtr
+XkbcAddGeomOverlayRow(XkbOverlayPtr overlay, int row_under, int sz_keys);
+
+extern XkbOverlayPtr
+XkbcAddGeomOverlay(XkbSectionPtr section, Atom name, int sz_rows);
+
 extern void
 XkbcInitAtoms(void);
 
diff --git a/src/galloc.c b/src/galloc.c
index ad8946d..49af81b 100644
--- a/src/galloc.c
+++ b/src/galloc.c
@@ -603,3 +603,346 @@ bail:
     xkb->geom = NULL;
     return rtrn;
 }
+
+XkbPropertyPtr
+XkbcAddGeomProperty(XkbGeometryPtr geom,char *name,char *value)
+{
+register int i;
+register XkbPropertyPtr prop;
+
+    if ((!geom)||(!name)||(!value))
+	return NULL;
+    for (i=0,prop=geom->properties;i<geom->num_properties;i++,prop++) {
+	if ((prop->name)&&(strcmp(name,prop->name)==0)) {
+	    if (prop->value)
+		_XkbFree(prop->value);
+	    prop->value= (char *)_XkbAlloc(strlen(value)+1);
+	    if (prop->value)
+		strcpy(prop->value,value);
+	    return prop;
+	}
+    }
+    if ((geom->num_properties>=geom->sz_properties)&&
+					(_XkbAllocProps(geom,1)!=Success)) {
+	return NULL;
+    }
+    prop= &geom->properties[geom->num_properties];
+    prop->name= (char *)_XkbAlloc(strlen(name)+1);
+    if (!name)
+	return NULL;
+    strcpy(prop->name,name);
+    prop->value= (char *)_XkbAlloc(strlen(value)+1);
+    if (!value) {
+	_XkbFree(prop->name);
+	prop->name= NULL;
+	return NULL;
+    }
+    strcpy(prop->value,value);
+    geom->num_properties++;
+    return prop;
+}
+
+XkbKeyAliasPtr
+XkbcAddGeomKeyAlias(XkbGeometryPtr geom,char *aliasStr,char *realStr)
+{
+register int i;
+register XkbKeyAliasPtr alias;
+
+    if ((!geom)||(!aliasStr)||(!realStr)||(!aliasStr[0])||(!realStr[0]))
+	return NULL;
+    for (i=0,alias=geom->key_aliases;i<geom->num_key_aliases;i++,alias++) {
+	if (strncmp(alias->alias,aliasStr,XkbKeyNameLength)==0) {
+	    bzero(alias->real,XkbKeyNameLength);
+	    strncpy(alias->real,realStr,XkbKeyNameLength);
+	    return alias;
+	}
+    }
+    if ((geom->num_key_aliases>=geom->sz_key_aliases)&&
+				(_XkbAllocKeyAliases(geom,1)!=Success)) {
+	return NULL;
+    }
+    alias= &geom->key_aliases[geom->num_key_aliases];
+    bzero(alias,sizeof(XkbKeyAliasRec));
+    strncpy(alias->alias,aliasStr,XkbKeyNameLength);
+    strncpy(alias->real,realStr,XkbKeyNameLength);
+    geom->num_key_aliases++;
+    return alias;
+}
+
+XkbColorPtr
+XkbcAddGeomColor(XkbGeometryPtr geom,char *spec,unsigned int pixel)
+{
+register int i;
+register XkbColorPtr color;
+
+    if ((!geom)||(!spec))
+	return NULL;
+    for (i=0,color=geom->colors;i<geom->num_colors;i++,color++) {
+	if ((color->spec)&&(strcmp(color->spec,spec)==0)) {
+	    color->pixel= pixel;
+	    return color;
+	}
+    }
+    if ((geom->num_colors>=geom->sz_colors)&&
+					(_XkbAllocColors(geom,1)!=Success)) {
+	return NULL;
+    }
+    color= &geom->colors[geom->num_colors];
+    color->pixel= pixel;
+    color->spec= (char *)_XkbAlloc(strlen(spec)+1);
+    if (!color->spec)
+	return NULL;
+    strcpy(color->spec,spec);
+    geom->num_colors++;
+    return color;
+}
+
+XkbOutlinePtr
+XkbcAddGeomOutline(XkbShapePtr shape,int sz_points)
+{
+XkbOutlinePtr	outline;
+
+    if ((!shape)||(sz_points<0))
+	return NULL;
+    if ((shape->num_outlines>=shape->sz_outlines)&&
+					(_XkbAllocOutlines(shape,1)!=Success)) {
+	return NULL;
+    }
+    outline= &shape->outlines[shape->num_outlines];
+    bzero(outline,sizeof(XkbOutlineRec));
+    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)
+{
+XkbShapePtr	shape;
+register int	i;
+
+    if ((!geom)||(!name)||(sz_outlines<0))
+	return NULL;
+    if (geom->num_shapes>0) {
+	for (shape=geom->shapes,i=0;i<geom->num_shapes;i++,shape++) {
+	    if (name==shape->name)
+		return shape;
+	}
+    }
+    if ((geom->num_shapes>=geom->sz_shapes)&&
+					(_XkbAllocShapes(geom,1)!=Success))
+	return NULL;
+    shape= &geom->shapes[geom->num_shapes];
+    bzero(shape,sizeof(XkbShapeRec));
+    if ((sz_outlines>0)&&(_XkbAllocOutlines(shape,sz_outlines)!=Success))
+	return NULL;
+    shape->name= name;
+    shape->primary= shape->approx= NULL;
+    geom->num_shapes++;
+    return shape;
+}
+
+XkbKeyPtr
+XkbcAddGeomKey(XkbRowPtr row)
+{
+XkbKeyPtr	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));
+    return key;
+}
+
+XkbRowPtr
+XkbcAddGeomRow(XkbSectionPtr section,int sz_keys)
+{
+XkbRowPtr	row;
+
+    if ((!section)||(sz_keys<0))
+	return NULL;
+    if ((section->num_rows>=section->sz_rows)&&
+    					(_XkbAllocRows(section,1)!=Success))
+	return NULL;
+    row= &section->rows[section->num_rows];
+    bzero(row,sizeof(XkbRowRec));
+    if ((sz_keys>0)&&(_XkbAllocKeys(row,sz_keys)!=Success))
+	return NULL;
+    section->num_rows++;
+    return row;
+}
+
+XkbSectionPtr
+XkbcAddGeomSection(	XkbGeometryPtr	geom,
+			Atom		name,
+			int		sz_rows,
+			int		sz_doodads,
+			int		sz_over)
+{
+register int	i;
+XkbSectionPtr	section;
+
+    if ((!geom)||(name==None)||(sz_rows<0))
+	return NULL;
+    for (i=0,section=geom->sections;i<geom->num_sections;i++,section++) {
+	if (section->name!=name)
+	    continue;
+	if (((sz_rows>0)&&(_XkbAllocRows(section,sz_rows)!=Success))||
+	    ((sz_doodads>0)&&(_XkbAllocDoodads(section,sz_doodads)!=Success))||
+	    ((sz_over>0)&&(_XkbAllocOverlays(section,sz_over)!=Success)))
+	    return NULL;
+	return section;
+    }
+    if ((geom->num_sections>=geom->sz_sections)&&
+					(_XkbAllocSections(geom,1)!=Success))
+	return NULL;
+    section= &geom->sections[geom->num_sections];
+    if ((sz_rows>0)&&(_XkbAllocRows(section,sz_rows)!=Success))
+	return NULL;
+    if ((sz_doodads>0)&&(_XkbAllocDoodads(section,sz_doodads)!=Success)) {
+	if (section->rows) {
+	    _XkbFree(section->rows);
+	    section->rows= NULL;
+	    section->sz_rows= section->num_rows= 0;
+	}
+	return NULL;
+    }
+    section->name= name;
+    geom->num_sections++;
+    return section;
+}
+
+XkbDoodadPtr
+XkbcAddGeomDoodad(XkbGeometryPtr geom,XkbSectionPtr section,Atom name)
+{
+XkbDoodadPtr	old,doodad;
+register int	i,nDoodads;
+
+    if ((!geom)||(name==None))
+	return NULL;
+    if ((section!=NULL)&&(section->num_doodads>0)) {
+	old= section->doodads;
+	nDoodads= section->num_doodads;
+    }
+    else {
+	old= geom->doodads;
+	nDoodads= geom->num_doodads;
+    }
+    for (i=0,doodad=old;i<nDoodads;i++,doodad++) {
+	if (doodad->any.name==name)
+	    return doodad;
+    }
+    if (section) {
+	if ((section->num_doodads>=geom->sz_doodads)&&
+	    (_XkbAllocDoodads(section,1)!=Success)) {
+	    return NULL;
+	}
+	doodad= &section->doodads[section->num_doodads++];
+    }
+    else {
+	if ((geom->num_doodads>=geom->sz_doodads)&&
+					(_XkbAllocDoodads(geom,1)!=Success))
+	    return NULL;
+	doodad= &geom->doodads[geom->num_doodads++];
+    }
+    bzero(doodad,sizeof(XkbDoodadRec));
+    doodad->any.name= name;
+    return doodad;
+}
+
+XkbOverlayKeyPtr
+XkbcAddGeomOverlayKey(	XkbOverlayPtr		overlay,
+			XkbOverlayRowPtr 	row,
+			char *			over,
+			char *			under)
+{
+register int	i;
+XkbOverlayKeyPtr key;
+XkbSectionPtr	section;
+XkbRowPtr	row_under;
+Bool		found;
+
+    if ((!overlay)||(!row)||(!over)||(!under))
+	return NULL;
+    section= overlay->section_under;
+    if (row->row_under>=section->num_rows)
+	return NULL;
+    row_under= &section->rows[row->row_under];
+    for (i=0,found=False;i<row_under->num_keys;i++) {
+	if (strncmp(under,row_under->keys[i].name.name,XkbKeyNameLength)==0) {
+	    found= True;
+	    break;
+	}
+    }
+    if (!found)
+   	return NULL;
+    if ((row->num_keys>=row->sz_keys)&&(_XkbAllocOverlayKeys(row,1)!=Success))
+	return NULL;
+    key= &row->keys[row->num_keys];
+    strncpy(key->under.name,under,XkbKeyNameLength);
+    strncpy(key->over.name,over,XkbKeyNameLength);
+    row->num_keys++;
+    return key;
+}
+
+XkbOverlayRowPtr
+XkbcAddGeomOverlayRow(XkbOverlayPtr overlay,int row_under,int sz_keys)
+{
+register int		i;
+XkbOverlayRowPtr	row;
+
+    if ((!overlay)||(sz_keys<0))
+	return NULL;
+    if (row_under>=overlay->section_under->num_rows)
+	return NULL;
+    for (i=0;i<overlay->num_rows;i++) {
+	if (overlay->rows[i].row_under==row_under) {
+	    row= &overlay->rows[i];
+	    if ((row->sz_keys<sz_keys)&&
+				(_XkbAllocOverlayKeys(row,sz_keys)!=Success)) {
+		return NULL;
+	    }
+	    return &overlay->rows[i];
+	}
+    }
+    if ((overlay->num_rows>=overlay->sz_rows)&&
+				(_XkbAllocOverlayRows(overlay,1)!=Success))
+	return NULL;
+    row= &overlay->rows[overlay->num_rows];
+    bzero(row,sizeof(XkbOverlayRowRec));
+    if ((sz_keys>0)&&(_XkbAllocOverlayKeys(row,sz_keys)!=Success))
+	return NULL;
+    row->row_under= row_under;
+    overlay->num_rows++;
+    return row;
+}
+
+XkbOverlayPtr
+XkbcAddGeomOverlay(XkbSectionPtr section,Atom name,int sz_rows)
+{
+register int	i;
+XkbOverlayPtr	overlay;
+
+    if ((!section)||(name==None)||(sz_rows==0))
+	return NULL;
+
+    for (i=0,overlay=section->overlays;i<section->num_overlays;i++,overlay++) {
+	if (overlay->name==name) {
+	    if ((sz_rows>0)&&(_XkbAllocOverlayRows(overlay,sz_rows)!=Success))
+		return NULL;
+	    return overlay;
+	}
+    }
+    if ((section->num_overlays>=section->sz_overlays)&&
+				(_XkbAllocOverlays(section,1)!=Success))
+	return NULL;
+    overlay= &section->overlays[section->num_overlays];
+    if ((sz_rows>0)&&(_XkbAllocOverlayRows(overlay,sz_rows)!=Success))
+	return NULL;
+    overlay->name= name;
+    overlay->section_under= section;
+    section->num_overlays++;
+    return overlay;
+}
diff --git a/src/xkbcomp/geometry.c b/src/xkbcomp/geometry.c
index 298872a..c73e580 100644
--- a/src/xkbcomp/geometry.c
+++ b/src/xkbcomp/geometry.c
@@ -2887,7 +2887,7 @@ CopyShapeDef(XkbGeometryPtr geom, ShapeInfo * si)
 
     si->index = geom->num_shapes;
     name = XkbcInternAtom(XkbcAtomGetString(si->name), False);
-    shape = XkbAddGeomShape(geom, name, si->nOutlines);
+    shape = XkbcAddGeomShape(geom, name, si->nOutlines);
     if (!shape)
     {
         WSGO("Couldn't allocate shape in geometry\n");
@@ -2897,7 +2897,7 @@ CopyShapeDef(XkbGeometryPtr geom, ShapeInfo * si)
     old_outline = si->outlines;
     for (i = 0; i < si->nOutlines; i++, old_outline++)
     {
-        outline = XkbAddGeomOutline(shape, old_outline->num_points);
+        outline = XkbcAddGeomOutline(shape, old_outline->num_points);
         if (!outline)
         {
             WSGO("Couldn't allocate outline in shape\n");
@@ -3260,7 +3260,7 @@ CopyDoodadDef(XkbGeometryPtr geom,
     if (!VerifyDoodadInfo(di, info))
         return False;
     name = XkbcInternAtom(XkbcAtomGetString(di->name), False);
-    doodad = XkbAddGeomDoodad(geom, section, name);
+    doodad = XkbcAddGeomDoodad(geom, section, name);
     if (!doodad)
     {
         WSGO1("Couldn't allocate doodad in %s\n",
@@ -3281,7 +3281,7 @@ CopyDoodadDef(XkbGeometryPtr geom,
             return False;
         doodad->shape.angle = di->angle;
         color =
-            XkbAddGeomColor(geom, XkbcAtomGetString(di->color),
+            XkbcAddGeomColor(geom, XkbcAtomGetString(di->color),
                             geom->num_colors);
         shape = &geom->shapes[si->index];
         XkbSetShapeDoodadColor(geom, &doodad->shape, color);
@@ -3301,7 +3301,7 @@ CopyDoodadDef(XkbGeometryPtr geom,
             doodad->text.font = XkbcAtomGetString(di->fontSpec);
         doodad->text.text = XkbcAtomGetString(di->text);
         color =
-            XkbAddGeomColor(geom, XkbcAtomGetString(di->color),
+            XkbcAddGeomColor(geom, XkbcAtomGetString(di->color),
                             geom->num_colors);
         XkbSetTextDoodadColor(geom, &doodad->text, color);
         break;
@@ -3311,12 +3311,12 @@ CopyDoodadDef(XkbGeometryPtr geom,
             return False;
         shape = &geom->shapes[si->index];
         color =
-            XkbAddGeomColor(geom, XkbcAtomGetString(di->color),
+            XkbcAddGeomColor(geom, XkbcAtomGetString(di->color),
                             geom->num_colors);
         XkbSetIndicatorDoodadShape(geom, &doodad->indicator, shape);
         XkbSetIndicatorDoodadOnColor(geom, &doodad->indicator, color);
         color =
-            XkbAddGeomColor(geom, XkbcAtomGetString(di->offColor),
+            XkbcAddGeomColor(geom, XkbcAtomGetString(di->offColor),
                             geom->num_colors);
         XkbSetIndicatorDoodadOffColor(geom, &doodad->indicator, color);
         break;
@@ -3326,7 +3326,7 @@ CopyDoodadDef(XkbGeometryPtr geom,
             return False;
         doodad->logo.angle = di->angle;
         color =
-            XkbAddGeomColor(geom, XkbcAtomGetString(di->color),
+            XkbcAddGeomColor(geom, XkbcAtomGetString(di->color),
                             geom->num_colors);
         shape = &geom->shapes[si->index];
         XkbSetLogoDoodadColor(geom, &doodad->logo, color);
@@ -3452,7 +3452,7 @@ CopyOverlayDef(XkbGeometryPtr geom,
     if (!VerifyOverlayInfo(geom, section, oi, info, rowMap, rowSize))
         return False;
     name = XkbcInternAtom(XkbcAtomGetString(oi->name), False);
-    ol = XkbAddGeomOverlay(section, name, oi->nRows);
+    ol = XkbcAddGeomOverlay(section, name, oi->nRows);
     if (!ol)
     {
         WSGO2("Couldn't add overlay \"%s\" to section \"%s\"\n",
@@ -3468,7 +3468,7 @@ CopyOverlayDef(XkbGeometryPtr geom,
             if (rowMap[tmp] == i)
                 row_under = tmp;
         }
-        if (!XkbAddGeomOverlayRow(ol, row_under, rowSize[i]))
+        if (!XkbcAddGeomOverlayRow(ol, row_under, rowSize[i]))
         {
             WSGO3
                 ("Can't add row %d to overlay \"%s\" of section \"%s\"\n",
@@ -3501,7 +3501,7 @@ CopySectionDef(XkbGeometryPtr geom, SectionInfo * si, GeometryInfo * info)
 
     name = XkbcInternAtom(XkbcAtomGetString(si->name), False);
     section =
-        XkbAddGeomSection(geom, name, si->nRows, si->nDoodads, si->nOverlays);
+        XkbcAddGeomSection(geom, name, si->nRows, si->nDoodads, si->nOverlays);
     if (section == NULL)
     {
         WSGO("Couldn't allocate section in geometry\n");
@@ -3516,7 +3516,7 @@ CopySectionDef(XkbGeometryPtr geom, SectionInfo * si, GeometryInfo * info)
     section->priority = si->priority;
     for (ri = si->rows; ri != NULL; ri = (RowInfo *) ri->defs.next)
     {
-        row = XkbAddGeomRow(section, ri->nKeys);
+        row = XkbcAddGeomRow(section, ri->nKeys);
         if (row == NULL)
         {
             WSGO("Couldn't allocate row in section\n");
@@ -3536,7 +3536,7 @@ CopySectionDef(XkbGeometryPtr geom, SectionInfo * si, GeometryInfo * info)
                 ACTION1("Section %s ignored\n", scText(si));
                 return False;
             }
-            key = XkbAddGeomKey(row);
+            key = XkbcAddGeomKey(row);
             if (key == NULL)
             {
                 WSGO("Couldn't allocate key in row\n");
@@ -3557,11 +3557,11 @@ CopySectionDef(XkbGeometryPtr geom, SectionInfo * si, GeometryInfo * info)
             }
             if (ki->color != None)
                 color =
-                    XkbAddGeomColor(geom,
+                    XkbcAddGeomColor(geom,
                                     XkbcAtomGetString(ki->color),
                                     geom->num_colors);
             else
-                color = XkbAddGeomColor(geom, "white", geom->num_colors);
+                color = XkbcAddGeomColor(geom, "white", geom->num_colors);
             XkbSetKeyColor(geom, key, color);
         }
     }
@@ -3640,18 +3640,18 @@ CompileGeometry(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
                                              info.fontVariant,
                                              info.fontSize,
                                              info.fontEncoding);
-        XkbAddGeomColor(geom, "black", geom->num_colors);
-        XkbAddGeomColor(geom, "white", geom->num_colors);
+        XkbcAddGeomColor(geom, "black", geom->num_colors);
+        XkbcAddGeomColor(geom, "white", geom->num_colors);
 
         if (info.baseColor == None)
             info.baseColor = XkbcInternAtom("white", False);
         if (info.labelColor == None)
             info.labelColor = XkbcInternAtom("black", False);
         geom->base_color =
-            XkbAddGeomColor(geom, XkbcAtomGetString(info.baseColor),
+            XkbcAddGeomColor(geom, XkbcAtomGetString(info.baseColor),
                             geom->num_colors);
         geom->label_color =
-            XkbAddGeomColor(geom, XkbcAtomGetString(info.labelColor),
+            XkbcAddGeomColor(geom, XkbcAtomGetString(info.labelColor),
                             geom->num_colors);
 
         if (info.props)
@@ -3660,7 +3660,7 @@ CompileGeometry(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
             for (pi = info.props; pi != NULL;
                  pi = (PropertyInfo *) pi->defs.next)
             {
-                if (!XkbAddGeomProperty(geom, pi->name, pi->value))
+                if (!XkbcAddGeomProperty(geom, pi->name, pi->value))
                     return False;
             }
         }