Remove geometry support, again
authorDaniel Stone <daniel@fooishbar.org>
Fri, 9 Mar 2012 16:26:34 +0000 (16:26 +0000)
committerDaniel Stone <daniel@fooishbar.org>
Fri, 9 Mar 2012 19:30:30 +0000 (19:30 +0000)
It still parses geometry, but happily throws it away.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
27 files changed:
include/xkbcommon/xkbcommon.h
src/Makefile.am
src/XKBcommonint.h
src/alloc.c
src/galloc.c [deleted file]
src/maprules.c
src/text.c
src/xkb.c
src/xkbcomp/Makefile.am
src/xkbcomp/alias.c
src/xkbcomp/alias.h
src/xkbcomp/geometry.c [deleted file]
src/xkbcomp/keycodes.c
src/xkbcomp/keymap.c
src/xkbcomp/listing.c
src/xkbcomp/misc.c
src/xkbcomp/parseutils.c
src/xkbcomp/symbols.c
src/xkbcomp/xkbcomp.c
src/xkbcomp/xkbcomp.h
src/xkbcomp/xkbparse.y
src/xkbgeom.h [deleted file]
src/xkbmisc.h
test/canonicalise.c
test/canonicalise.sh
test/namescomp.c
test/namescomp.sh

index f20c2b9..ebe9674 100644 (file)
@@ -340,243 +340,6 @@ struct xkb_names {
     unsigned short    num_rg;
 };
 
-struct xkb_property {
-       char    *name;
-       char    *value;
-};
-
-struct xkb_color {
-       unsigned int    pixel;
-       char *          spec;
-};
-
-struct xkb_point {
-       short   x;
-       short   y;
-};
-
-struct xkb_bounds {
-       short   x1,y1;
-       short   x2,y2;
-};
-
-struct xkb_outline {
-       unsigned short  num_points;
-       unsigned short  sz_points;
-       unsigned short  corner_radius;
-       struct xkb_point *      points;
-};
-
-struct xkb_shape {
-       uint32_t                 name;
-       unsigned short   num_outlines;
-       unsigned short   sz_outlines;
-       struct xkb_outline *     outlines;
-       struct xkb_outline *     approx;
-       struct xkb_outline *     primary;
-       struct xkb_bounds        bounds;
-};
-
-struct xkb_shape_doodad {
-       uint32_t                 name;
-       unsigned char    type;
-       unsigned char    priority;
-       short            top;
-       short            left;
-       short            angle;
-       unsigned short   color_ndx;
-       unsigned short   shape_ndx;
-};
-#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])
-
-struct xkb_text_doodad {
-       uint32_t                 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;
-};
-#define        XkbTextDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
-#define        XkbSetTextDoodadColor(g,d,c)    ((d)->color_ndx= (c)-&(g)->colors[0])
-
-struct xkb_indicator_doodad {
-       uint32_t                 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;
-};
-#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])
-
-struct xkb_logo_doodad {
-       uint32_t                 name;
-       unsigned char    type;
-       unsigned char    priority;
-       short            top;
-       short            left;
-       short            angle;
-       unsigned short   color_ndx;
-       unsigned short   shape_ndx;
-       char *           logo_name;
-};
-#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])
-
-struct xkb_any_doodad {
-       uint32_t                 name;
-       unsigned char    type;
-       unsigned char    priority;
-       short            top;
-       short            left;
-       short            angle;
-};
-
-union xkb_doodad {
-       struct xkb_any_doodad   any;
-       struct xkb_shape_doodad shape;
-       struct xkb_text_doodad  text;
-       struct xkb_indicator_doodad     indicator;
-       struct xkb_logo_doodad  logo;
-};
-
-#define        XkbUnknownDoodad        0
-#define        XkbOutlineDoodad        1
-#define        XkbSolidDoodad          2
-#define        XkbTextDoodad           3
-#define        XkbIndicatorDoodad      4
-#define        XkbLogoDoodad           5
-
-struct xkb_key {
-       struct xkb_key_name      name;
-       short            gap;
-       unsigned char    shape_ndx;
-       unsigned char    color_ndx;
-};
-#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])
-
-struct xkb_row {
-       short           top;
-       short           left;
-       unsigned short  num_keys;
-       unsigned short  sz_keys;
-       int             vertical;
-       struct xkb_key *        keys;
-       struct xkb_bounds       bounds;
-};
-
-struct xkb_section {
-       uint32_t                 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;
-       struct xkb_row *         rows;
-       union xkb_doodad *       doodads;
-       struct xkb_bounds        bounds;
-       struct xkb_overlay *overlays;
-};
-
-struct xkb_overlay_key {
-       struct xkb_key_name     over;
-       struct xkb_key_name     under;
-};
-
-struct xkb_overlay_row {
-       unsigned short          row_under;
-       unsigned short          num_keys;
-       unsigned short          sz_keys;
-       struct xkb_overlay_key *        keys;
-};
-
-struct xkb_overlay {
-       uint32_t                        name;
-       struct xkb_section *            section_under;
-       unsigned short          num_rows;
-       unsigned short          sz_rows;
-       struct xkb_overlay_row *        rows;
-       struct xkb_bounds *             bounds;
-};
-
-struct xkb_geometry {
-       uint32_t                 name;
-       unsigned short   width_mm;
-       unsigned short   height_mm;
-       char *           label_font;
-       struct xkb_color *       label_color;
-       struct xkb_color *       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;
-       struct xkb_property *    properties;
-       struct xkb_color *       colors;
-       struct xkb_shape *       shapes;
-       struct xkb_section *     sections;
-       union xkb_doodad *       doodads;
-       struct xkb_key_alias *   key_aliases;
-};
-#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)
-
-struct xkb_geometry_sizes {
-       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;
-};
-
 struct xkb_controls {
        unsigned char   mk_dflt_btn;
        unsigned char   num_groups;
@@ -616,7 +379,6 @@ struct xkb_desc {
     struct xkb_indicator *     indicators;
     struct xkb_names *        names;
     struct xkb_compat_map *    compat;
-    struct xkb_geometry *     geom;
 };
 
 #define        XkbKeyKeyTypeIndex(d,k,g)       (XkbCMKeyTypeIndex((d)->map,k,g))
@@ -712,7 +474,6 @@ struct xkb_component_names {
        char *                   types;
        char *                   compat;
        char *                   symbols;
-       char *                   geometry;
 };
 
 struct xkb_component_name {
@@ -726,13 +487,11 @@ struct xkb_component_list {
        int                     num_types;
        int                     num_compat;
        int                     num_symbols;
-       int                     num_geometry;
        struct xkb_component_name *     keymaps;
        struct xkb_component_name *     keycodes;
        struct xkb_component_name *     types;
        struct xkb_component_name *     compat;
        struct xkb_component_name *     symbols;
-       struct xkb_component_name *     geometry;
 };
 
 struct xkb_state {
index 9df6f81..bb40445 100644 (file)
@@ -10,8 +10,6 @@ libxkbcommon_la_SOURCES = \
        XKBcommonint.h \
        alloc.c \
        atom.c \
-       galloc.c \
-       geom.c \
        keysym.c \
        malloc.c \
        maprules.c \
@@ -19,7 +17,6 @@ libxkbcommon_la_SOURCES = \
        text.c \
        xkb.c \
        xkballoc.h \
-       xkbgeom.h \
        xkbmisc.h \
        xkbrules.h
 
index 41e0a08..3f83277 100644 (file)
@@ -68,13 +68,13 @@ authorization from the authors.
 #define        XkmSymbolsMask          (1<<2)
 #define        XkmIndicatorsMask       (1<<3)
 #define        XkmKeyNamesMask         (1<<4)
-#define        XkmGeometryMask         (1<<5)
+#define XkmGeometryMask         (1<<5)
 #define        XkmVirtualModsMask      (1<<6)
 #define        XkmLegalIndexMask       (0x7f)
 #define        XkmAllIndicesMask       (0x7f)
 
 #define        XkmSemanticsRequired    (XkmCompatMapMask)
-#define        XkmSemanticsOptional    (XkmTypesMask|XkmVirtualModsMask|XkmIndicatorsMask)
+#define        XkmSemanticsOptional    (XkmTypesMask|XkmVirtualModsMask|XkmIndicatorsMask|XkmGeometryMask)
 #define        XkmSemanticsLegal       (XkmSemanticsRequired|XkmSemanticsOptional)
 #define        XkmLayoutRequired       (XkmKeyNamesMask|XkmSymbolsMask|XkmTypesMask)
 #define        XkmLayoutOptional       (XkmVirtualModsMask|XkmGeometryMask)
index de15031..84bb9e1 100644 (file)
@@ -27,7 +27,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include <config.h>
 #endif
 #include "xkballoc.h"
-#include "xkbgeom.h"
 #include "xkbcommon/xkbcommon.h"
 #include "XKBcommonint.h"
 #include <X11/extensions/XKB.h>
@@ -273,7 +272,6 @@ XkbcFreeKeyboard(struct xkb_desc * xkb)
     XkbcFreeCompatMap(xkb);
     XkbcFreeIndicatorMaps(xkb);
     XkbcFreeNames(xkb);
-    XkbcFreeGeometry(xkb);
     XkbcFreeControls(xkb);
     free(xkb);
 }
diff --git a/src/galloc.c b/src/galloc.c
deleted file mode 100644 (file)
index 34304cb..0000000
+++ /dev/null
@@ -1,618 +0,0 @@
-/*
-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.
-*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "xkbgeom.h"
-#include "xkbcommon/xkbcommon.h"
-#include "XKBcommonint.h"
-#include <X11/extensions/XKB.h>
-
-typedef void (*ContentsClearFunc)(void *priv);
-
-static void
-_XkbFreeGeomNonLeafElems(unsigned short *num_inout, unsigned short *sz_inout,
-                         void *elems, size_t elem_sz,
-                         ContentsClearFunc freeFunc)
-{
-    int i;
-    char *start, *ptr;
-
-    if (!elems)
-        return;
-
-    start = *(char **)elems;
-    if (!start)
-        return;
-
-    ptr = start;
-    for (i = 0; i < *num_inout; i++) {
-        freeFunc(ptr);
-        ptr += elem_sz;
-    }
-
-    *num_inout = *sz_inout = 0;
-    free(start);
-}
-
-static void
-_XkbClearProperty(void *prop_in)
-{
-    struct xkb_property * prop = prop_in;
-
-    free(prop->name);
-    prop->name = NULL;
-    free(prop->value);
-    prop->value = NULL;
-}
-
-static void
-XkbcFreeGeomProperties(struct xkb_geometry * geom)
-{
-    _XkbFreeGeomNonLeafElems(&geom->num_properties, &geom->sz_properties,
-                             &geom->properties, sizeof(struct xkb_property),
-                             _XkbClearProperty);
-}
-
-static void
-_XkbClearColor(void *color_in)
-{
-    struct xkb_color * color = color_in;
-
-    free(color->spec);
-}
-
-static void
-XkbcFreeGeomColors(struct xkb_geometry * geom)
-{
-    _XkbFreeGeomNonLeafElems(&geom->num_colors, &geom->sz_colors,
-                             &geom->colors, sizeof(struct xkb_color),
-                             _XkbClearColor);
-}
-
-static void
-_XkbClearOutline(void *outline_in)
-{
-    struct xkb_outline * outline = outline_in;
-
-    free(outline->points);
-}
-
-static void
-XkbcFreeGeomOutlines(struct xkb_shape * shape)
-{
-    _XkbFreeGeomNonLeafElems(&shape->num_outlines, &shape->sz_outlines,
-                             &shape->outlines, sizeof(struct xkb_outline),
-                             _XkbClearOutline);
-}
-
-static void
-_XkbClearShape(void *shape_in)
-{
-    struct xkb_shape * shape = shape_in;
-
-    XkbcFreeGeomOutlines(shape);
-}
-
-static void
-XkbcFreeGeomShapes(struct xkb_geometry * geom)
-{
-    _XkbFreeGeomNonLeafElems(&geom->num_shapes, &geom->sz_shapes,
-                             &geom->shapes, sizeof(struct xkb_shape),
-                             _XkbClearShape);
-}
-
-static void
-_XkbClearRow(void *row_in)
-{
-    struct xkb_row * row = row_in;
-
-    free(row->keys);
-}
-
-static void
-XkbcFreeGeomRows(struct xkb_section * section)
-{
-    _XkbFreeGeomNonLeafElems(&section->num_rows, &section->sz_rows,
-                             &section->rows, sizeof(struct xkb_row),
-                             _XkbClearRow);
-}
-
-static void
-_XkbClearDoodad(union xkb_doodad *doodad)
-{
-    switch (doodad->any.type) {
-    case XkbTextDoodad:
-        free(doodad->text.text);
-        doodad->text.text = NULL;
-        free(doodad->text.font);
-        doodad->text.font = NULL;
-        break;
-
-    case XkbLogoDoodad:
-        free(doodad->logo.logo_name);
-        doodad->logo.logo_name = NULL;
-        break;
-    }
-}
-
-static void
-XkbcFreeGeomDoodads(union xkb_doodad * doodads, int nDoodads)
-{
-    int i;
-    union xkb_doodad * doodad;
-
-    for (i = 0, doodad = doodads; i < nDoodads && doodad; i++, doodad++)
-        _XkbClearDoodad(doodad);
-    free(doodads);
-}
-
-static void
-_XkbClearSection(void *section_in)
-{
-    struct xkb_section * section = section_in;
-
-    XkbcFreeGeomRows(section);
-    XkbcFreeGeomDoodads(section->doodads, section->num_doodads);
-    section->doodads = NULL;
-}
-
-static void
-XkbcFreeGeomSections(struct xkb_geometry * geom)
-{
-    _XkbFreeGeomNonLeafElems(&geom->num_sections, &geom->sz_sections,
-                             &geom->sections, sizeof(struct xkb_section),
-                             _XkbClearSection);
-}
-
-void
-XkbcFreeGeometry(struct xkb_desc * xkb)
-{
-    struct xkb_geometry *geom;
-
-    if (!xkb || !xkb->geom)
-        return;
-
-    geom = xkb->geom;
-
-    XkbcFreeGeomProperties(geom);
-    XkbcFreeGeomColors(geom);
-    XkbcFreeGeomShapes(geom);
-    XkbcFreeGeomSections(geom);
-    XkbcFreeGeomDoodads(geom->doodads, geom->num_doodads);
-    free(geom->key_aliases);
-    free(geom->label_font);
-    free(geom);
-}
-
-static int
-_XkbGeomAlloc(char **old, unsigned short *num, unsigned short *total,
-              int num_new, size_t sz_elem)
-{
-    if (num_new < 1)
-        return Success;
-
-    if (!(*old))
-        *num = *total = 0;
-
-    if ((*num) + num_new <= (*total))
-        return Success;
-
-    *total = (*num) + num_new;
-
-    if (*old)
-        *old = realloc(*old, (*total) * sz_elem);
-    else
-        *old = calloc(*total, sz_elem);
-    if (!(*old)) {
-        *total = *num = 0;
-        return BadAlloc;
-    }
-
-    if (*num > 0) {
-        char *tmp = *old;
-        memset(&tmp[sz_elem * (*num)], 0, num_new * sz_elem);
-    }
-
-    return Success;
-}
-
-#define _XkbAllocProps(g, n)    _XkbGeomAlloc((char **)&(g)->properties, \
-                                              &(g)->num_properties, \
-                                              &(g)->sz_properties, \
-                                              (n), sizeof(struct xkb_property))
-#define _XkbAllocColors(g, n)   _XkbGeomAlloc((char **)&(g)->colors, \
-                                              &(g)->num_colors, \
-                                              &(g)->sz_colors, \
-                                              (n), sizeof(struct xkb_color))
-#define _XkbAllocShapes(g, n)   _XkbGeomAlloc((char **)&(g)->shapes, \
-                                              &(g)->num_shapes, \
-                                              &(g)->sz_shapes, \
-                                              (n), sizeof(struct xkb_shape))
-#define _XkbAllocSections(g, n) _XkbGeomAlloc((char **)&(g)->sections, \
-                                              &(g)->num_sections, \
-                                              &(g)->sz_sections, \
-                                              (n), sizeof(struct xkb_section))
-#define _XkbAllocDoodads(g, n)  _XkbGeomAlloc((char **)&(g)->doodads, \
-                                              &(g)->num_doodads, \
-                                              &(g)->sz_doodads, \
-                                              (n), sizeof(union xkb_doodad))
-#define _XkbAllocKeyAliases(g, n)   _XkbGeomAlloc((char **)&(g)->key_aliases, \
-                                                  &(g)->num_key_aliases, \
-                                                  &(g)->sz_key_aliases, \
-                                                  (n), sizeof(struct xkb_key_alias))
-
-#define _XkbAllocOutlines(s, n) _XkbGeomAlloc((char **)&(s)->outlines, \
-                                              &(s)->num_outlines, \
-                                              &(s)->sz_outlines, \
-                                              (n), sizeof(struct xkb_outline))
-#define _XkbAllocRows(s, n)     _XkbGeomAlloc((char **)&(s)->rows, \
-                                              &(s)->num_rows, \
-                                              &(s)->sz_rows, \
-                                              (n), sizeof(struct xkb_row))
-#define _XkbAllocPoints(o, n)   _XkbGeomAlloc((char **)&(o)->points, \
-                                              &(o)->num_points, \
-                                              &(o)->sz_points, \
-                                              (n), sizeof(struct xkb_point))
-#define _XkbAllocKeys(r, n)     _XkbGeomAlloc((char **)&(r)->keys, \
-                                              &(r)->num_keys, \
-                                              &(r)->sz_keys, \
-                                              (n), sizeof(struct xkb_key))
-#define _XkbAllocOverlays(s, n) _XkbGeomAlloc((char **)&(s)->overlays, \
-                                              &(s)->num_overlays, \
-                                              &(s)->sz_overlays, \
-                                              (n), sizeof(struct xkb_overlay))
-#define _XkbAllocOverlayRows(o, n)  _XkbGeomAlloc((char **)&(o)->rows, \
-                                                  &(o)->num_rows, \
-                                                  &(o)->sz_rows, \
-                                                  (n), sizeof(struct xkb_overlay_row))
-#define _XkbAllocOverlayKeys(r, n)  _XkbGeomAlloc((char **)&(r)->keys, \
-                                                  &(r)->num_keys, \
-                                                  &(r)->sz_keys, \
-                                                  (n), sizeof(struct xkb_overlay_key))
-
-int
-XkbcAllocGeomKeyAliases(struct xkb_geometry * geom, int nKeyAliases)
-{
-    return _XkbAllocKeyAliases(geom, nKeyAliases);
-}
-
-int
-XkbcAllocGeometry(struct xkb_desc * xkb, struct xkb_geometry_sizes * sizes)
-{
-    struct xkb_geometry * geom;
-    int rtrn;
-
-    if (!xkb->geom) {
-        xkb->geom = _XkbTypedCalloc(1, struct xkb_geometry);
-        if (!xkb->geom)
-            return BadAlloc;
-    }
-    geom = xkb->geom;
-
-    if ((sizes->which & XkbGeomPropertiesMask) &&
-        ((rtrn = _XkbAllocProps(geom, sizes->num_properties)) != Success))
-        goto bail;
-
-    if ((sizes->which & XkbGeomColorsMask) &&
-        ((rtrn = _XkbAllocColors(geom, sizes->num_colors)) != Success))
-        goto bail;
-
-    if ((sizes->which & XkbGeomShapesMask) &&
-        ((rtrn = _XkbAllocShapes(geom, sizes->num_shapes)) != Success))
-        goto bail;
-
-    if ((sizes->which & XkbGeomSectionsMask) &&
-        ((rtrn = _XkbAllocSections(geom, sizes->num_sections)) != Success))
-        goto bail;
-
-    if ((sizes->which & XkbGeomDoodadsMask) &&
-        ((rtrn = _XkbAllocDoodads(geom, sizes->num_doodads)) != Success))
-        goto bail;
-
-    if ((sizes->which & XkbGeomKeyAliasesMask) &&
-        ((rtrn = _XkbAllocKeyAliases(geom, sizes->num_key_aliases)) != Success))
-        goto bail;
-
-    return Success;
-bail:
-    XkbcFreeGeometry(xkb);
-    xkb->geom = NULL;
-    return rtrn;
-}
-
-struct xkb_property *
-XkbcAddGeomProperty(struct xkb_geometry * geom,const char *name,const char *value)
-{
-    int i;
-    struct xkb_property * 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)) {
-           free(prop->value);
-            prop->value = strdup(value);
-           return prop;
-       }
-    }
-    if ((geom->num_properties>=geom->sz_properties)&&
-                                       (_XkbAllocProps(geom,1)!=Success)) {
-       return NULL;
-    }
-    prop= &geom->properties[geom->num_properties];
-    prop->name = strdup(name);
-    if (!prop->name)
-       return NULL;
-    prop->value = strdup(value);
-    if (!prop->value) {
-       free(prop->name);
-       prop->name= NULL;
-       return NULL;
-    }
-    geom->num_properties++;
-    return prop;
-}
-
-struct xkb_color *
-XkbcAddGeomColor(struct xkb_geometry * geom,const char *spec,unsigned int pixel)
-{
-    int i;
-    struct xkb_color * 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 = strdup(spec);
-    if (!color->spec)
-       return NULL;
-    geom->num_colors++;
-    return color;
-}
-
-struct xkb_outline *
-XkbcAddGeomOutline(struct xkb_shape * shape,int sz_points)
-{
-struct xkb_outline *   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];
-    memset(outline, 0, sizeof(struct xkb_outline));
-    if ((sz_points>0)&&(_XkbAllocPoints(outline,sz_points)!=Success))
-       return NULL;
-    shape->num_outlines++;
-    return outline;
-}
-
-struct xkb_shape *
-XkbcAddGeomShape(struct xkb_geometry * geom,uint32_t name,int sz_outlines)
-{
-    struct xkb_shape *shape;
-    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];
-    memset(shape, 0, sizeof(struct xkb_shape));
-    if ((sz_outlines>0)&&(_XkbAllocOutlines(shape,sz_outlines)!=Success))
-       return NULL;
-    shape->name= name;
-    shape->primary= shape->approx= NULL;
-    geom->num_shapes++;
-    return shape;
-}
-
-struct xkb_key *
-XkbcAddGeomKey(struct xkb_row * row)
-{
-struct xkb_key *       key;
-    if (!row)
-       return NULL;
-    if ((row->num_keys>=row->sz_keys)&&(_XkbAllocKeys(row,1)!=Success))
-       return NULL;
-    key= &row->keys[row->num_keys++];
-    memset(key, 0, sizeof(struct xkb_key));
-    return key;
-}
-
-struct xkb_row *
-XkbcAddGeomRow(struct xkb_section * section,int sz_keys)
-{
-struct xkb_row *       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];
-    memset(row, 0, sizeof(struct xkb_row));
-    if ((sz_keys>0)&&(_XkbAllocKeys(row,sz_keys)!=Success))
-       return NULL;
-    section->num_rows++;
-    return row;
-}
-
-struct xkb_section *
-XkbcAddGeomSection(    struct xkb_geometry *   geom,
-                       uint32_t                name,
-                       int             sz_rows,
-                       int             sz_doodads,
-                       int             sz_over)
-{
-    int        i;
-    struct xkb_section *       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)) {
-        free(section->rows);
-        section->rows= NULL;
-        section->sz_rows= section->num_rows= 0;
-       return NULL;
-    }
-    section->name= name;
-    geom->num_sections++;
-    return section;
-}
-
-union xkb_doodad *
-XkbcAddGeomDoodad(struct xkb_geometry * geom,struct xkb_section * section,uint32_t name)
-{
-    union xkb_doodad *old, *doodad;
-    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++];
-    }
-    memset(doodad, 0, sizeof(union xkb_doodad));
-    doodad->any.name= name;
-    return doodad;
-}
-
-struct xkb_overlay_row *
-XkbcAddGeomOverlayRow(struct xkb_overlay * overlay,int row_under,int sz_keys)
-{
-    int i;
-    struct xkb_overlay_row *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];
-    memset(row, 0, sizeof(struct xkb_overlay_row));
-    if ((sz_keys>0)&&(_XkbAllocOverlayKeys(row,sz_keys)!=Success))
-       return NULL;
-    row->row_under= row_under;
-    overlay->num_rows++;
-    return row;
-}
-
-struct xkb_overlay *
-XkbcAddGeomOverlay(struct xkb_section * section,uint32_t name,int sz_rows)
-{
-    int i;
-    struct xkb_overlay *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;
-}
index d084e5b..96d7a31 100644 (file)
@@ -474,7 +474,6 @@ CheckLine(  InputLine *             line,
     rule->symbols= _XkbDupString(tmp.name[SYMBOLS]);
     rule->types= _XkbDupString(tmp.name[TYPES]);
     rule->compat= _XkbDupString(tmp.name[COMPAT]);
-    rule->geometry= _XkbDupString(tmp.name[GEOMETRY]);
     rule->keymap= _XkbDupString(tmp.name[KEYMAP]);
 
     rule->layout_num = rule->variant_num = 0;
@@ -604,7 +603,6 @@ XkbRF_ApplyRule(    XkbRF_RulePtr           rule,
     Apply(rule->symbols,  &names->symbols);
     Apply(rule->types,    &names->types);
     Apply(rule->compat,   &names->compat);
-    Apply(rule->geometry, &names->geometry);
     Apply(rule->keymap,   &names->keymap);
 }
 
@@ -875,14 +873,12 @@ XkbcRF_GetComponents(     XkbRF_RulesPtr          rules,
        names->types= XkbRF_SubstituteVars(names->types, &mdefs);
     if (names->compat)
        names->compat= XkbRF_SubstituteVars(names->compat, &mdefs);
-    if (names->geometry)
-       names->geometry= XkbRF_SubstituteVars(names->geometry, &mdefs);
     if (names->keymap) 
        names->keymap= XkbRF_SubstituteVars(names->keymap, &mdefs);
 
     FreeMultiDefs(&mdefs);
     return (names->keycodes && names->symbols && names->types &&
-               names->compat && names->geometry ) || names->keymap;
+               names->compat) || names->keymap;
 }
 
 static XkbRF_RulePtr
@@ -1006,7 +1002,6 @@ XkbcRF_Free(XkbRF_RulesPtr rules)
         free(rule->symbols);
         free(rule->types);
         free(rule->compat);
-        free(rule->geometry);
         free(rule->keymap);
     }
     free(rules->rules);
index d5a7549..a41faca 100644 (file)
@@ -209,9 +209,6 @@ XkbcConfigText(unsigned config)
         return "Layout";
     case XkmKeymapFile:
         return "Keymap";
-    case XkmGeometryFile:
-    case XkmGeometryIndex:
-        return "Geometry";
     case XkmTypesIndex:
         return "Types";
     case XkmCompatMapIndex:
@@ -229,24 +226,6 @@ XkbcConfigText(unsigned config)
     }
 }
 
-const char *
-XkbcGeomFPText(int val)
-{
-    char *buf;
-    int whole, frac;
-
-    buf = tbGetBuffer(12);
-    whole = val / XkbGeomPtsPerMM;
-    frac = val % XkbGeomPtsPerMM;
-
-    if (frac != 0)
-        snprintf(buf, 12, "%d.%d", whole, frac);
-    else
-        snprintf(buf, 12, "%d", whole);
-
-    return buf;
-}
-
 static const char *actionTypeNames[XkbSA_NumActions]= {
     "NoAction",         /* XkbSA_NoAction */
     "SetMods",          /* XkbSA_SetMods */
index a560230..9ff33bb 100644 (file)
--- a/src/xkb.c
+++ b/src/xkb.c
@@ -89,8 +89,6 @@ xkb_canonicalise_components(struct xkb_component_names * names,
                                                 old ? old->keycodes : NULL);
     names->compat = XkbcCanonicaliseComponent(names->compat,
                                               old ? old->compat : NULL);
-    names->geometry = XkbcCanonicaliseComponent(names->geometry,
-                                                old ? old->geometry : NULL);
     names->symbols = XkbcCanonicaliseComponent(names->symbols,
                                                old ? old->symbols : NULL);
     names->types = XkbcCanonicaliseComponent(names->types,
index 6176fb8..b438810 100644 (file)
@@ -12,7 +12,6 @@ libxkbcomp_la_SOURCES = \
        compat.c \
        expr.c \
        expr.h \
-       geometry.c \
        indicators.c \
        indicators.h \
        keycodes.c \
index af3dc2f..7ab15aa 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "xkbcomp.h"
 #include "xkballoc.h"
-#include "xkbgeom.h"
 #include "xkbmisc.h"
 #include "misc.h"
 #include "alias.h"
@@ -152,7 +151,7 @@ MergeAliases(AliasInfo ** into, AliasInfo ** merge, unsigned how_merge)
 }
 
 int
-ApplyAliases(struct xkb_desc * xkb, Bool toGeom, AliasInfo ** info_in)
+ApplyAliases(struct xkb_desc * xkb, AliasInfo ** info_in)
 {
     int i;
     struct xkb_key_alias *old, *a;
@@ -162,16 +161,8 @@ ApplyAliases(struct xkb_desc * xkb, Bool toGeom, AliasInfo ** info_in)
 
     if (*info_in == NULL)
         return True;
-    if (toGeom)
-    {
-        nOld = (xkb->geom ? xkb->geom->num_key_aliases : 0);
-        old = (xkb->geom ? xkb->geom->key_aliases : NULL);
-    }
-    else
-    {
-        nOld = (xkb->names ? xkb->names->num_key_aliases : 0);
-        old = (xkb->names ? xkb->names->key_aliases : NULL);
-    }
+    nOld = (xkb->names ? xkb->names->num_key_aliases : 0);
+    old = (xkb->names ? xkb->names->key_aliases : NULL);
     for (nNew = 0, info = *info_in; info != NULL;
          info = (AliasInfo *) info->def.next)
     {
@@ -227,38 +218,15 @@ ApplyAliases(struct xkb_desc * xkb, Bool toGeom, AliasInfo ** info_in)
         *info_in = NULL;
         return True;
     }
-    if (toGeom)
-    {
-        if (!xkb->geom)
-        {
-            struct xkb_geometry_sizes sizes;
-            memset(&sizes, 0, sizeof(struct xkb_geometry_sizes));
-            sizes.which = XkbGeomKeyAliasesMask;
-            sizes.num_key_aliases = nOld + nNew;
-            status = XkbcAllocGeometry(xkb, &sizes);
-        }
-        else
-        {
-            status = XkbcAllocGeomKeyAliases(xkb->geom, nOld + nNew);
-        }
-        if (xkb->geom)
-            old = xkb->geom->key_aliases;
-    }
-    else
-    {
-        status = XkbcAllocNames(xkb, XkbKeyAliasesMask, nOld + nNew);
-        if (xkb->names)
-            old = xkb->names->key_aliases;
-    }
+    status = XkbcAllocNames(xkb, XkbKeyAliasesMask, nOld + nNew);
+    if (xkb->names)
+        old = xkb->names->key_aliases;
     if (status != Success)
     {
         WSGO("Allocation failure in ApplyAliases\n");
         return False;
     }
-    if (toGeom)
-        a = &xkb->geom->key_aliases[nOld];
-    else
-        a = xkb->names ? &xkb->names->key_aliases[nOld] : NULL;
+    a = xkb->names ? &xkb->names->key_aliases[nOld] : NULL;
     for (info = *info_in; info != NULL; info = (AliasInfo *) info->def.next)
     {
         if (info->alias[0] != '\0')
@@ -275,8 +243,6 @@ ApplyAliases(struct xkb_desc * xkb, Bool toGeom, AliasInfo ** info_in)
               a - old);
     }
 #endif
-    if (toGeom)
-        xkb->geom->num_key_aliases += nNew;
     ClearCommonInfo(&(*info_in)->def);
     *info_in = NULL;
     return True;
index bcc8439..40b116e 100644 (file)
@@ -49,7 +49,6 @@ extern Bool MergeAliases(AliasInfo ** /* into */ ,
     );
 
 extern int ApplyAliases(struct xkb_desc * /* xkb */ ,
-                        Bool /* toGeom */ ,
                         AliasInfo **    /* info */
     );
 
diff --git a/src/xkbcomp/geometry.c b/src/xkbcomp/geometry.c
deleted file mode 100644 (file)
index 5657421..0000000
+++ /dev/null
@@ -1,3724 +0,0 @@
-/************************************************************
- Copyright (c) 1994 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.
-
- ********************************************************/
-
-#include "xkbcomp.h"
-#include "xkballoc.h"
-#include "xkbgeom.h"
-#include "xkbmisc.h"
-#include "expr.h"
-#include "vmod.h"
-#include "misc.h"
-#include "indicators.h"
-#include "action.h"
-#include "keycodes.h"
-#include "alias.h"
-#include "parseutils.h"
-
-#define        DFLT_FONT       "helvetica"
-#define        DFLT_SLANT      "r"
-#define        DFLT_WEIGHT     "medium"
-#define        DFLT_SET_WIDTH  "normal"
-#define        DFLT_VARIANT    ""
-#define        DFLT_ENCODING   "iso8859-1"
-#define        DFLT_SIZE       120
-
-typedef struct _PropertyInfo
-{
-    CommonInfo defs;
-    char *name;
-    char *value;
-} PropertyInfo;
-
-#define        _GSh_Outlines   (1<<1)
-#define        _GSh_Approx     (1<<2)
-#define        _GSh_Primary    (1<<3)
-typedef struct _ShapeInfo
-{
-    CommonInfo defs;
-    uint32_t name;
-    short index;
-    unsigned short nOutlines;
-    unsigned short szOutlines;
-    struct xkb_outline * outlines;
-    struct xkb_outline * approx;
-    struct xkb_outline * primary;
-    int dfltCornerRadius;
-} ShapeInfo;
-
-#define        shText(s) \
-    ((s) ? XkbcAtomText((s)->name) : "default shape")
-
-#define        _GD_Priority    (1<<0)
-#define        _GD_Top         (1<<1)
-#define        _GD_Left        (1<<2)
-#define        _GD_Angle       (1<<3)
-#define        _GD_Shape       (1<<4)
-#define        _GD_FontVariant (1<<4)  /* CHEATING */
-#define        _GD_Corner      (1<<5)
-#define        _GD_Width       (1<<5)  /* CHEATING */
-#define        _GD_Color       (1<<6)
-#define        _GD_OffColor    (1<<7)
-#define        _GD_Height      (1<<7)  /* CHEATING */
-#define        _GD_Text        (1<<8)
-#define        _GD_Font        (1<<9)
-#define        _GD_FontSlant   (1<<10)
-#define        _GD_FontWeight  (1<<11)
-#define        _GD_FontSetWidth (1<<12)
-#define        _GD_FontSize    (1<<13)
-#define        _GD_FontEncoding (1<<14)
-#define        _GD_FontSpec    (1<<15)
-
-
-#define        _GD_FontParts   (_GD_Font|_GD_FontSlant|_GD_FontWeight|_GD_FontSetWidth|_GD_FontSize|_GD_FontEncoding|_GD_FontVariant)
-
-typedef struct _DoodadInfo
-{
-    CommonInfo defs;
-    uint32_t name;
-    unsigned char type;
-    unsigned char priority;
-    short top;
-    short left;
-    short angle;
-    unsigned short corner;
-    unsigned short width;
-    unsigned short height;
-    uint32_t shape;
-    uint32_t color;
-    uint32_t offColor;
-    uint32_t text;
-    uint32_t font;
-    uint32_t fontSlant;
-    uint32_t fontWeight;
-    uint32_t fontSetWidth;
-    uint32_t fontVariant;
-    unsigned short fontSize;
-    uint32_t fontEncoding;
-    uint32_t fontSpec;
-    char *logoName;
-    struct _SectionInfo *section;
-} DoodadInfo;
-
-#define        Yes             1
-#define        No              0
-#define        Undefined       -1
-
-#define        _GK_Default     (1<<0)
-#define        _GK_Name        (1<<1)
-#define        _GK_Gap         (1<<2)
-#define        _GK_Shape       (1<<3)
-#define        _GK_Color       (1<<4)
-typedef struct _KeyInfo
-{
-    CommonInfo defs;
-    char name[8];
-    short gap;
-    short index;
-    uint32_t shape;
-    uint32_t color;
-    struct _RowInfo *row;
-} KeyInfo;
-#define        keyText(k)      ((k)&&(k)->name[0]?(k)->name:"default")
-
-#define        _GR_Default     (1<<0)
-#define        _GR_Vertical    (1<<1)
-#define        _GR_Top         (1<<2)
-#define        _GR_Left        (1<<3)
-typedef struct _RowInfo
-{
-    CommonInfo defs;
-    unsigned short top;
-    unsigned short left;
-    short index;
-    Bool vertical;
-    unsigned short nKeys;
-    KeyInfo *keys;
-    KeyInfo dfltKey;
-    struct _SectionInfo *section;
-} RowInfo;
-#define        rowText(r) \
-    ((r) ? XkbcAtomText((r)->section->name) : "default")
-
-#define        _GOK_UnknownRow -1
-typedef struct _OverlayKeyInfo
-{
-    CommonInfo defs;
-    short sectionRow;
-    short overlayRow;
-    char over[XkbKeyNameLength + 1];
-    char under[XkbKeyNameLength + 1];
-} OverlayKeyInfo;
-
-typedef struct _OverlayInfo
-{
-    CommonInfo defs;
-    uint32_t name;
-    unsigned short nRows;
-    unsigned short nKeys;
-    OverlayKeyInfo *keys;
-} OverlayInfo;
-#define        oiText(o) \
-    ((o) ? XkbcAtomText((o)->name) : "default")
-
-
-#define        _GS_Default     (1<<0)
-#define        _GS_Name        (1<<1)
-#define        _GS_Top         (1<<2)
-#define        _GS_Left        (1<<3)
-#define        _GS_Width       (1<<4)
-#define        _GS_Height      (1<<5)
-#define        _GS_Angle       (1<<6)
-#define        _GS_Priority    (1<<7)
-typedef struct _SectionInfo
-{
-    CommonInfo defs;
-    uint32_t name;
-    unsigned short top;
-    unsigned short left;
-    unsigned short width;
-    unsigned short height;
-    unsigned short angle;
-    unsigned short nRows;
-    unsigned short nDoodads;
-    unsigned short nOverlays;
-    unsigned char priority;
-    unsigned char nextDoodadPriority;
-    RowInfo *rows;
-    DoodadInfo *doodads;
-    RowInfo dfltRow;
-    DoodadInfo *dfltDoodads;
-    OverlayInfo *overlays;
-    struct _GeometryInfo *geometry;
-} SectionInfo;
-#define        scText(s) \
-    ((s) ? XkbcAtomText((s)->name) : "default")
-
-typedef struct _GeometryInfo
-{
-    char *name;
-    unsigned fileID;
-    unsigned merge;
-    int errorCount;
-    unsigned nextPriority;
-    int nProps;
-    int nShapes;
-    int nSections;
-    int nDoodads;
-    PropertyInfo *props;
-    ShapeInfo *shapes;
-    SectionInfo *sections;
-    DoodadInfo *doodads;
-    int widthMM;
-    int heightMM;
-    uint32_t font;
-    uint32_t fontSlant;
-    uint32_t fontWeight;
-    uint32_t fontSetWidth;
-    uint32_t fontVariant;
-    unsigned fontSize;
-    uint32_t fontEncoding;
-    uint32_t fontSpec;
-    uint32_t baseColor;
-    uint32_t labelColor;
-    int dfltCornerRadius;
-    SectionInfo dfltSection;
-    DoodadInfo *dfltDoodads;
-    AliasInfo *aliases;
-} GeometryInfo;
-
-static const char *
-ddText(DoodadInfo * di)
-{
-    static char buf[64];
-
-    if (di == NULL)
-    {
-        strcpy(buf, "default");
-        return buf;
-    }
-    if (di->section)
-    {
-        sprintf(buf, "%s in section %s",
-                XkbcAtomText(di->name), scText(di->section));
-        return buf;
-    }
-    return XkbcAtomText(di->name);
-}
-
-/***====================================================================***/
-
-static void
-InitPropertyInfo(PropertyInfo * pi, GeometryInfo * info)
-{
-    pi->defs.defined = 0;
-    pi->defs.fileID = info->fileID;
-    pi->defs.merge = info->merge;
-    pi->name = pi->value = NULL;
-}
-
-static void
-FreeProperties(PropertyInfo * pi, GeometryInfo * info)
-{
-    PropertyInfo *tmp;
-    PropertyInfo *next;
-
-    if (info->props == pi)
-    {
-        info->props = NULL;
-        info->nProps = 0;
-    }
-    for (tmp = pi; tmp != NULL; tmp = next)
-    {
-        free(tmp->name);
-        free(tmp->value);
-        tmp->name = tmp->value = NULL;
-        next = (PropertyInfo *) tmp->defs.next;
-        free(tmp);
-    }
-}
-
-static void
-InitKeyInfo(KeyInfo * key, RowInfo * row, GeometryInfo * info)
-{
-
-    if (key != &row->dfltKey)
-    {
-        *key = row->dfltKey;
-        strcpy(key->name, "unknown");
-        key->defs.defined &= ~_GK_Default;
-    }
-    else
-    {
-        memset(key, 0, sizeof(KeyInfo));
-        strcpy(key->name, "default");
-        key->defs.defined = _GK_Default;
-        key->defs.fileID = info->fileID;
-        key->defs.merge = info->merge;
-        key->defs.next = NULL;
-        key->row = row;
-    }
-}
-
-static void
-ClearKeyInfo(KeyInfo * key)
-{
-    key->defs.defined &= ~_GK_Default;
-    strcpy(key->name, "default");
-    key->gap = 0;
-    key->shape = None;
-    key->color = None;
-}
-
-static void
-FreeKeys(KeyInfo * key, RowInfo * row, GeometryInfo * info)
-{
-    KeyInfo *tmp;
-    KeyInfo *next;
-
-    if (row->keys == key)
-    {
-        row->nKeys = 0;
-        row->keys = NULL;
-    }
-    for (tmp = key; tmp != NULL; tmp = next)
-    {
-        ClearKeyInfo(tmp);
-        next = (KeyInfo *) tmp->defs.next;
-        free(tmp);
-    }
-}
-
-static void
-InitRowInfo(RowInfo * row, SectionInfo * section, GeometryInfo * info)
-{
-    if (row != &section->dfltRow)
-    {
-        *row = section->dfltRow;
-        row->defs.defined &= ~_GR_Default;
-    }
-    else
-    {
-        memset(row, 0, sizeof(RowInfo));
-        row->defs.defined = _GR_Default;
-        row->defs.fileID = info->fileID;
-        row->defs.merge = info->merge;
-        row->defs.next = NULL;
-        row->section = section;
-        row->nKeys = 0;
-        row->keys = NULL;
-        InitKeyInfo(&row->dfltKey, row, info);
-    }
-}
-
-static void
-ClearRowInfo(RowInfo * row, GeometryInfo * info)
-{
-    row->defs.defined &= ~_GR_Default;
-    row->top = row->left = 0;
-    row->vertical = False;
-    row->nKeys = 0;
-    if (row->keys)
-        FreeKeys(row->keys, row, info);
-    ClearKeyInfo(&row->dfltKey);
-    row->dfltKey.defs.defined |= _GK_Default;
-}
-
-static void
-FreeRows(RowInfo * row, SectionInfo * section, GeometryInfo * info)
-{
-    RowInfo *next;
-    RowInfo *tmp;
-
-    if (row == section->rows)
-    {
-        section->nRows = 0;
-        section->rows = NULL;
-    }
-    for (tmp = row; tmp != NULL; tmp = next)
-    {
-        ClearRowInfo(tmp, info);
-        next = (RowInfo *) tmp->defs.next;
-        free(tmp);
-    }
-}
-
-static DoodadInfo *
-FindDoodadByType(DoodadInfo * di, unsigned type)
-{
-    while (di)
-    {
-        if (di->type == type)
-            return di;
-        di = (DoodadInfo *) di->defs.next;
-    }
-    return NULL;
-}
-
-static DoodadInfo *
-FindDoodadByName(DoodadInfo * di, uint32_t name)
-{
-    while (di)
-    {
-        if (di->name == name)
-            return di;
-        di = (DoodadInfo *) di->defs.next;
-    }
-    return NULL;
-}
-
-static void
-InitDoodadInfo(DoodadInfo * di, unsigned type, SectionInfo * si,
-               GeometryInfo * info)
-{
-    DoodadInfo *dflt;
-
-    dflt = NULL;
-    if (si && si->dfltDoodads)
-        dflt = FindDoodadByType(si->dfltDoodads, type);
-    if ((dflt == NULL) && (info->dfltDoodads))
-        dflt = FindDoodadByType(info->dfltDoodads, type);
-    if (dflt != NULL)
-    {
-        *di = *dflt;
-        di->defs.next = NULL;
-    }
-    else
-    {
-        memset(di, 0, sizeof(DoodadInfo));
-        di->defs.fileID = info->fileID;
-        di->type = type;
-    }
-    di->section = si;
-    if (si != NULL)
-    {
-        di->priority = si->nextDoodadPriority++;
-#if XkbGeomMaxPriority < 255
-        if (si->nextDoodadPriority > XkbGeomMaxPriority)
-            si->nextDoodadPriority = XkbGeomMaxPriority;
-#endif
-    }
-    else
-    {
-        di->priority = info->nextPriority++;
-        if (info->nextPriority > XkbGeomMaxPriority)
-            info->nextPriority = XkbGeomMaxPriority;
-    }
-}
-
-static void
-ClearDoodadInfo(DoodadInfo * di)
-{
-    CommonInfo defs;
-
-    defs = di->defs;
-    memset(di, 0, sizeof(DoodadInfo));
-    di->defs = defs;
-    di->defs.defined = 0;
-}
-
-static void
-ClearOverlayInfo(OverlayInfo * ol)
-{
-    if (ol && ol->keys)
-    {
-        ol->keys = (OverlayKeyInfo *) ClearCommonInfo(&ol->keys->defs);
-        ol->nKeys = 0;
-    }
-}
-
-static void
-FreeDoodads(DoodadInfo * di, SectionInfo * si, GeometryInfo * info)
-{
-    DoodadInfo *tmp;
-    DoodadInfo *next;
-
-    if (si)
-    {
-        if (si->doodads == di)
-        {
-            si->doodads = NULL;
-            si->nDoodads = 0;
-        }
-        if (si->dfltDoodads == di)
-            si->dfltDoodads = NULL;
-    }
-    if (info->doodads == di)
-    {
-        info->doodads = NULL;
-        info->nDoodads = 0;
-    }
-    if (info->dfltDoodads == di)
-        info->dfltDoodads = NULL;
-    for (tmp = di; tmp != NULL; tmp = next)
-    {
-        next = (DoodadInfo *) tmp->defs.next;
-        ClearDoodadInfo(tmp);
-        free(tmp);
-    }
-}
-
-static void
-InitSectionInfo(SectionInfo * si, GeometryInfo * info)
-{
-    if (si != &info->dfltSection)
-    {
-        *si = info->dfltSection;
-        si->defs.defined &= ~_GS_Default;
-        si->name = xkb_intern_atom("unknown");
-        si->priority = info->nextPriority++;
-        if (info->nextPriority > XkbGeomMaxPriority)
-            info->nextPriority = XkbGeomMaxPriority;
-    }
-    else
-    {
-        memset(si, 0, sizeof(SectionInfo));
-        si->defs.fileID = info->fileID;
-        si->defs.merge = info->merge;
-        si->defs.next = NULL;
-        si->geometry = info;
-        si->name = xkb_intern_atom("default");
-        InitRowInfo(&si->dfltRow, si, info);
-    }
-}
-
-static void
-DupSectionInfo(SectionInfo * into, SectionInfo * from, GeometryInfo * info)
-{
-    CommonInfo defs;
-
-    defs = into->defs;
-    *into = *from;
-    into->defs.next = NULL;
-    into->dfltRow.defs.fileID = defs.fileID;
-    into->dfltRow.defs.merge = defs.merge;
-    into->dfltRow.defs.next = NULL;
-    into->dfltRow.section = into;
-    into->dfltRow.dfltKey.defs.fileID = defs.fileID;
-    into->dfltRow.dfltKey.defs.merge = defs.merge;
-    into->dfltRow.dfltKey.defs.next = NULL;
-    into->dfltRow.dfltKey.row = &into->dfltRow;
-}
-
-static void
-ClearSectionInfo(SectionInfo * si, GeometryInfo * info)
-{
-
-    si->defs.defined &= ~_GS_Default;
-    si->name = xkb_intern_atom("default");
-    si->top = si->left = 0;
-    si->width = si->height = 0;
-    si->angle = 0;
-    if (si->rows)
-    {
-        FreeRows(si->rows, si, info);
-        si->rows = NULL;
-    }
-    ClearRowInfo(&si->dfltRow, info);
-    if (si->doodads)
-    {
-        FreeDoodads(si->doodads, si, info);
-        si->doodads = NULL;
-    }
-    si->dfltRow.defs.defined = _GR_Default;
-}
-
-static void
-FreeSections(SectionInfo * si, GeometryInfo * info)
-{
-    SectionInfo *tmp;
-    SectionInfo *next;
-
-    if (si == info->sections)
-    {
-        info->nSections = 0;
-        info->sections = NULL;
-    }
-    for (tmp = si; tmp != NULL; tmp = next)
-    {
-        ClearSectionInfo(tmp, info);
-        next = (SectionInfo *) tmp->defs.next;
-        free(tmp);
-    }
-}
-
-static void
-FreeShapes(ShapeInfo * si, GeometryInfo * info)
-{
-    ShapeInfo *tmp;
-    ShapeInfo *next;
-
-    if (si == info->shapes)
-    {
-        info->nShapes = 0;
-        info->shapes = NULL;
-    }
-    for (tmp = si; tmp != NULL; tmp = next)
-    {
-        if (tmp->outlines)
-        {
-            int i;
-            for (i = 0; i < tmp->nOutlines; i++)
-            {
-                if (tmp->outlines[i].points != NULL)
-                {
-                    free(tmp->outlines[i].points);
-                    tmp->outlines[i].num_points = 0;
-                    tmp->outlines[i].points = NULL;
-                }
-            }
-            free(tmp->outlines);
-            tmp->szOutlines = 0;
-            tmp->nOutlines = 0;
-            tmp->outlines = NULL;
-            tmp->primary = tmp->approx = NULL;
-        }
-        next = (ShapeInfo *) tmp->defs.next;
-        free(tmp);
-    }
-}
-
-/***====================================================================***/
-
-static void
-InitGeometryInfo(GeometryInfo * info, unsigned fileID, unsigned merge)
-{
-    memset(info, 0, sizeof(GeometryInfo));
-    info->fileID = fileID;
-    info->merge = merge;
-    InitSectionInfo(&info->dfltSection, info);
-    info->dfltSection.defs.defined = _GS_Default;
-}
-
-static void
-ClearGeometryInfo(GeometryInfo * info)
-{
-    free(info->name);
-    info->name = NULL;
-    if (info->props)
-        FreeProperties(info->props, info);
-    if (info->shapes)
-        FreeShapes(info->shapes, info);
-    if (info->sections)
-        FreeSections(info->sections, info);
-    if (info->doodads)
-        FreeDoodads(info->doodads, NULL, info);
-    if (info->dfltDoodads)
-        FreeDoodads(info->dfltDoodads, NULL, info);
-    info->widthMM = 0;
-    info->heightMM = 0;
-    info->dfltCornerRadius = 0;
-    ClearSectionInfo(&info->dfltSection, info);
-    info->dfltSection.defs.defined = _GS_Default;
-    if (info->aliases)
-        ClearAliases(&info->aliases);
-}
-
-/***====================================================================***/
-
-static PropertyInfo *
-NextProperty(GeometryInfo * info)
-{
-    PropertyInfo *pi;
-
-    pi = uTypedAlloc(PropertyInfo);
-    if (pi)
-    {
-        memset(pi, 0, sizeof(PropertyInfo));
-        info->props = (PropertyInfo *) AddCommonInfo(&info->props->defs,
-                                                     (CommonInfo *) pi);
-        info->nProps++;
-    }
-    return pi;
-}
-
-static PropertyInfo *
-FindProperty(GeometryInfo * info, char *name)
-{
-    PropertyInfo *old;
-
-    if (!name)
-        return NULL;
-    for (old = info->props; old != NULL;
-         old = (PropertyInfo *) old->defs.next)
-    {
-        if ((old->name) && (uStringEqual(name, old->name)))
-            return old;
-    }
-    return NULL;
-}
-
-static Bool
-AddProperty(GeometryInfo * info, PropertyInfo * new)
-{
-    PropertyInfo *old;
-
-    if ((!new) || (!new->value) || (!new->name))
-        return False;
-    old = FindProperty(info, new->name);
-    if (old != NULL)
-    {
-        if ((new->defs.merge == MergeReplace)
-            || (new->defs.merge == MergeOverride))
-        {
-            if (((old->defs.fileID == new->defs.fileID)
-                 && (warningLevel > 0)) || (warningLevel > 9))
-            {
-                WARN("Multiple definitions for the \"%s\" property\n",
-                      new->name);
-                ACTION("Ignoring \"%s\", using \"%s\"\n", old->value,
-                        new->value);
-            }
-            free(old->value);
-            old->value = _XkbDupString(new->value);
-            return True;
-        }
-        if (((old->defs.fileID == new->defs.fileID) && (warningLevel > 0))
-            || (warningLevel > 9))
-        {
-            WARN("Multiple definitions for \"%s\" property\n", new->name);
-            ACTION("Using \"%s\", ignoring \"%s\" \n", old->value,
-                    new->value);
-        }
-        return True;
-    }
-    old = new;
-    if ((new = NextProperty(info)) == NULL)
-        return False;
-    new->defs.next = NULL;
-    new->name = _XkbDupString(old->name);
-    new->value = _XkbDupString(old->value);
-    return True;
-}
-
-/***====================================================================***/
-
-static ShapeInfo *
-NextShape(GeometryInfo * info)
-{
-    ShapeInfo *si;
-
-    si = uTypedAlloc(ShapeInfo);
-    if (si)
-    {
-        memset(si, 0, sizeof(ShapeInfo));
-        info->shapes = (ShapeInfo *) AddCommonInfo(&info->shapes->defs,
-                                                   (CommonInfo *) si);
-        info->nShapes++;
-        si->dfltCornerRadius = info->dfltCornerRadius;
-    }
-    return si;
-}
-
-static ShapeInfo *
-FindShape(GeometryInfo * info, uint32_t name, const char *type, const char *which)
-{
-    ShapeInfo *old;
-
-    for (old = info->shapes; old != NULL; old = (ShapeInfo *) old->defs.next)
-    {
-        if (name == old->name)
-            return old;
-    }
-    if (type != NULL)
-    {
-        old = info->shapes;
-        WARN("Unknown shape \"%s\" for %s %s\n",
-              XkbcAtomText(name), type, which);
-        if (old)
-        {
-            ACTION("Using default shape %s instead\n", shText(old));
-            return old;
-        }
-        ACTION("No default shape; definition ignored\n");
-        return NULL;
-    }
-    return NULL;
-}
-
-static Bool
-AddShape(GeometryInfo * info, ShapeInfo * new)
-{
-    ShapeInfo *old;
-
-    old = FindShape(info, new->name, NULL, NULL);
-    if (old != NULL)
-    {
-        if ((new->defs.merge == MergeReplace)
-            || (new->defs.merge == MergeOverride))
-        {
-            ShapeInfo *next = (ShapeInfo *) old->defs.next;
-            if (((old->defs.fileID == new->defs.fileID)
-                 && (warningLevel > 0)) || (warningLevel > 9))
-            {
-                WARN("Duplicate shape name \"%s\"\n", shText(old));
-                ACTION("Using last definition\n");
-            }
-            *old = *new;
-            old->defs.next = &next->defs;
-            return True;
-        }
-        if (((old->defs.fileID == new->defs.fileID) && (warningLevel > 0))
-            || (warningLevel > 9))
-        {
-            WARN("Multiple shapes named \"%s\"\n", shText(old));
-            ACTION("Using first definition\n");
-        }
-        return True;
-    }
-    old = new;
-    if ((new = NextShape(info)) == NULL)
-        return False;
-    *new = *old;
-    new->defs.next = NULL;
-    old->szOutlines = old->nOutlines = 0;
-    old->outlines = NULL;
-    old->approx = NULL;
-    old->primary = NULL;
-    return True;
-}
-
-/***====================================================================***/
-
-static void
-ReplaceDoodad(DoodadInfo * into, DoodadInfo * from)
-{
-    CommonInfo *next;
-
-    next = into->defs.next;
-    ClearDoodadInfo(into);
-    *into = *from;
-    into->defs.next = next;
-    next = from->defs.next;
-    ClearDoodadInfo(from);
-    from->defs.next = next;
-}
-
-static DoodadInfo *
-NextDfltDoodad(SectionInfo * si, GeometryInfo * info)
-{
-    DoodadInfo *di;
-
-    di = uTypedCalloc(1, DoodadInfo);
-    if (!di)
-        return NULL;
-    if (si)
-    {
-        si->dfltDoodads =
-            (DoodadInfo *) AddCommonInfo(&si->dfltDoodads->defs,
-                                         (CommonInfo *) di);
-    }
-    else
-    {
-        info->dfltDoodads =
-            (DoodadInfo *) AddCommonInfo(&info->dfltDoodads->defs,
-                                         (CommonInfo *) di);
-    }
-    return di;
-}
-
-static DoodadInfo *
-NextDoodad(SectionInfo * si, GeometryInfo * info)
-{
-    DoodadInfo *di;
-
-    di = uTypedCalloc(1, DoodadInfo);
-    if (di)
-    {
-        if (si)
-        {
-            si->doodads = (DoodadInfo *) AddCommonInfo(&si->doodads->defs,
-                                                       (CommonInfo *) di);
-            si->nDoodads++;
-        }
-        else
-        {
-            info->doodads =
-                (DoodadInfo *) AddCommonInfo(&info->doodads->defs,
-                                             (CommonInfo *) di);
-            info->nDoodads++;
-        }
-    }
-    return di;
-}
-
-static Bool
-AddDoodad(SectionInfo * si, GeometryInfo * info, DoodadInfo * new)
-{
-    DoodadInfo *old;
-
-    old = FindDoodadByName((si ? si->doodads : info->doodads), new->name);
-    if (old != NULL)
-    {
-        if ((new->defs.merge == MergeReplace)
-            || (new->defs.merge == MergeOverride))
-        {
-            if (((old->defs.fileID == new->defs.fileID)
-                 && (warningLevel > 0)) || (warningLevel > 9))
-            {
-                WARN("Multiple doodads named \"%s\"\n",
-                      XkbcAtomText(old->name));
-                ACTION("Using last definition\n");
-            }
-            ReplaceDoodad(old, new);
-            old->section = si;
-            return True;
-        }
-        if (((old->defs.fileID == new->defs.fileID) && (warningLevel > 0))
-            || (warningLevel > 9))
-        {
-            WARN("Multiple doodads named \"%s\"\n",
-                  XkbcAtomText(old->name));
-            ACTION("Using first definition\n");
-        }
-        return True;
-    }
-    old = new;
-    if ((new = NextDoodad(si, info)) == NULL)
-        return False;
-    ReplaceDoodad(new, old);
-    new->section = si;
-    new->defs.next = NULL;
-    return True;
-}
-
-static DoodadInfo *
-FindDfltDoodadByTypeName(char *name, SectionInfo * si, GeometryInfo * info)
-{
-    DoodadInfo *dflt = NULL;
-    unsigned type;
-
-    if (uStrCaseCmp(name, "outline") == 0)
-        type = XkbOutlineDoodad;
-    else if (uStrCaseCmp(name, "solid") == 0)
-        type = XkbSolidDoodad;
-    else if (uStrCaseCmp(name, "text") == 0)
-        type = XkbTextDoodad;
-    else if (uStrCaseCmp(name, "indicator") == 0)
-        type = XkbIndicatorDoodad;
-    else if (uStrCaseCmp(name, "logo") == 0)
-        type = XkbLogoDoodad;
-    else
-        return NULL;
-    if ((si) && (si->dfltDoodads))
-        dflt = FindDoodadByType(si->dfltDoodads, type);
-    if ((!dflt) && (info->dfltDoodads))
-        dflt = FindDoodadByType(info->dfltDoodads, type);
-    if (dflt == NULL)
-    {
-        dflt = NextDfltDoodad(si, info);
-        if (dflt != NULL)
-        {
-            dflt->name = None;
-            dflt->type = type;
-        }
-    }
-    return dflt;
-}
-
-/***====================================================================***/
-
-static Bool
-AddOverlay(SectionInfo * si, GeometryInfo * info, OverlayInfo * new)
-{
-    OverlayInfo *old;
-
-    for (old = si->overlays; old != NULL;
-         old = (OverlayInfo *) old->defs.next)
-    {
-        if (old->name == new->name)
-            break;
-    }
-    if (old != NULL)
-    {
-        if ((new->defs.merge == MergeReplace)
-            || (new->defs.merge == MergeOverride))
-        {
-            if (((old->defs.fileID == new->defs.fileID)
-                 && (warningLevel > 0)) || (warningLevel > 9))
-            {
-                WARN
-                    ("Multiple overlays named \"%s\" for section \"%s\"\n",
-                     XkbcAtomText(old->name), XkbcAtomText(si->name));
-                ACTION("Using last definition\n");
-            }
-            ClearOverlayInfo(old);
-            old->nKeys = new->nKeys;
-            old->keys = new->keys;
-            new->nKeys = 0;
-            new->keys = NULL;
-            return True;
-        }
-        if (((old->defs.fileID == new->defs.fileID) && (warningLevel > 0))
-            || (warningLevel > 9))
-        {
-            WARN("Multiple doodads named \"%s\" in section \"%s\"\n",
-                  XkbcAtomText(old->name), XkbcAtomText(si->name));
-            ACTION("Using first definition\n");
-        }
-        return True;
-    }
-    old = new;
-    new = uTypedCalloc(1, OverlayInfo);
-    if (!new)
-    {
-        if (warningLevel > 0)
-        {
-            WSGO("Couldn't allocate a new OverlayInfo\n");
-            ACTION
-                ("Overlay \"%s\" in section \"%s\" will be incomplete\n",
-                 XkbcAtomText(old->name), XkbcAtomText(si->name));
-        }
-        return False;
-    }
-    *new = *old;
-    old->nKeys = 0;
-    old->keys = NULL;
-    si->overlays = (OverlayInfo *) AddCommonInfo(&si->overlays->defs,
-                                                 (CommonInfo *) new);
-    si->nOverlays++;
-    return True;
-}
-
-/***====================================================================***/
-
-static SectionInfo *
-NextSection(GeometryInfo * info)
-{
-    SectionInfo *si;
-
-    si = uTypedAlloc(SectionInfo);
-    if (si)
-    {
-        *si = info->dfltSection;
-        si->defs.defined &= ~_GS_Default;
-        si->defs.next = NULL;
-        si->nRows = 0;
-        si->rows = NULL;
-        info->sections =
-            (SectionInfo *) AddCommonInfo(&info->sections->defs,
-                                          (CommonInfo *) si);
-        info->nSections++;
-    }
-    return si;
-}
-
-static SectionInfo *
-FindMatchingSection(GeometryInfo * info, SectionInfo * new)
-{
-    SectionInfo *old;
-
-    for (old = info->sections; old != NULL;
-         old = (SectionInfo *) old->defs.next)
-    {
-        if (new->name == old->name)
-            return old;
-    }
-    return NULL;
-}
-
-static Bool
-AddSection(GeometryInfo * info, SectionInfo * new)
-{
-    SectionInfo *old;
-
-    old = FindMatchingSection(info, new);
-    if (old != NULL)
-    {
-#ifdef NOTDEF
-        if ((new->defs.merge == MergeReplace)
-            || (new->defs.merge == MergeOverride))
-        {
-            SectionInfo *next = (SectionInfo *) old->defs.next;
-            if (((old->defs.fileID == new->defs.fileID)
-                 && (warningLevel > 0)) || (warningLevel > 9))
-            {
-                WARN("Duplicate shape name \"%s\"\n", shText(old));
-                ACTION("Using last definition\n");
-            }
-            *old = *new;
-            old->defs.next = &next->defs;
-            return True;
-        }
-        if (((old->defs.fileID == new->defs.fileID) && (warningLevel > 0))
-            || (warningLevel > 9))
-        {
-            WARN("Multiple shapes named \"%s\"\n", shText(old));
-            ACTION("Using first definition\n");
-        }
-        return True;
-#else
-        WARN("Don't know how to merge sections yet\n");
-#endif
-    }
-    old = new;
-    if ((new = NextSection(info)) == NULL)
-        return False;
-    *new = *old;
-    new->defs.next = NULL;
-    old->nRows = old->nDoodads = old->nOverlays = 0;
-    old->rows = NULL;
-    old->doodads = NULL;
-    old->overlays = NULL;
-    if (new->doodads)
-    {
-        DoodadInfo *di;
-        for (di = new->doodads; di; di = (DoodadInfo *) di->defs.next)
-        {
-            di->section = new;
-        }
-    }
-    return True;
-}
-
-/***====================================================================***/
-
-static RowInfo *
-NextRow(SectionInfo * si)
-{
-    RowInfo *row;
-
-    row = uTypedAlloc(RowInfo);
-    if (row)
-    {
-        *row = si->dfltRow;
-        row->defs.defined &= ~_GR_Default;
-        row->defs.next = NULL;
-        row->nKeys = 0;
-        row->keys = NULL;
-        si->rows =
-            (RowInfo *) AddCommonInfo(&si->rows->defs, (CommonInfo *) row);
-        row->index = si->nRows++;
-    }
-    return row;
-}
-
-static Bool
-AddRow(SectionInfo * si, RowInfo * new)
-{
-    RowInfo *old;
-
-    old = new;
-    if ((new = NextRow(si)) == NULL)
-        return False;
-    *new = *old;
-    new->defs.next = NULL;
-    old->nKeys = 0;
-    old->keys = NULL;
-    return True;
-}
-
-/***====================================================================***/
-
-static KeyInfo *
-NextKey(RowInfo * row)
-{
-    KeyInfo *key;
-
-    key = uTypedAlloc(KeyInfo);
-    if (key)
-    {
-        *key = row->dfltKey;
-        key->defs.defined &= ~_GK_Default;
-        key->defs.next = NULL;
-        key->index = row->nKeys++;
-    }
-    return key;
-}
-
-static Bool
-AddKey(RowInfo * row, KeyInfo * new)
-{
-    KeyInfo *old;
-
-    old = new;
-    if ((new = NextKey(row)) == NULL)
-        return False;
-    *new = *old;
-    new->defs.next = NULL;
-    row->keys =
-        (KeyInfo *) AddCommonInfo(&row->keys->defs, (CommonInfo *) new);
-    return True;
-}
-
-/***====================================================================***/
-
-static void
-MergeIncludedGeometry(GeometryInfo * into, GeometryInfo * from,
-                      unsigned merge)
-{
-    Bool clobber;
-
-    if (from->errorCount > 0)
-    {
-        into->errorCount += from->errorCount;
-        return;
-    }
-    clobber = (merge == MergeOverride) || (merge == MergeReplace);
-    if (into->name == NULL)
-    {
-        into->name = from->name;
-        from->name = NULL;
-    }
-    if ((into->widthMM == 0) || ((from->widthMM != 0) && clobber))
-        into->widthMM = from->widthMM;
-    if ((into->heightMM == 0) || ((from->heightMM != 0) && clobber))
-        into->heightMM = from->heightMM;
-    if ((into->font == None) || ((from->font != None) && clobber))
-        into->font = from->font;
-    if ((into->fontSlant == None) || ((from->fontSlant != None) && clobber))
-        into->fontSlant = from->fontSlant;
-    if ((into->fontWeight == None) || ((from->fontWeight != None) && clobber))
-        into->fontWeight = from->fontWeight;
-    if ((into->fontSetWidth == None)
-        || ((from->fontSetWidth != None) && clobber))
-        into->fontSetWidth = from->fontSetWidth;
-    if ((into->fontVariant == None)
-        || ((from->fontVariant != None) && clobber))
-        into->fontVariant = from->fontVariant;
-    if ((into->fontSize == 0) || ((from->fontSize != 0) && clobber))
-        into->fontSize = from->fontSize;
-    if ((into->fontEncoding == None)
-        || ((from->fontEncoding != None) && clobber))
-        into->fontEncoding = from->fontEncoding;
-    if ((into->fontSpec == None) || ((from->fontSpec != None) && clobber))
-        into->fontSpec = from->fontSpec;
-    if ((into->baseColor == None) || ((from->baseColor != None) && clobber))
-        into->baseColor = from->baseColor;
-    if ((into->labelColor == None) || ((from->labelColor != None) && clobber))
-        into->labelColor = from->labelColor;
-    into->nextPriority = from->nextPriority;
-    if (from->props != NULL)
-    {
-        PropertyInfo *pi;
-        for (pi = from->props; pi; pi = (PropertyInfo *) pi->defs.next)
-        {
-            if (!AddProperty(into, pi))
-                into->errorCount++;
-        }
-    }
-    if (from->shapes != NULL)
-    {
-        ShapeInfo *si;
-
-        for (si = from->shapes; si; si = (ShapeInfo *) si->defs.next)
-        {
-            if (!AddShape(into, si))
-                into->errorCount++;
-        }
-    }
-    if (from->sections != NULL)
-    {
-        SectionInfo *si;
-
-        for (si = from->sections; si; si = (SectionInfo *) si->defs.next)
-        {
-            if (!AddSection(into, si))
-                into->errorCount++;
-        }
-    }
-    if (from->doodads != NULL)
-    {
-        DoodadInfo *di;
-
-        for (di = from->doodads; di; di = (DoodadInfo *) di->defs.next)
-        {
-            if (!AddDoodad(NULL, into, di))
-                into->errorCount++;
-        }
-    }
-    if (!MergeAliases(&into->aliases, &from->aliases, merge))
-        into->errorCount++;
-}
-
-typedef void (*FileHandler) (XkbFile * /* file */ ,
-                             struct xkb_desc * /* xkb */ ,
-                             unsigned /* merge */ ,
-                             GeometryInfo *     /* info */
-    );
-
-static Bool
-HandleIncludeGeometry(IncludeStmt * stmt, struct xkb_desc * xkb, GeometryInfo * info,
-                      FileHandler hndlr)
-{
-    unsigned newMerge;
-    XkbFile *rtrn;
-    GeometryInfo included;
-    Bool haveSelf;
-
-    haveSelf = False;
-    if ((stmt->file == NULL) && (stmt->map == NULL))
-    {
-        haveSelf = True;
-        included = *info;
-        memset(info, 0, sizeof(GeometryInfo));
-    }
-    else if (ProcessIncludeFile(stmt, XkmGeometryIndex, &rtrn, &newMerge))
-    {
-        InitGeometryInfo(&included, rtrn->id, newMerge);
-        included.nextPriority = info->nextPriority;
-        included.dfltCornerRadius = info->dfltCornerRadius;
-        DupSectionInfo(&included.dfltSection, &info->dfltSection, info);
-        (*hndlr) (rtrn, xkb, MergeOverride, &included);
-        if (stmt->stmt != NULL)
-        {
-            free(included.name);
-            included.name = stmt->stmt;
-            stmt->stmt = NULL;
-        }
-        FreeXKBFile(rtrn);
-    }
-    else
-    {
-        info->errorCount += 10;
-        return False;
-    }
-    if ((stmt->next != NULL) && (included.errorCount < 1))
-    {
-        IncludeStmt *next;
-        unsigned op;
-        GeometryInfo next_incl;
-
-        for (next = stmt->next; next != NULL; next = next->next)
-        {
-            if ((next->file == NULL) && (next->map == NULL))
-            {
-                haveSelf = True;
-                MergeIncludedGeometry(&included, info, next->merge);
-                ClearGeometryInfo(info);
-            }
-            else if (ProcessIncludeFile(next, XkmGeometryIndex, &rtrn, &op))
-            {
-                InitGeometryInfo(&next_incl, rtrn->id, op);
-                next_incl.nextPriority = included.nextPriority;
-                next_incl.dfltCornerRadius = included.dfltCornerRadius;
-                DupSectionInfo(&next_incl.dfltSection,
-                               &included.dfltSection, &included);
-                (*hndlr) (rtrn, xkb, MergeOverride, &next_incl);
-                MergeIncludedGeometry(&included, &next_incl, op);
-                ClearGeometryInfo(&next_incl);
-                FreeXKBFile(rtrn);
-            }
-            else
-            {
-                info->errorCount += 10;
-                return False;
-            }
-        }
-    }
-    if (haveSelf)
-        *info = included;
-    else
-    {
-        MergeIncludedGeometry(info, &included, newMerge);
-        ClearGeometryInfo(&included);
-    }
-    return (info->errorCount == 0);
-}
-
-static int
-SetShapeField(ShapeInfo * si,
-              const char *field,
-              ExprDef * arrayNdx, ExprDef * value, GeometryInfo * info)
-{
-    ExprResult tmp;
-
-    if ((uStrCaseCmp(field, "radius") == 0)
-        || (uStrCaseCmp(field, "corner") == 0)
-        || (uStrCaseCmp(field, "cornerradius") == 0))
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("key shape", field, shText(si));
-        }
-        if (!ExprResolveFloat(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("key shape", field, shText(si), "number");
-        }
-        if (si)
-            si->dfltCornerRadius = tmp.ival;
-        else
-            info->dfltCornerRadius = tmp.ival;
-        return True;
-    }
-    info->errorCount++;
-    return ReportBadField("key shape", field, shText(si));
-}
-
-static int
-SetShapeDoodadField(DoodadInfo * di,
-                    char *field,
-                    ExprDef * arrayNdx,
-                    ExprDef * value, SectionInfo * si, GeometryInfo * info)
-{
-    ExprResult tmp;
-    const char *typeName;
-
-    typeName =
-        (di->type == XkbSolidDoodad ? "solid doodad" : "outline doodad");
-    if ((!uStrCaseCmp(field, "corner"))
-        || (!uStrCaseCmp(field, "cornerradius")))
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray(typeName, field, ddText(di));
-        }
-        if (!ExprResolveFloat(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType(typeName, field, ddText(di), "number");
-        }
-        di->defs.defined |= _GD_Corner;
-        di->corner = tmp.ival;
-        return True;
-    }
-    else if (uStrCaseCmp(field, "angle") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray(typeName, field, ddText(di));
-        }
-        if (!ExprResolveFloat(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType(typeName, field, ddText(di), "number");
-        }
-        di->defs.defined |= _GD_Angle;
-        di->angle = tmp.ival;
-        return True;
-    }
-    else if (uStrCaseCmp(field, "shape") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray(typeName, field, ddText(di));
-        }
-        if (!ExprResolveString(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType(typeName, field, ddText(di), "string");
-        }
-        di->shape = xkb_intern_atom(tmp.str);
-        di->defs.defined |= _GD_Shape;
-        free(tmp.str);
-        return True;
-    }
-    return ReportBadField(typeName, field, ddText(di));
-}
-
-#define        FIELD_STRING    0
-#define        FIELD_SHORT     1
-#define        FIELD_USHORT    2
-
-static int
-SetTextDoodadField(DoodadInfo * di,
-                   char *field,
-                   ExprDef * arrayNdx,
-                   ExprDef * value, SectionInfo * si, GeometryInfo * info)
-{
-    ExprResult tmp;
-    unsigned def;
-    unsigned type;
-    const char *typeName = "text doodad";
-    union
-    {
-        uint32_t *str;
-        short *ival;
-        unsigned short *uval;
-    } pField;
-
-    if (uStrCaseCmp(field, "angle") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray(typeName, field, ddText(di));
-        }
-        if (!ExprResolveFloat(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType(typeName, field, ddText(di), "number");
-        }
-        di->defs.defined |= _GD_Angle;
-        di->angle = tmp.ival;
-        return True;
-    }
-    if (uStrCaseCmp(field, "width") == 0)
-    {
-        type = FIELD_USHORT;
-        pField.uval = &di->width;
-        def = _GD_Width;
-    }
-    else if (uStrCaseCmp(field, "height") == 0)
-    {
-        type = FIELD_USHORT;
-        pField.uval = &di->height;
-        def = _GD_Height;
-    }
-    else if (uStrCaseCmp(field, "text") == 0)
-    {
-        type = FIELD_STRING;
-        pField.str = &di->text;
-        def = _GD_Text;
-    }
-    else if (uStrCaseCmp(field, "font") == 0)
-    {
-        type = FIELD_STRING;
-        pField.str = &di->font;
-        def = _GD_Font;
-    }
-    else if ((uStrCaseCmp(field, "fontslant") == 0) ||
-             (uStrCaseCmp(field, "slant") == 0))
-    {
-        type = FIELD_STRING;
-        pField.str = &di->fontSlant;
-        def = _GD_FontSlant;
-    }
-    else if ((uStrCaseCmp(field, "fontweight") == 0) ||
-             (uStrCaseCmp(field, "weight") == 0))
-    {
-        type = FIELD_STRING;
-        pField.str = &di->fontWeight;
-        def = _GD_FontWeight;
-    }
-    else if ((uStrCaseCmp(field, "fontwidth") == 0) ||
-             (uStrCaseCmp(field, "setwidth") == 0))
-    {
-        type = FIELD_STRING;
-        pField.str = &di->fontSetWidth;
-        def = _GD_FontSetWidth;
-    }
-    else if ((uStrCaseCmp(field, "fontvariant") == 0) ||
-             (uStrCaseCmp(field, "variant") == 0))
-    {
-        type = FIELD_STRING;
-        pField.str = &di->fontVariant;
-        def = _GD_FontVariant;
-    }
-    else if ((uStrCaseCmp(field, "fontencoding") == 0) ||
-             (uStrCaseCmp(field, "encoding") == 0))
-    {
-        type = FIELD_STRING;
-        pField.str = &di->fontEncoding;
-        def = _GD_FontEncoding;
-    }
-    else if ((uStrCaseCmp(field, "xfont") == 0) ||
-             (uStrCaseCmp(field, "xfontname") == 0))
-    {
-        type = FIELD_STRING;
-        pField.str = &di->fontSpec;
-        def = _GD_FontSpec;
-    }
-    else if (uStrCaseCmp(field, "fontsize") == 0)
-    {
-        type = FIELD_USHORT;
-        pField.uval = &di->fontSize;
-        def = _GD_FontSize;
-    }
-    else
-    {
-        return ReportBadField(typeName, field, ddText(di));
-    }
-    if (arrayNdx != NULL)
-    {
-        info->errorCount++;
-        return ReportNotArray(typeName, field, ddText(di));
-    }
-    if (type == FIELD_STRING)
-    {
-        if (!ExprResolveString(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType(typeName, field, ddText(di), "string");
-        }
-        di->defs.defined |= def;
-        *pField.str = xkb_intern_atom(tmp.str);
-        free(tmp.str);
-    }
-    else
-    {
-        if (!ExprResolveFloat(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType(typeName, field, ddText(di), "number");
-        }
-        if ((type == FIELD_USHORT) && (tmp.ival < 0))
-        {
-            info->errorCount++;
-            return
-                ReportBadType(typeName, field, ddText(di), "unsigned");
-        }
-        di->defs.defined |= def;
-        if (type == FIELD_USHORT)
-            *pField.uval = tmp.uval;
-        else
-            *pField.ival = tmp.ival;
-    }
-    return True;
-}
-
-static int
-SetIndicatorDoodadField(DoodadInfo * di,
-                        char *field,
-                        ExprDef * arrayNdx,
-                        ExprDef * value,
-                        SectionInfo * si, GeometryInfo * info)
-{
-    ExprResult tmp;
-
-    if ((uStrCaseCmp(field, "oncolor") == 0)
-        || (uStrCaseCmp(field, "offcolor") == 0)
-        || (uStrCaseCmp(field, "shape") == 0))
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("indicator doodad", field, ddText(di));
-        }
-        if (!ExprResolveString(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("indicator doodad", field,
-                                 ddText(di), "string");
-        }
-        if (uStrCaseCmp(field, "oncolor") == 0)
-        {
-            di->defs.defined |= _GD_Color;
-            di->color = xkb_intern_atom(tmp.str);
-        }
-        else if (uStrCaseCmp(field, "offcolor") == 0)
-        {
-            di->defs.defined |= _GD_OffColor;
-            di->offColor = xkb_intern_atom(tmp.str);
-        }
-        else if (uStrCaseCmp(field, "shape") == 0)
-        {
-            di->defs.defined |= _GD_Shape;
-            di->shape = xkb_intern_atom(tmp.str);
-        }
-        free(tmp.str);
-        return True;
-    }
-    return ReportBadField("indicator doodad", field, ddText(di));
-}
-
-static int
-SetLogoDoodadField(DoodadInfo * di,
-                   char *field,
-                   ExprDef * arrayNdx,
-                   ExprDef * value, SectionInfo * si, GeometryInfo * info)
-{
-    ExprResult tmp;
-    const char *typeName = "logo doodad";
-
-    if ((!uStrCaseCmp(field, "corner"))
-        || (!uStrCaseCmp(field, "cornerradius")))
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray(typeName, field, ddText(di));
-        }
-        if (!ExprResolveFloat(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType(typeName, field, ddText(di), "number");
-        }
-        di->defs.defined |= _GD_Corner;
-        di->corner = tmp.ival;
-        return True;
-    }
-    else if (uStrCaseCmp(field, "angle") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray(typeName, field, ddText(di));
-        }
-        if (!ExprResolveFloat(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType(typeName, field, ddText(di), "number");
-        }
-        di->defs.defined |= _GD_Angle;
-        di->angle = tmp.ival;
-        return True;
-    }
-    else if (uStrCaseCmp(field, "shape") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray(typeName, field, ddText(di));
-        }
-        if (!ExprResolveString(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType(typeName, field, ddText(di), "string");
-        }
-        di->shape = xkb_intern_atom(tmp.str);
-        free(tmp.str);
-        di->defs.defined |= _GD_Shape;
-        return True;
-    }
-    else if ((!uStrCaseCmp(field, "logoname"))
-             || (!uStrCaseCmp(field, "name")))
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray(typeName, field, ddText(di));
-        }
-        if (!ExprResolveString(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType(typeName, field, ddText(di),
-                                 "string");
-        }
-        di->logoName = _XkbDupString(tmp.str);
-        free(tmp.str);
-        return True;
-    }
-    return ReportBadField(typeName, field, ddText(di));
-}
-
-static int
-SetDoodadField(DoodadInfo * di,
-               char *field,
-               ExprDef * arrayNdx,
-               ExprDef * value, SectionInfo * si, GeometryInfo * info)
-{
-    ExprResult tmp;
-
-    if (uStrCaseCmp(field, "priority") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("doodad", field, ddText(di));
-        }
-        if (!ExprResolveInteger(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("doodad", field, ddText(di), "integer");
-        }
-        if ((tmp.ival < 0) || (tmp.ival > XkbGeomMaxPriority))
-        {
-            info->errorCount++;
-            ERROR("Doodad priority %d out of range (must be 0..%d)\n",
-                   tmp.ival, XkbGeomMaxPriority);
-            ACTION("Priority for doodad %s not changed", ddText(di));
-            return False;
-        }
-        di->defs.defined |= _GD_Priority;
-        di->priority = tmp.ival;
-        return True;
-    }
-    else if (uStrCaseCmp(field, "left") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("doodad", field, ddText(di));
-        }
-        if (!ExprResolveFloat(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("doodad", field, ddText(di), "number");
-        }
-        di->defs.defined |= _GD_Left;
-        di->left = tmp.ival;
-        return True;
-    }
-    else if (uStrCaseCmp(field, "top") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("doodad", field, ddText(di));
-        }
-        if (!ExprResolveFloat(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("doodad", field, ddText(di), "number");
-        }
-        di->defs.defined |= _GD_Top;
-        di->top = tmp.ival;
-        return True;
-    }
-    else if (uStrCaseCmp(field, "color") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("doodad", field, ddText(di));
-        }
-        if (!ExprResolveString(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("doodad", field, ddText(di), "string");
-        }
-        di->defs.defined |= _GD_Color;
-        di->color = xkb_intern_atom(tmp.str);
-        free(tmp.str);
-        return True;
-    }
-    switch (di->type)
-    {
-    case XkbOutlineDoodad:
-    case XkbSolidDoodad:
-        return SetShapeDoodadField(di, field, arrayNdx, value, si, info);
-    case XkbTextDoodad:
-        return SetTextDoodadField(di, field, arrayNdx, value, si, info);
-    case XkbIndicatorDoodad:
-        return SetIndicatorDoodadField(di, field, arrayNdx, value, si, info);
-    case XkbLogoDoodad:
-        return SetLogoDoodadField(di, field, arrayNdx, value, si, info);
-    }
-    WSGO("Unknown doodad type %d in SetDoodadField\n",
-          (unsigned int) di->type);
-    ACTION("Definition of %s in %s ignored\n", field, ddText(di));
-    return False;
-}
-
-static int
-SetSectionField(SectionInfo * si,
-                char *field,
-                ExprDef * arrayNdx, ExprDef * value, GeometryInfo * info)
-{
-    unsigned short *pField;
-    unsigned def;
-    ExprResult tmp;
-
-    pField = NULL;
-    if (uStrCaseCmp(field, "priority") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("keyboard section", field, scText(si));
-        }
-        if (!ExprResolveInteger(value, &tmp))
-        {
-            info->errorCount++;
-            ReportBadType("keyboard section", field, scText(si), "integer");
-            return False;
-        }
-        if ((tmp.ival < 0) || (tmp.ival > XkbGeomMaxPriority))
-        {
-            info->errorCount++;
-            ERROR("Section priority %d out of range (must be 0..%d)\n",
-                   tmp.ival, XkbGeomMaxPriority);
-            ACTION("Priority for section %s not changed", scText(si));
-            return False;
-        }
-        si->priority = tmp.ival;
-        si->defs.defined |= _GS_Priority;
-        return True;
-    }
-    else if (uStrCaseCmp(field, "top") == 0)
-    {
-        pField = &si->top;
-        def = _GS_Top;
-    }
-    else if (uStrCaseCmp(field, "left") == 0)
-    {
-        pField = &si->left;
-        def = _GS_Left;
-    }
-    else if (uStrCaseCmp(field, "width") == 0)
-    {
-        pField = &si->width;
-        def = _GS_Width;
-    }
-    else if (uStrCaseCmp(field, "height") == 0)
-    {
-        pField = &si->height;
-        def = _GS_Height;
-    }
-    else if (uStrCaseCmp(field, "angle") == 0)
-    {
-        pField = &si->angle;
-        def = _GS_Angle;
-    }
-    else
-    {
-        info->errorCount++;
-        return ReportBadField("keyboard section", field, scText(si));
-    }
-    if (arrayNdx != NULL)
-    {
-        info->errorCount++;
-        return ReportNotArray("keyboard section", field, scText(si));
-    }
-    if (!ExprResolveFloat(value, &tmp))
-    {
-        info->errorCount++;
-        ReportBadType("keyboard section", field, scText(si), "number");
-        return False;
-    }
-    si->defs.defined |= def;
-    *pField = tmp.uval;
-    return True;
-}
-
-static int
-SetRowField(RowInfo * row,
-            char *field,
-            ExprDef * arrayNdx, ExprDef * value, GeometryInfo * info)
-{
-    ExprResult tmp;
-
-    if (uStrCaseCmp(field, "top") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("keyboard row", field, rowText(row));
-        }
-        if (!ExprResolveFloat(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("keyboard row", field, rowText(row),
-                                 "number");
-        }
-        row->defs.defined |= _GR_Top;
-        row->top = tmp.uval;
-    }
-    else if (uStrCaseCmp(field, "left") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("keyboard row", field, rowText(row));
-        }
-        if (!ExprResolveFloat(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("keyboard row", field, rowText(row),
-                                 "number");
-        }
-        row->defs.defined |= _GR_Left;
-        row->left = tmp.uval;
-    }
-    else if (uStrCaseCmp(field, "vertical") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("keyboard row", field, rowText(row));
-        }
-        if (!ExprResolveBoolean(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("keyboard row", field, rowText(row),
-                                 "boolean");
-        }
-        row->defs.defined |= _GR_Vertical;
-        row->vertical = tmp.uval;
-    }
-    else
-    {
-        info->errorCount++;
-        return ReportBadField("keyboard row", field, rowText(row));
-    }
-    return True;
-}
-
-static int
-SetKeyField(KeyInfo * key,
-            const char *field,
-            ExprDef * arrayNdx, ExprDef * value, GeometryInfo * info)
-{
-    ExprResult tmp;
-
-    if (uStrCaseCmp(field, "gap") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("key", field, keyText(key));
-        }
-        if (!ExprResolveFloat(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("key", field, keyText(key), "number");
-        }
-        key->defs.defined |= _GK_Gap;
-        key->gap = tmp.ival;
-    }
-    else if (uStrCaseCmp(field, "shape") == 0)
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("key", field, keyText(key));
-        }
-        if (!ExprResolveString(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("key", field, keyText(key), "string");
-        }
-        key->defs.defined |= _GK_Shape;
-        key->shape = xkb_intern_atom(tmp.str);
-        free(tmp.str);
-    }
-    else if ((uStrCaseCmp(field, "color") == 0) ||
-             (uStrCaseCmp(field, "keycolor") == 0))
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("key", field, keyText(key));
-        }
-        if (!ExprResolveString(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("key", field, keyText(key), "string");
-        }
-        key->defs.defined |= _GK_Color;
-        key->color = xkb_intern_atom(tmp.str);
-        free(tmp.str);
-    }
-    else if ((uStrCaseCmp(field, "name") == 0)
-             || (uStrCaseCmp(field, "keyname") == 0))
-    {
-        if (arrayNdx != NULL)
-        {
-            info->errorCount++;
-            return ReportNotArray("key", field, keyText(key));
-        }
-        if (!ExprResolveKeyName(value, &tmp))
-        {
-            info->errorCount++;
-            return ReportBadType("key", field, keyText(key), "key name");
-        }
-        key->defs.defined |= _GK_Name;
-        memset(key->name, 0, XkbKeyNameLength + 1);
-        strncpy(key->name, tmp.keyName.name, XkbKeyNameLength);
-    }
-    else
-    {
-        info->errorCount++;
-        return ReportBadField("key", field, keyText(key));
-    }
-    return True;
-}
-
-static int
-SetGeometryProperty(GeometryInfo * info, char *property, ExprDef * value)
-{
-    PropertyInfo pi;
-    ExprResult result;
-    int ret;
-
-    InitPropertyInfo(&pi, info);
-    pi.name = property;
-    if (!ExprResolveString(value, &result))
-    {
-        info->errorCount++;
-        ERROR("Property values must be type string\n");
-        ACTION("Ignoring illegal definition of \"%s\" property\n", property);
-        return False;
-    }
-    pi.value = result.str;
-    ret = AddProperty(info, &pi);
-    free(pi.value);
-    return ret;
-}
-
-static int
-HandleGeometryVar(VarDef * stmt, struct xkb_desc * xkb, GeometryInfo * info)
-{
-    ExprResult elem, field, tmp;
-    ExprDef *ndx;
-    DoodadInfo *di;
-    uint32_t *pField = NULL;
-    int ret = True; /* default to no error */
-
-    if (ExprResolveLhs(stmt->name, &elem, &field, &ndx) == 0)
-        return 0;               /* internal error, already reported */
-
-    if (elem.str) {
-        if (uStrCaseCmp(elem.str, "shape") == 0)
-            ret = SetShapeField(NULL, field.str, ndx, stmt->value, info);
-        else if (uStrCaseCmp(elem.str, "key") == 0)
-            ret = SetKeyField(&info->dfltSection.dfltRow.dfltKey,
-                               field.str, ndx, stmt->value, info);
-        else if (uStrCaseCmp(elem.str, "row") == 0)
-            ret = SetRowField(&info->dfltSection.dfltRow, field.str, ndx,
-                               stmt->value, info);
-        else if (uStrCaseCmp(elem.str, "section") == 0)
-            ret = SetSectionField(&info->dfltSection, field.str, ndx,
-                                   stmt->value, info);
-        else if (uStrCaseCmp(elem.str, "property") == 0)
-        {
-            if (ndx != NULL)
-            {
-                info->errorCount++;
-                ERROR("The %s geometry property is not an array\n", field.str);
-                ACTION("Ignoring illegal property definition\n");
-                ret = False;
-            }
-            else {
-                ret = SetGeometryProperty(info, field.str, stmt->value);
-            }
-        }
-        else if ((di = FindDfltDoodadByTypeName(elem.str, NULL, info)) != NULL)
-            ret = SetDoodadField(di, field.str, ndx, stmt->value, NULL, info);
-        else if (uStrCaseCmp(elem.str, "solid") == 0)
-        {
-            DoodadInfo *dflt;
-            dflt = FindDoodadByType(info->dfltDoodads, XkbSolidDoodad);
-            if (dflt == NULL)
-                dflt = NextDfltDoodad(NULL, info);
-            ret = SetDoodadField(dflt, field.str, ndx, stmt->value, NULL, info);
-        }
-        else if (uStrCaseCmp(elem.str, "outline") == 0)
-        {
-            DoodadInfo *dflt;
-            dflt = FindDoodadByType(info->dfltDoodads, XkbOutlineDoodad);
-            if (dflt == NULL)
-                dflt = NextDfltDoodad(NULL, info);
-            ret = SetDoodadField(dflt, field.str, ndx, stmt->value, NULL, info);
-        }
-        else if (uStrCaseCmp(elem.str, "text") == 0)
-        {
-            DoodadInfo *dflt;
-            dflt = FindDoodadByType(info->dfltDoodads, XkbTextDoodad);
-            if (dflt == NULL)
-                dflt = NextDfltDoodad(NULL, info);
-            ret = SetDoodadField(dflt, field.str, ndx, stmt->value, NULL, info);
-        }
-        else if (uStrCaseCmp(elem.str, "indicator") == 0)
-        {
-            DoodadInfo *dflt;
-            dflt = FindDoodadByType(info->dfltDoodads, XkbIndicatorDoodad);
-            if (dflt == NULL)
-                dflt = NextDfltDoodad(NULL, info);
-            ret = SetDoodadField(dflt, field.str, ndx, stmt->value, NULL, info);
-        }
-        else if (uStrCaseCmp(elem.str, "logo") == 0)
-        {
-            DoodadInfo *dflt;
-            dflt = FindDoodadByType(info->dfltDoodads, XkbLogoDoodad);
-            if (dflt == NULL)
-                dflt = NextDfltDoodad(NULL, info);
-            ret = SetDoodadField(dflt, field.str, ndx, stmt->value, NULL, info);
-        }
-        else
-        {
-            WARN("Assignment to field of unknown element\n");
-            ACTION("No value assigned to %s.%s\n", elem.str, field.str);
-            ret = False;
-        }
-        free(elem.str);
-        free(field.str);
-        return ret;
-    }
-
-    if ((uStrCaseCmp(field.str, "width") == 0) ||
-        (uStrCaseCmp(field.str, "widthmm") == 0))
-    {
-        if (ndx != NULL)
-        {
-            info->errorCount++;
-            ret = ReportNotArray("keyboard", field.str, "geometry");
-        }
-        else if (!ExprResolveFloat(stmt->value, &tmp))
-        {
-            info->errorCount++;
-            ret = ReportBadType("keyboard", field.str, "geometry", "number");
-        }
-        else if (tmp.ival < 1)
-        {
-            WARN("Keyboard width must be positive\n");
-            ACTION("Ignoring illegal keyboard width %s\n",
-                    XkbcGeomFPText(tmp.ival));
-            ret = True;
-        }
-        else {
-            if (info->widthMM != 0)
-            {
-                WARN("Keyboard width multiply defined\n");
-                ACTION("Using last definition (%s),", XkbcGeomFPText(tmp.ival));
-                INFO(" ignoring first (%s)\n", XkbcGeomFPText(info->widthMM));
-            }
-            info->widthMM = tmp.ival;
-            ret = True;
-        }
-        free(field.str);
-        return ret;
-    }
-    else if ((uStrCaseCmp(field.str, "height") == 0) ||
-             (uStrCaseCmp(field.str, "heightmm") == 0))
-    {
-        if (ndx != NULL)
-        {
-            info->errorCount++;
-            ret = ReportNotArray("keyboard", field.str, "geometry");
-        }
-        else if (!ExprResolveFloat(stmt->value, &tmp))
-        {
-            info->errorCount++;
-            ret = ReportBadType("keyboard", field.str, "geometry", "number");
-        }
-        else if (tmp.ival < 1)
-        {
-            WARN("Keyboard height must be positive\n");
-            ACTION("Ignoring illegal keyboard height %s\n",
-                    XkbcGeomFPText(tmp.ival));
-            ret = True;
-        }
-        else {
-            if (info->heightMM != 0)
-            {
-                WARN("Keyboard height multiply defined\n");
-                ACTION("Using last definition (%s),", XkbcGeomFPText(tmp.ival));
-                INFO(" ignoring first (%s)\n", XkbcGeomFPText(info->heightMM));
-            }
-            info->heightMM = tmp.ival;
-            ret = True;
-        }
-        free(field.str);
-        return ret;
-    }
-    else if (uStrCaseCmp(field.str, "fontsize") == 0)
-    {
-        if (ndx != NULL)
-        {
-            info->errorCount++;
-            ret = ReportNotArray("keyboard", field.str, "geometry");
-        }
-        else if (!ExprResolveFloat(stmt->value, &tmp))
-        {
-            info->errorCount++;
-            ret = ReportBadType("keyboard", field.str, "geometry", "number");
-        }
-        else if ((tmp.ival < 40) || (tmp.ival > 2550))
-        {
-            info->errorCount++;
-            ERROR("Illegal font size %d (must be 4..255)\n", tmp.ival);
-            ACTION("Ignoring font size in keyboard geometry\n");
-            ret = False;
-        }
-        else {
-            info->fontSize = tmp.ival;
-            ret = True;
-        }
-        free(field.str);
-        return ret;
-    }
-    else if ((uStrCaseCmp(field.str, "color") == 0) ||
-             (uStrCaseCmp(field.str, "basecolor") == 0))
-    {
-        if (ndx != NULL)
-        {
-            info->errorCount++;
-            ret = ReportNotArray("keyboard", field.str, "geometry");
-        }
-        else if (!ExprResolveString(stmt->value, &tmp))
-        {
-            info->errorCount++;
-            ret = ReportBadType("keyboard", field.str, "geometry", "string");
-        }
-        else {
-            info->baseColor = xkb_intern_atom(tmp.str);
-            free(tmp.str);
-            ret = True;
-        }
-        free(field.str);
-        return ret;
-    }
-    else if (uStrCaseCmp(field.str, "labelcolor") == 0)
-    {
-        if (ndx != NULL)
-        {
-            info->errorCount++;
-            ret = ReportNotArray("keyboard", field.str, "geometry");
-        }
-        else if (!ExprResolveString(stmt->value, &tmp))
-        {
-            info->errorCount++;
-            ret = ReportBadType("keyboard", field.str, "geometry", "string");
-        }
-        else {
-            info->labelColor = xkb_intern_atom(tmp.str);
-            free(tmp.str);
-            ret = True;
-        }
-        free(field.str);
-        return ret;
-    }
-    else if (uStrCaseCmp(field.str, "font") == 0)
-    {
-        pField = &info->font;
-    }
-    else if ((uStrCaseCmp(field.str, "fontslant") == 0) ||
-             (uStrCaseCmp(field.str, "slant") == 0))
-    {
-        pField = &info->fontSlant;
-    }
-    else if ((uStrCaseCmp(field.str, "fontweight") == 0) ||
-             (uStrCaseCmp(field.str, "weight") == 0))
-    {
-        pField = &info->fontWeight;
-    }
-    else if ((uStrCaseCmp(field.str, "fontwidth") == 0) ||
-             (uStrCaseCmp(field.str, "setwidth") == 0))
-    {
-        pField = &info->fontWeight;
-    }
-    else if ((uStrCaseCmp(field.str, "fontencoding") == 0) ||
-             (uStrCaseCmp(field.str, "encoding") == 0))
-    {
-        pField = &info->fontEncoding;
-    }
-    else if ((uStrCaseCmp(field.str, "xfont") == 0) ||
-             (uStrCaseCmp(field.str, "xfontname") == 0))
-    {
-        pField = &info->fontSpec;
-    }
-    else
-    {
-        ret = SetGeometryProperty(info, field.str, stmt->value);
-        free(field.str);
-        return ret;
-    }
-
-    /* fallthrough for the cases that set pField */
-    if (ndx != NULL)
-    {
-        info->errorCount++;
-        ret = ReportNotArray("keyboard", field.str, "geometry");
-    }
-    else if (!ExprResolveString(stmt->value, &tmp))
-    {
-        info->errorCount++;
-        ret = ReportBadType("keyboard", field.str, "geometry", "string");
-    }
-    else {
-        *pField = xkb_intern_atom(tmp.str);
-        free(tmp.str);
-    }
-    free(field.str);
-    return ret;
-}
-
-/***====================================================================***/
-
-static Bool
-HandleShapeBody(ShapeDef * def, ShapeInfo * si, unsigned merge,
-                GeometryInfo * info)
-{
-    OutlineDef *ol;
-    int nOut, nPt;
-    struct xkb_outline * outline;
-    ExprDef *pt;
-
-    if (def->nOutlines < 1)
-    {
-        WARN("Shape \"%s\" has no outlines\n", shText(si));
-        ACTION("Definition ignored\n");
-        return True;
-    }
-    si->nOutlines = def->nOutlines;
-    si->outlines = uTypedCalloc(def->nOutlines, struct xkb_outline);
-    if (!si->outlines)
-    {
-        ERROR("Couldn't allocate outlines for \"%s\"\n", shText(si));
-        ACTION("Definition ignored\n");
-        info->errorCount++;
-        return False;
-    }
-    for (nOut = 0, ol = def->outlines; ol != NULL;
-         ol = (OutlineDef *) ol->common.next)
-    {
-        if (ol->nPoints < 1)
-        {
-            SetShapeField(si, XkbcAtomText(ol->field), NULL, ol->points, info);
-            continue;
-        }
-        outline = NULL;
-        outline = &si->outlines[nOut++];
-        outline->num_points = ol->nPoints;
-        outline->corner_radius = si->dfltCornerRadius;
-        outline->points = uTypedCalloc(ol->nPoints, struct xkb_point);
-        if (!outline->points)
-        {
-            ERROR("Can't allocate points for \"%s\"\n", shText(si));
-            ACTION("Definition ignored\n");
-            /* XXX leaks */
-            info->errorCount++;
-            return False;
-        }
-        for (nPt = 0, pt = ol->points; pt != NULL;
-             pt = (ExprDef *) pt->common.next)
-        {
-            outline->points[nPt].x = pt->value.coord.x;
-            outline->points[nPt].y = pt->value.coord.y;
-            nPt++;
-        }
-        if (ol->field != None)
-        {
-            const char *str = XkbcAtomText(ol->field);
-            if ((uStrCaseCmp(str, "approximation") == 0) ||
-                (uStrCaseCmp(str, "approx") == 0))
-            {
-                if (si->approx == NULL)
-                    si->approx = outline;
-                else
-                {
-                    WARN("Multiple approximations for \"%s\"\n",
-                          shText(si));
-                    ACTION("Treating all but the first as normal outlines\n");
-                }
-            }
-            else if (uStrCaseCmp(str, "primary") == 0)
-            {
-                if (si->primary == NULL)
-                    si->primary = outline;
-                else
-                {
-                    WARN("Multiple primary outlines for \"%s\"\n",
-                          shText(si));
-                    ACTION("Treating all but the first as normal outlines\n");
-                }
-            }
-            else
-            {
-                WARN("Unknown outline type %s for \"%s\"\n", str,
-                      shText(si));
-                ACTION("Treated as a normal outline\n");
-            }
-        }
-    }
-    if (nOut != si->nOutlines)
-    {
-        WSGO("Expected %d outlines, got %d\n",
-              (unsigned int) si->nOutlines, nOut);
-        si->nOutlines = nOut;
-    }
-    return True;
-}
-
-static int
-HandleShapeDef(ShapeDef * def, struct xkb_desc * xkb, unsigned merge,
-               GeometryInfo * info)
-{
-    ShapeInfo si;
-
-    if (def->merge != MergeDefault)
-        merge = def->merge;
-
-    memset(&si, 0, sizeof(ShapeInfo));
-    si.defs.merge = merge;
-    si.name = def->name;
-    si.dfltCornerRadius = info->dfltCornerRadius;
-    if (!HandleShapeBody(def, &si, merge, info))
-        return False;
-    if (!AddShape(info, &si))
-        return False;
-    return True;
-}
-
-/***====================================================================***/
-
-static int
-HandleDoodadDef(DoodadDef * def,
-                unsigned merge, SectionInfo * si, GeometryInfo * info)
-{
-    ExprResult elem, field;
-    ExprDef *ndx;
-    DoodadInfo new;
-    VarDef *var;
-
-    if (def->common.stmtType == StmtIndicatorMapDef)
-    {
-        def->common.stmtType = StmtDoodadDef;
-        def->type = XkbIndicatorDoodad;
-    }
-    InitDoodadInfo(&new, def->type, si, info);
-    new.name = def->name;
-    for (var = def->body; var != NULL; var = (VarDef *) var->common.next)
-    {
-        if (ExprResolveLhs(var->name, &elem, &field, &ndx) == 0)
-            return 0;           /* internal error, already reported */
-        if (elem.str != NULL)
-        {
-            WARN("Assignment to field of unknown element in doodad %s\n",
-                  ddText(&new));
-            ACTION("No value assigned to %s.%s\n", elem.str, field.str);
-            free(elem.str);
-        }
-        else if (!SetDoodadField(&new, field.str, ndx, var->value, si, info)) {
-            free(field.str);
-            return False;
-        }
-        free(field.str);
-    }
-    if (!AddDoodad(si, info, &new))
-        return False;
-    ClearDoodadInfo(&new);
-    return True;
-}
-
-/***====================================================================***/
-
-static int
-HandleOverlayDef(OverlayDef * def,
-                 unsigned merge, SectionInfo * si, GeometryInfo * info)
-{
-    OverlayKeyDef *keyDef;
-    OverlayKeyInfo *key;
-    OverlayInfo ol;
-
-    if ((def->nKeys < 1) && (warningLevel > 3))
-    {
-        WARN("Overlay \"%s\" in section \"%s\" has no keys\n",
-              XkbcAtomText(def->name), scText(si));
-        ACTION("Overlay ignored\n");
-        return True;
-    }
-    memset(&ol, 0, sizeof(OverlayInfo));
-    ol.name = def->name;
-    for (keyDef = def->keys; keyDef;
-         keyDef = (OverlayKeyDef *) keyDef->common.next)
-    {
-        key = uTypedCalloc(1, OverlayKeyInfo);
-        if (!key)
-        {
-            if (warningLevel > 0)
-            {
-                WSGO("Couldn't allocate OverlayKeyInfo\n");
-                ACTION("Overlay %s for section %s will be incomplete\n",
-                        XkbcAtomText(ol.name), scText(si));
-            }
-            return False;
-        }
-        strncpy(key->over, keyDef->over, XkbKeyNameLength);
-        strncpy(key->under, keyDef->under, XkbKeyNameLength);
-        key->sectionRow = _GOK_UnknownRow;
-        key->overlayRow = _GOK_UnknownRow;
-        ol.keys = (OverlayKeyInfo *) AddCommonInfo(&ol.keys->defs,
-                                                   (CommonInfo *) key);
-        ol.nKeys++;
-    }
-    if (!AddOverlay(si, info, &ol))
-        return False;
-    ClearOverlayInfo(&ol);
-    return True;
-}
-
-/***====================================================================***/
-
-static Bool
-HandleComplexKey(KeyDef * def, KeyInfo * key, GeometryInfo * info)
-{
-    ExprDef *expr;
-
-    for (expr = def->expr; expr != NULL; expr = (ExprDef *) expr->common.next)
-    {
-        if (expr->op == OpAssign)
-        {
-            ExprResult elem, f;
-            ExprDef *ndx;
-            if (ExprResolveLhs(expr->value.binary.left, &elem, &f, &ndx) == 0)
-                return False;   /* internal error, already reported */
-            if ((elem.str == NULL) || (uStrCaseCmp(elem.str, "key") == 0))
-            {
-                if (!SetKeyField
-                    (key, f.str, ndx, expr->value.binary.right, info))
-                {
-                    free(elem.str);
-                    free(f.str);
-                    return False;
-                }
-                free(elem.str);
-                free(f.str);
-            }
-            else
-            {
-                ERROR("Illegal element used in a key definition\n");
-                ACTION("Assignment to %s.%s ignored\n", elem.str, f.str);
-                free(elem.str);
-                free(f.str);
-                return False;
-            }
-        }
-        else
-        {
-            RowInfo *row = key->row;
-            switch (expr->type)
-            {
-            case TypeInt:
-            case TypeFloat:
-                if (!SetKeyField(key, "gap", NULL, expr, info))
-                    return False;
-                break;
-            case TypeString:
-                if (!SetKeyField(key, "shape", NULL, expr, info))
-                    return False;
-                break;
-            case TypeKeyName:
-                if (!SetKeyField(key, "name", NULL, expr, info))
-                    return False;
-                break;
-            default:
-                ERROR("Cannot determine field for unnamed expression\n");
-                if (row)
-                    ACTION("Ignoring key %d in row %d of section %s\n",
-                            row->nKeys + 1, row->section->nRows + 1,
-                            rowText(row));
-                return False;
-            }
-        }
-    }
-    return True;
-}
-
-static Bool
-HandleRowBody(RowDef * def, RowInfo * row, unsigned merge,
-              GeometryInfo * info)
-{
-    KeyDef *keyDef;
-
-    if ((def->nKeys < 1) && (warningLevel > 3))
-    {
-        ERROR("Row in section %s has no keys\n", rowText(row));
-        ACTION("Section ignored\n");
-        return True;
-    }
-    for (keyDef = def->keys; keyDef != NULL;
-         keyDef = (KeyDef *) keyDef->common.next)
-    {
-        if (keyDef->common.stmtType == StmtVarDef)
-        {
-            VarDef *var = (VarDef *) keyDef;
-            ExprResult elem, field;
-            ExprDef *ndx;
-            if (ExprResolveLhs(var->name, &elem, &field, &ndx) == 0)
-                return 0;       /* internal error, already reported */
-            if ((elem.str == NULL) || (uStrCaseCmp(elem.str, "row") == 0))
-            {
-                if (!SetRowField(row, field.str, ndx, var->value, info))
-                    return False;
-            }
-            else if (uStrCaseCmp(elem.str, "key") == 0)
-            {
-                if (!SetKeyField
-                    (&row->dfltKey, field.str, ndx, var->value, info))
-                    return False;
-            }
-            else
-            {
-                WARN("Assignment to field of unknown element in row\n");
-                ACTION("No value assigned to %s.%s\n", elem.str, field.str);
-            }
-            free(elem.str);
-            free(field.str);
-        }
-        else if (keyDef->common.stmtType == StmtKeyDef)
-        {
-            KeyInfo key;
-            InitKeyInfo(&key, row, info);
-            if (keyDef->name != NULL)
-            {
-                int len = strlen(keyDef->name);
-                if ((len < 1) || (len > XkbKeyNameLength))
-                {
-                    ERROR("Illegal name %s for key in section %s\n",
-                           keyDef->name, rowText(row));
-                    ACTION("Section not compiled\n");
-                    return False;
-                }
-                memset(key.name, 0, XkbKeyNameLength + 1);
-                strncpy(key.name, keyDef->name, XkbKeyNameLength);
-                key.defs.defined |= _GK_Name;
-            }
-            else if (!HandleComplexKey(keyDef, &key, info))
-                return False;
-            if (!AddKey(row, &key))
-                return False;
-        }
-        else
-        {
-            WSGO("Unexpected statement (type %d) in row body\n",
-                  keyDef->common.stmtType);
-            return False;
-        }
-    }
-    return True;
-}
-
-static Bool
-HandleSectionBody(SectionDef * def,
-                  SectionInfo * si, unsigned merge, GeometryInfo * info)
-{
-    RowDef *rowDef;
-    DoodadInfo *di;
-
-    for (rowDef = def->rows; rowDef != NULL;
-         rowDef = (RowDef *) rowDef->common.next)
-    {
-        if (rowDef->common.stmtType == StmtVarDef)
-        {
-            VarDef *var = (VarDef *) rowDef;
-            ExprResult elem, field;
-            ExprDef *ndx;
-            if (ExprResolveLhs(var->name, &elem, &field, &ndx) == 0)
-                return 0;       /* internal error, already reported */
-            if ((elem.str == NULL) || (uStrCaseCmp(elem.str, "section") == 0))
-            {
-                if (!SetSectionField(si, field.str, ndx, var->value, info))
-                {
-                    free(field.str);
-                    return False;
-                }
-            }
-            else if (uStrCaseCmp(elem.str, "row") == 0)
-            {
-                if (!SetRowField
-                    (&si->dfltRow, field.str, ndx, var->value, info))
-                {
-                    free(field.str);
-                    return False;
-                }
-            }
-            else if (uStrCaseCmp(elem.str, "key") == 0)
-            {
-                if (!SetKeyField(&si->dfltRow.dfltKey, field.str, ndx,
-                                 var->value, info))
-                {
-                    free(field.str);
-                    return False;
-                }
-            }
-            else if ((di =
-                      FindDfltDoodadByTypeName(elem.str, si, info)) != NULL)
-            {
-                if (!SetDoodadField(di, field.str, ndx, var->value, si, info))
-                {
-                    free(field.str);
-                    return False;
-                }
-            }
-            else
-            {
-                WARN("Assignment to field of unknown element in section\n");
-                ACTION("No value assigned to %s.%s\n", elem.str, field.str);
-            }
-            free(field.str);
-            free(elem.str);
-        }
-        else if (rowDef->common.stmtType == StmtRowDef)
-        {
-            RowInfo row;
-            InitRowInfo(&row, si, info);
-            if (!HandleRowBody(rowDef, &row, merge, info))
-                return False;
-            if (!AddRow(si, &row))
-                return False;
-/*         ClearRowInfo(&row,info);*/
-        }
-        else if ((rowDef->common.stmtType == StmtDoodadDef) ||
-                 (rowDef->common.stmtType == StmtIndicatorMapDef))
-        {
-            if (!HandleDoodadDef((DoodadDef *) rowDef, merge, si, info))
-                return False;
-        }
-        else if (rowDef->common.stmtType == StmtOverlayDef)
-        {
-            if (!HandleOverlayDef((OverlayDef *) rowDef, merge, si, info))
-                return False;
-        }
-        else
-        {
-            WSGO("Unexpected statement (type %d) in section body\n",
-                  rowDef->common.stmtType);
-            return False;
-        }
-    }
-    if (si->nRows != def->nRows)
-    {
-        WSGO("Expected %d rows, found %d\n", (unsigned int) def->nRows,
-              (unsigned int) si->nRows);
-        ACTION("Definition of section %s might be incorrect\n", scText(si));
-    }
-    return True;
-}
-
-static int
-HandleSectionDef(SectionDef * def,
-                 struct xkb_desc * xkb, unsigned merge, GeometryInfo * info)
-{
-    SectionInfo si;
-
-    if (def->merge != MergeDefault)
-        merge = def->merge;
-    InitSectionInfo(&si, info);
-    si.defs.merge = merge;
-    si.name = def->name;
-    if (!HandleSectionBody(def, &si, merge, info))
-        return False;
-    if (!AddSection(info, &si))
-        return False;
-    return True;
-}
-
-/***====================================================================***/
-
-static void
-HandleGeometryFile(XkbFile * file,
-                   struct xkb_desc * xkb, unsigned merge, GeometryInfo * info)
-{
-    ParseCommon *stmt;
-    const char *failWhat;
-
-    if (merge == MergeDefault)
-        merge = MergeAugment;
-    free(info->name);
-    info->name = _XkbDupString(file->name);
-    stmt = file->defs;
-    while (stmt)
-    {
-        failWhat = NULL;
-        switch (stmt->stmtType)
-        {
-        case StmtInclude:
-            if (!HandleIncludeGeometry((IncludeStmt *) stmt, xkb, info,
-                                       HandleGeometryFile))
-                info->errorCount++;
-            break;
-        case StmtKeyAliasDef:
-            if (!HandleAliasDef((KeyAliasDef *) stmt,
-                                merge, info->fileID, &info->aliases))
-            {
-                info->errorCount++;
-            }
-            break;
-        case StmtVarDef:
-            if (!HandleGeometryVar((VarDef *) stmt, xkb, info))
-                info->errorCount++;
-            break;
-        case StmtShapeDef:
-            if (!HandleShapeDef((ShapeDef *) stmt, xkb, merge, info))
-                info->errorCount++;
-            break;
-        case StmtSectionDef:
-            if (!HandleSectionDef((SectionDef *) stmt, xkb, merge, info))
-                info->errorCount++;
-            break;
-        case StmtIndicatorMapDef:
-        case StmtDoodadDef:
-            if (!HandleDoodadDef((DoodadDef *) stmt, merge, NULL, info))
-                info->errorCount++;
-            break;
-        case StmtVModDef:
-            if (!failWhat)
-                failWhat = "virtual modfier";
-        case StmtInterpDef:
-            if (!failWhat)
-                failWhat = "symbol interpretation";
-        case StmtGroupCompatDef:
-            if (!failWhat)
-                failWhat = "group compatibility map";
-        case StmtKeycodeDef:
-            if (!failWhat)
-                failWhat = "key name";
-            ERROR("Interpretation files may not include other types\n");
-            ACTION("Ignoring %s definition.\n", failWhat);
-            info->errorCount++;
-            break;
-        default:
-            WSGO("Unexpected statement type %d in HandleGeometryFile\n",
-                  stmt->stmtType);
-            break;
-        }
-        stmt = stmt->next;
-        if (info->errorCount > 10)
-        {
-#ifdef NOISY
-            ERROR("Too many errors\n");
-#endif
-            ACTION("Abandoning geometry file \"%s\"\n", file->topName);
-            break;
-        }
-    }
-}
-
-/***====================================================================***/
-
-static Bool
-CopyShapeDef(struct xkb_geometry * geom, ShapeInfo * si)
-{
-    int i, n;
-    struct xkb_shape * shape;
-    struct xkb_outline *old_outline, *outline;
-    uint32_t name;
-
-    si->index = geom->num_shapes;
-    name = si->name;
-    shape = XkbcAddGeomShape(geom, name, si->nOutlines);
-    if (!shape)
-    {
-        WSGO("Couldn't allocate shape in geometry\n");
-        ACTION("Shape %s not compiled\n", shText(si));
-        return False;
-    }
-    old_outline = si->outlines;
-    for (i = 0; i < si->nOutlines; i++, old_outline++)
-    {
-        outline = XkbcAddGeomOutline(shape, old_outline->num_points);
-        if (!outline)
-        {
-            WSGO("Couldn't allocate outline in shape\n");
-            ACTION("Shape %s is incomplete\n", shText(si));
-            return False;
-        }
-        n = old_outline->num_points;
-        memcpy(outline->points, old_outline->points, n * sizeof(struct xkb_point));
-        outline->num_points = old_outline->num_points;
-        outline->corner_radius = old_outline->corner_radius;
-    }
-    if (si->approx)
-    {
-        n = (si->approx - si->outlines);
-        shape->approx = &shape->outlines[n];
-    }
-    if (si->primary)
-    {
-        n = (si->primary - si->outlines);
-        shape->primary = &shape->outlines[n];
-    }
-    XkbcComputeShapeBounds(shape);
-    return True;
-}
-
-static Bool
-VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info)
-{
-    if ((di->defs.defined & (_GD_Top | _GD_Left)) != (_GD_Top | _GD_Left))
-    {
-        if (warningLevel < 9)
-        {
-            ERROR("No position defined for doodad %s\n",
-                   ddText(di));
-            ACTION("Illegal doodad ignored\n");
-            return False;
-        }
-    }
-    if ((di->defs.defined & _GD_Priority) == 0)
-    {
-        /* calculate priority -- should be just above previous doodad/row */
-    }
-    switch (di->type)
-    {
-    case XkbOutlineDoodad:
-    case XkbSolidDoodad:
-        if ((di->defs.defined & _GD_Shape) == 0)
-        {
-            ERROR("No shape defined for %s doodad %s\n",
-                   (di->type == XkbOutlineDoodad ? "outline" : "filled"),
-                   ddText(di));
-            ACTION("Incomplete definition ignored\n");
-            return False;
-        }
-        else
-        {
-            ShapeInfo *si;
-            si = FindShape(info, di->shape,
-                           (di->type ==
-                            XkbOutlineDoodad ? "outline doodad" :
-                            "solid doodad"), ddText(di));
-            if (si)
-                di->shape = si->name;
-            else
-            {
-                ERROR("No legal shape for %s\n", ddText(di));
-                ACTION("Incomplete definition ignored\n");
-                return False;
-            }
-        }
-        if ((di->defs.defined & _GD_Color) == 0)
-        {
-            if (warningLevel > 5)
-            {
-                WARN("No color for doodad %s\n", ddText(di));
-                ACTION("Using black\n");
-            }
-            di->color = xkb_intern_atom("black");
-        }
-        break;
-    case XkbTextDoodad:
-        if ((di->defs.defined & _GD_Text) == 0)
-        {
-            ERROR("No text specified for text doodad %s\n", ddText(di));
-            ACTION("Illegal doodad definition ignored\n");
-            return False;
-        }
-        if ((di->defs.defined & _GD_Angle) == 0)
-            di->angle = 0;
-        if ((di->defs.defined & _GD_Color) == 0)
-        {
-            if (warningLevel > 5)
-            {
-                WARN("No color specified for doodad %s\n", ddText(di));
-                ACTION("Using black\n");
-            }
-            di->color = xkb_intern_atom("black");
-        }
-        if ((di->defs.defined & _GD_FontSpec) != 0)
-        {
-            if ((di->defs.defined & _GD_FontParts) == 0)
-                return True;
-            if (warningLevel < 9)
-            {
-                WARN
-                    ("Text doodad %s has full and partial font definition\n",
-                     ddText(di));
-                ACTION("Full specification ignored\n");
-            }
-            di->defs.defined &= ~_GD_FontSpec;
-            di->fontSpec = None;
-        }
-        if ((di->defs.defined & _GD_Font) == 0)
-        {
-            if (warningLevel > 5)
-            {
-                WARN("No font specified for doodad %s\n", ddText(di));
-                ACTION("Using \"%s\"\n", DFLT_FONT);
-            }
-            di->font = xkb_intern_atom(DFLT_FONT);
-        }
-        if ((di->defs.defined & _GD_FontSlant) == 0)
-        {
-            if (warningLevel > 7)
-            {
-                WARN("No font slant for text doodad %s\n", ddText(di));
-                ACTION("Using \"%s\"\n", DFLT_SLANT);
-            }
-            di->fontSlant = xkb_intern_atom(DFLT_SLANT);
-        }
-        if ((di->defs.defined & _GD_FontWeight) == 0)
-        {
-            if (warningLevel > 7)
-            {
-                WARN("No font weight for text doodad %s\n", ddText(di));
-                ACTION("Using \"%s\"\n", DFLT_WEIGHT);
-            }
-            di->fontWeight = xkb_intern_atom(DFLT_WEIGHT);
-        }
-        if ((di->defs.defined & _GD_FontSetWidth) == 0)
-        {
-            if (warningLevel > 9)
-            {
-                WARN("No font set width for text doodad %s\n", ddText(di));
-                ACTION("Using \"%s\"\n", DFLT_SET_WIDTH);
-            }
-            di->fontSetWidth = xkb_intern_atom(DFLT_SET_WIDTH);
-        }
-        if ((di->defs.defined & _GD_FontVariant) == 0)
-        {
-            if (warningLevel > 9)
-            {
-                WARN("No font variant for text doodad %s\n", ddText(di));
-                ACTION("Using \"%s\"\n", DFLT_VARIANT);
-            }
-            di->fontVariant = xkb_intern_atom(DFLT_VARIANT);
-        }
-        if ((di->defs.defined & _GD_FontEncoding) == 0)
-        {
-            if (warningLevel > 7)
-            {
-                WARN("No font encoding for doodad %s\n", ddText(di));
-                ACTION("Using \"%s\"\n", DFLT_ENCODING);
-            }
-            di->fontEncoding = xkb_intern_atom(DFLT_ENCODING);
-        }
-        if ((di->defs.defined & _GD_FontSize) == 0)
-        {
-            if (warningLevel > 7)
-            {
-                WARN("No font size for text doodad %s\n", ddText(di));
-                ACTION("Using %s point text\n", XkbcGeomFPText(DFLT_SIZE));
-            }
-            di->fontSize = DFLT_SIZE;
-        }
-        if ((di->defs.defined & _GD_Height) == 0)
-        {
-            unsigned size, nLines;
-            const char *tmp;
-            size = (di->fontSize * 120) / 100;
-            size = (size * 254) / 720;  /* convert to mm/10 */
-            for (nLines = 1, tmp = XkbcAtomText(di->text); *tmp; tmp++)
-            {
-                if (*tmp == '\n')
-                    nLines++;
-            }
-            size *= nLines;
-            if (warningLevel > 5)
-            {
-                WARN("No height for text doodad %s\n", ddText(di));
-                ACTION("Using calculated height %s millimeters\n",
-                        XkbcGeomFPText(size));
-            }
-            di->height = size;
-        }
-        if ((di->defs.defined & _GD_Width) == 0)
-        {
-            unsigned width, tmp;
-            const char *str;
-            width = tmp = 0;
-            for (str = XkbcAtomText(di->text); *str; str++)
-            {
-                if (*str != '\n')
-                    tmp++;
-                else
-                {
-                    if (tmp > width)
-                        width = tmp;
-                    tmp = 1;
-                }
-            }
-            if (width == 0)
-                width = tmp;
-            width *= (di->height * 2) / 3;
-            if (warningLevel > 5)
-            {
-                WARN("No width for text doodad %s\n", ddText(di));
-                ACTION("Using calculated width %s millimeters\n",
-                        XkbcGeomFPText(width));
-            }
-            di->width = width;
-        }
-        break;
-    case XkbIndicatorDoodad:
-        if ((di->defs.defined & _GD_Shape) == 0)
-        {
-            ERROR("No shape defined for indicator doodad %s\n", ddText(di));
-            ACTION("Incomplete definition ignored\n");
-            return False;
-        }
-        else
-        {
-            ShapeInfo *si;
-            si = FindShape(info, di->shape, "indicator doodad", ddText(di));
-            if (si)
-                di->shape = si->name;
-            else
-            {
-                ERROR("No legal shape for doodad %s\n", ddText(di));
-                ACTION("Incomplete definition ignored\n");
-                return False;
-            }
-        }
-        if ((di->defs.defined & _GD_Color) == 0)
-        {
-            if (warningLevel > 5)
-            {
-                WARN("No \"on\" color for indicator doodad %s\n",
-                      ddText(di));
-                ACTION("Using green\n");
-            }
-            di->color = xkb_intern_atom("green");
-        }
-        if ((di->defs.defined & _GD_OffColor) == 0)
-        {
-            if (warningLevel > 5)
-            {
-                WARN("No \"off\" color for indicator doodad %s\n",
-                      ddText(di));
-                ACTION("Using black\n");
-            }
-            di->offColor = xkb_intern_atom("black");
-        }
-        break;
-    case XkbLogoDoodad:
-        if (di->logoName == NULL)
-        {
-            ERROR("No logo name defined for logo doodad %s\n", ddText(di));
-            ACTION("Incomplete definition ignored\n");
-            return False;
-        }
-        if ((di->defs.defined & _GD_Shape) == 0)
-        {
-            ERROR("No shape defined for logo doodad %s\n", ddText(di));
-            ACTION("Incomplete definition ignored\n");
-            return False;
-        }
-        else
-        {
-            ShapeInfo *si;
-            si = FindShape(info, di->shape, "logo doodad",
-                           ddText(di));
-            if (si)
-                di->shape = si->name;
-            else
-            {
-                ERROR("No legal shape for %s\n", ddText(di));
-                ACTION("Incomplete definition ignored\n");
-                return False;
-            }
-        }
-        if ((di->defs.defined & _GD_Color) == 0)
-        {
-            if (warningLevel > 5)
-            {
-                WARN("No color for doodad %s\n", ddText(di));
-                ACTION("Using black\n");
-            }
-            di->color = xkb_intern_atom("black");
-        }
-        break;
-    default:
-        WSGO("Uknown doodad type %d in VerifyDoodad\n",
-              (unsigned int) di->type);
-        return False;
-    }
-    return True;
-}
-
-#define        FONT_TEMPLATE   "-*-%s-%s-%s-%s-%s-*-%d-*-*-*-*-%s"
-
-static char *
-FontFromParts(uint32_t fontTok,
-              uint32_t weightTok,
-              uint32_t slantTok,
-              uint32_t setWidthTok, uint32_t varTok, int size, uint32_t encodingTok)
-{
-    int totalSize;
-    const char *font, *weight, *slant, *setWidth, *variant, *encoding;
-    char *rtrn;
-
-    font = (fontTok != None ? XkbcAtomText(fontTok) : DFLT_FONT);
-    weight = (weightTok != None ? XkbcAtomText(weightTok) : DFLT_WEIGHT);
-    slant = (slantTok != None ? XkbcAtomText(slantTok) : DFLT_SLANT);
-    setWidth =
-        (setWidthTok != None ? XkbcAtomText(setWidthTok) : DFLT_SET_WIDTH);
-    variant = (varTok != None ? XkbcAtomText(varTok) : DFLT_VARIANT);
-    encoding =
-        (encodingTok != None ? XkbcAtomText(encodingTok) : DFLT_ENCODING);
-    if (size == 0)
-        size = DFLT_SIZE;
-    totalSize =
-        strlen(FONT_TEMPLATE) + strlen(font) + strlen(weight) + strlen(slant);
-    totalSize += strlen(setWidth) + strlen(variant) + strlen(encoding);
-    rtrn = calloc(totalSize, 1);
-    if (rtrn)
-        sprintf(rtrn, FONT_TEMPLATE, font, weight, slant, setWidth, variant,
-                size, encoding);
-    return rtrn;
-}
-
-static Bool
-CopyDoodadDef(struct xkb_geometry * geom,
-              struct xkb_section * section, DoodadInfo * di, GeometryInfo * info)
-{
-    uint32_t name;
-    union xkb_doodad * doodad;
-    struct xkb_color * color;
-    struct xkb_shape * shape;
-    ShapeInfo *si;
-
-    if (!VerifyDoodadInfo(di, info))
-        return False;
-    name = di->name;
-    doodad = XkbcAddGeomDoodad(geom, section, name);
-    if (!doodad)
-    {
-        WSGO("Couldn't allocate doodad in %s\n",
-              (section ? "section" : "geometry"));
-        ACTION("Cannot copy doodad %s\n", ddText(di));
-        return False;
-    }
-    doodad->any.type = di->type;
-    doodad->any.priority = di->priority;
-    doodad->any.top = di->top;
-    doodad->any.left = di->left;
-    switch (di->type)
-    {
-    case XkbOutlineDoodad:
-    case XkbSolidDoodad:
-        si = FindShape(info, di->shape, NULL, NULL);
-        if (!si)
-            return False;
-        doodad->shape.angle = di->angle;
-        color = XkbcAddGeomColor(geom, XkbcAtomText(di->color),
-                                 geom->num_colors);
-        shape = &geom->shapes[si->index];
-        XkbSetShapeDoodadColor(geom, &doodad->shape, color);
-        XkbSetShapeDoodadShape(geom, &doodad->shape, shape);
-        break;
-    case XkbTextDoodad:
-        doodad->text.angle = di->angle;
-        doodad->text.width = di->width;
-        doodad->text.height = di->height;
-        if (di->fontSpec == None)
-            doodad->text.font = FontFromParts(di->font, di->fontWeight,
-                                              di->fontSlant,
-                                              di->fontSetWidth,
-                                              di->fontVariant, di->fontSize,
-                                              di->fontEncoding);
-        else
-            doodad->text.font = XkbcAtomGetString(di->fontSpec);
-        doodad->text.text = XkbcAtomGetString(di->text);
-        color = XkbcAddGeomColor(geom, XkbcAtomText(di->color),
-                                 geom->num_colors);
-        XkbSetTextDoodadColor(geom, &doodad->text, color);
-        break;
-    case XkbIndicatorDoodad:
-        si = FindShape(info, di->shape, NULL, NULL);
-        if (!si)
-            return False;
-        shape = &geom->shapes[si->index];
-        color = XkbcAddGeomColor(geom, XkbcAtomText(di->color),
-                                 geom->num_colors);
-        XkbSetIndicatorDoodadShape(geom, &doodad->indicator, shape);
-        XkbSetIndicatorDoodadOnColor(geom, &doodad->indicator, color);
-        color = XkbcAddGeomColor(geom, XkbcAtomText(di->offColor),
-                                 geom->num_colors);
-        XkbSetIndicatorDoodadOffColor(geom, &doodad->indicator, color);
-        break;
-    case XkbLogoDoodad:
-        si = FindShape(info, di->shape, NULL, NULL);
-        if (!si)
-            return False;
-        doodad->logo.angle = di->angle;
-        color = XkbcAddGeomColor(geom, XkbcAtomText(di->color),
-                                 geom->num_colors);
-        shape = &geom->shapes[si->index];
-        XkbSetLogoDoodadColor(geom, &doodad->logo, color);
-        XkbSetLogoDoodadShape(geom, &doodad->logo, shape);
-        doodad->logo.logo_name = di->logoName;
-        di->logoName = NULL;
-        break;
-    }
-    return True;
-}
-
-/***====================================================================***/
-
-static Bool
-VerifyOverlayInfo(struct xkb_geometry * geom,
-                  struct xkb_section * section,
-                  OverlayInfo * oi,
-                  GeometryInfo * info, short rowMap[256], short rowSize[256])
-{
-    OverlayKeyInfo *ki, *next;
-    unsigned long oKey, uKey, sKey;
-    struct xkb_row * row;
-    struct xkb_key * key;
-    int r, k;
-
-    /* find out which row each key is in */
-    for (ki = oi->keys; ki != NULL; ki = (OverlayKeyInfo *) ki->defs.next)
-    {
-        oKey = KeyNameToLong(ki->over);
-        uKey = KeyNameToLong(ki->under);
-        for (r = 0, row = section->rows; (r < section->num_rows) && oKey;
-             r++, row++)
-        {
-            for (k = 0, key = row->keys; (k < row->num_keys) && oKey;
-                 k++, key++)
-            {
-                sKey = KeyNameToLong(key->name.name);
-                if (sKey == oKey)
-                {
-                    if (warningLevel > 0)
-                    {
-                        WARN
-                            ("Key %s in section \"%s\" and overlay \"%s\"\n",
-                             XkbcKeyNameText(key->name.name),
-                             XkbcAtomText(section->name),
-                             XkbcAtomText(oi->name));
-                        ACTION("Overlay definition ignored\n");
-                    }
-                    oKey = 0;
-                }
-                else if (sKey == uKey)
-                {
-                    ki->sectionRow = r;
-                    oKey = 0;
-                }
-            }
-        }
-        if ((ki->sectionRow == _GOK_UnknownRow) && (warningLevel > 0))
-        {
-            WARN
-                ("Key %s not in \"%s\", but has an overlay key in \"%s\"\n",
-                 XkbcKeyNameText(ki->under),
-                 XkbcAtomText(section->name),
-                 XkbcAtomText(oi->name));
-            ACTION("Definition ignored\n");
-        }
-    }
-    /* now prune out keys that aren't in the section */
-    while ((oi->keys != NULL) && (oi->keys->sectionRow == _GOK_UnknownRow))
-    {
-        next = (OverlayKeyInfo *) oi->keys->defs.next;
-        free(oi->keys);
-        oi->keys = next;
-        oi->nKeys--;
-    }
-    for (ki = oi->keys; (ki != NULL) && (ki->defs.next != NULL); ki = next)
-    {
-        next = (OverlayKeyInfo *) ki->defs.next;
-        if (next->sectionRow == _GOK_UnknownRow)
-        {
-            ki->defs.next = next->defs.next;
-            oi->nKeys--;
-            free(next);
-            next = (OverlayKeyInfo *) ki->defs.next;
-        }
-    }
-    if (oi->nKeys < 1)
-    {
-        ERROR("Overlay \"%s\" for section \"%s\" has no legal keys\n",
-               XkbcAtomText(oi->name), XkbcAtomText(section->name));
-        ACTION("Overlay definition ignored\n");
-        return False;
-    }
-    /* now figure out how many rows are defined for the overlay */
-    memset(rowSize, 0, sizeof(short) * 256);
-    for (k = 0; k < 256; k++)
-    {
-        rowMap[k] = -1;
-    }
-    oi->nRows = 0;
-    for (ki = oi->keys; ki != NULL; ki = (OverlayKeyInfo *) ki->defs.next)
-    {
-        if (rowMap[ki->sectionRow] == -1)
-            rowMap[ki->sectionRow] = oi->nRows++;
-        ki->overlayRow = rowMap[ki->sectionRow];
-        rowSize[ki->overlayRow]++;
-    }
-    return True;
-}
-
-static Bool
-CopyOverlayDef(struct xkb_geometry * geom,
-               struct xkb_section * section, OverlayInfo * oi, GeometryInfo * info)
-{
-    uint32_t name;
-    struct xkb_overlay * ol;
-    struct xkb_overlay_row * row;
-    struct xkb_overlay_key * key;
-    OverlayKeyInfo *ki;
-    short rowMap[256], rowSize[256];
-    int i;
-
-    if (!VerifyOverlayInfo(geom, section, oi, info, rowMap, rowSize))
-        return False;
-    name = oi->name;
-    ol = XkbcAddGeomOverlay(section, name, oi->nRows);
-    if (!ol)
-    {
-        WSGO("Couldn't add overlay \"%s\" to section \"%s\"\n",
-              XkbcAtomText(name), XkbcAtomText(section->name));
-        return False;
-    }
-    for (i = 0; i < oi->nRows; i++)
-    {
-        int tmp, row_under;
-        for (tmp = 0, row_under = -1;
-             (tmp < section->num_rows) && (row_under < 0); tmp++)
-        {
-            if (rowMap[tmp] == i)
-                row_under = tmp;
-        }
-        if (!XkbcAddGeomOverlayRow(ol, row_under, rowSize[i]))
-        {
-            WSGO
-                ("Can't add row %d to overlay \"%s\" of section \"%s\"\n",
-                 i, XkbcAtomText(name), XkbcAtomText(section->name));
-            return False;
-        }
-    }
-    for (ki = oi->keys; ki != NULL; ki = (OverlayKeyInfo *) ki->defs.next)
-    {
-        row = &ol->rows[ki->overlayRow];
-        key = &row->keys[row->num_keys++];
-        memset(key, 0, sizeof(struct xkb_overlay_key));
-        strncpy(key->over.name, ki->over, XkbKeyNameLength);
-        strncpy(key->under.name, ki->under, XkbKeyNameLength);
-    }
-    return True;
-}
-
-/***====================================================================***/
-
-static Bool
-CopySectionDef(struct xkb_geometry * geom, SectionInfo * si, GeometryInfo * info)
-{
-    struct xkb_section * section;
-    struct xkb_row * row;
-    struct xkb_key * key;
-    KeyInfo *ki;
-    RowInfo *ri;
-
-    section = XkbcAddGeomSection(geom, si->name, si->nRows, si->nDoodads,
-                                 si->nOverlays);
-    if (section == NULL)
-    {
-        WSGO("Couldn't allocate section in geometry\n");
-        ACTION("Section %s not compiled\n", scText(si));
-        return False;
-    }
-    section->top = si->top;
-    section->left = si->left;
-    section->width = si->width;
-    section->height = si->height;
-    section->angle = si->angle;
-    section->priority = si->priority;
-    for (ri = si->rows; ri != NULL; ri = (RowInfo *) ri->defs.next)
-    {
-        row = XkbcAddGeomRow(section, ri->nKeys);
-        if (row == NULL)
-        {
-            WSGO("Couldn't allocate row in section\n");
-            ACTION("Section %s is incomplete\n", scText(si));
-            return False;
-        }
-        row->top = ri->top;
-        row->left = ri->left;
-        row->vertical = ri->vertical;
-        for (ki = ri->keys; ki != NULL; ki = (KeyInfo *) ki->defs.next)
-        {
-            struct xkb_color * color;
-            if ((ki->defs.defined & _GK_Name) == 0)
-            {
-                ERROR("Key %d of row %d in section %s has no name\n",
-                       (int) ki->index, (int) ri->index, scText(si));
-                ACTION("Section %s ignored\n", scText(si));
-                return False;
-            }
-            key = XkbcAddGeomKey(row);
-            if (key == NULL)
-            {
-                WSGO("Couldn't allocate key in row\n");
-                ACTION("Section %s is incomplete\n", scText(si));
-                return False;
-            }
-            memcpy(key->name.name, ki->name, XkbKeyNameLength);
-            key->gap = ki->gap;
-            if (ki->shape == None)
-                key->shape_ndx = 0;
-            else
-            {
-                ShapeInfo *shapei;
-                shapei = FindShape(info, ki->shape, "key", keyText(ki));
-                if (!shapei)
-                    return False;
-                key->shape_ndx = shapei->index;
-            }
-            if (ki->color != None)
-                color =
-                    XkbcAddGeomColor(geom, XkbcAtomText(ki->color),
-                                     geom->num_colors);
-            else
-                color = XkbcAddGeomColor(geom, "white", geom->num_colors);
-            XkbSetKeyColor(geom, key, color);
-        }
-    }
-    if (si->doodads != NULL)
-    {
-        DoodadInfo *di;
-        for (di = si->doodads; di != NULL; di = (DoodadInfo *) di->defs.next)
-        {
-            CopyDoodadDef(geom, section, di, info);
-        }
-    }
-    if (si->overlays != NULL)
-    {
-        OverlayInfo *oi;
-        for (oi = si->overlays; oi != NULL;
-             oi = (OverlayInfo *) oi->defs.next)
-        {
-            CopyOverlayDef(geom, section, oi, info);
-        }
-    }
-    if (XkbcComputeSectionBounds(geom, section))
-    {
-        /* 7/6/94 (ef) --  check for negative origin and translate */
-        if ((si->defs.defined & _GS_Width) == 0)
-            section->width = section->bounds.x2;
-        if ((si->defs.defined & _GS_Height) == 0)
-            section->height = section->bounds.y2;
-    }
-    return True;
-}
-
-/***====================================================================***/
-
-Bool
-CompileGeometry(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
-{
-    GeometryInfo info;
-
-    InitGeometryInfo(&info, file->id, merge);
-    HandleGeometryFile(file, xkb, merge, &info);
-
-    if (info.errorCount == 0)
-    {
-        struct xkb_geometry * geom;
-        struct xkb_geometry_sizes sizes;
-        memset(&sizes, 0, sizeof(sizes));
-        sizes.which = XkbGeomAllMask;
-        sizes.num_properties = info.nProps;
-        sizes.num_colors = 8;
-        sizes.num_shapes = info.nShapes;
-        sizes.num_sections = info.nSections;
-        sizes.num_doodads = info.nDoodads;
-        if (XkbcAllocGeometry(xkb, &sizes) != Success)
-        {
-            WSGO("Couldn't allocate GeometryRec\n");
-            ACTION("Geometry not compiled\n");
-            return False;
-        }
-        geom = xkb->geom;
-
-        geom->width_mm = info.widthMM;
-        geom->height_mm = info.heightMM;
-        if (info.name != NULL)
-        {
-            geom->name = xkb_intern_atom(info.name);
-            XkbcAllocNames(xkb, XkbGeometryNameMask, 0);
-        }
-        if (info.fontSpec != None)
-            geom->label_font = XkbcAtomGetString(info.fontSpec);
-        else
-            geom->label_font = FontFromParts(info.font, info.fontWeight,
-                                             info.fontSlant,
-                                             info.fontSetWidth,
-                                             info.fontVariant,
-                                             info.fontSize,
-                                             info.fontEncoding);
-        XkbcAddGeomColor(geom, "black", geom->num_colors);
-        XkbcAddGeomColor(geom, "white", geom->num_colors);
-
-        if (info.baseColor == None)
-            info.baseColor = xkb_intern_atom("white");
-        if (info.labelColor == None)
-            info.labelColor = xkb_intern_atom("black");
-        geom->base_color =
-            XkbcAddGeomColor(geom, XkbcAtomText(info.baseColor),
-                             geom->num_colors);
-        geom->label_color =
-            XkbcAddGeomColor(geom, XkbcAtomText(info.labelColor),
-                             geom->num_colors);
-
-        if (info.props)
-        {
-            PropertyInfo *pi;
-            for (pi = info.props; pi != NULL;
-                 pi = (PropertyInfo *) pi->defs.next)
-            {
-                if (!XkbcAddGeomProperty(geom, pi->name, pi->value))
-                    return False;
-            }
-        }
-        if (info.shapes)
-        {
-            ShapeInfo *si;
-            for (si = info.shapes; si != NULL;
-                 si = (ShapeInfo *) si->defs.next)
-            {
-                if (!CopyShapeDef(geom, si))
-                    return False;
-            }
-        }
-        if (info.sections)
-        {
-            SectionInfo *si;
-            for (si = info.sections; si != NULL;
-                 si = (SectionInfo *) si->defs.next)
-            {
-                if (!CopySectionDef(geom, si, &info))
-                    return False;
-            }
-        }
-        if (info.doodads)
-        {
-            DoodadInfo *di;
-            for (di = info.doodads; di != NULL;
-                 di = (DoodadInfo *) di->defs.next)
-            {
-                if (!CopyDoodadDef(geom, NULL, di, &info))
-                    return False;
-            }
-        }
-        if (info.aliases)
-            ApplyAliases(xkb, True, &info.aliases);
-        ClearGeometryInfo(&info);
-        return True;
-    }
-    return False;
-}
index e1c90cf..339fa37 100644 (file)
@@ -927,7 +927,7 @@ CompileKeycodes(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
             }
         }
         if (info.aliases)
-            ApplyAliases(xkb, False, &info.aliases);
+            ApplyAliases(xkb, &info.aliases);
         ClearKeyNamesInfo(&info);
         return True;
     }
index 9221852..b2dde0b 100644 (file)
 #include "indicators.h"
 
 #define        KEYCODES        0
-#define        GEOMETRY        1
-#define        TYPES           2
-#define        COMPAT          3
-#define        SYMBOLS         4
-#define        MAX_SECTIONS    5
+#define        TYPES           1
+#define        COMPAT          2
+#define        SYMBOLS         3
+#define        MAX_SECTIONS    (SYMBOLS + 1)
 
 /**
  * Compile the given file and store the output in xkb.
@@ -124,8 +123,7 @@ CompileKeymap(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
                 sections[COMPAT] = file;
                 break;
             case XkmGeometryIndex:
-            case XkmGeometryFile:
-                sections[GEOMETRY] = file;
+                /* XXX free me! */
                 break;
             case XkmVirtualModsIndex:
             case XkmIndicatorsIndex:
@@ -145,8 +143,6 @@ CompileKeymap(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
     {
         if (ok && (sections[KEYCODES] != NULL))
             ok = CompileKeycodes(sections[KEYCODES], xkb, MergeOverride);
-        if (ok && (sections[GEOMETRY] != NULL))
-            ok = CompileGeometry(sections[GEOMETRY], xkb, MergeOverride);
         if (ok && (sections[TYPES] != NULL))
             ok = CompileKeyTypes(sections[TYPES], xkb, MergeOverride);
         if (ok && (sections[COMPAT] != NULL))
index c0965c7..bef0f7b 100644 (file)
@@ -464,10 +464,6 @@ GenerateComponent(struct xkb_component_list * complist, unsigned type, char *hea
         complist->num_symbols = cp.num;
         complist->symbols = cp.comp;
         break;
-    case XkmGeometryIndex:
-        complist->num_geometry = cp.num;
-        complist->geometry = cp.comp;
-        break;
     }
 
     return extra;
@@ -510,10 +506,6 @@ xkb_list_components(struct xkb_component_names * ptrns, int *maxMatch)
         extra += GenerateComponent(complist, XkmSymbolsIndex, ptrns->symbols,
                                    DFLT_XKB_CONFIG_ROOT, maxMatch);
 
-    if (ptrns->geometry && *ptrns->geometry != '\0')
-        extra += GenerateComponent(complist, XkmGeometryIndex, ptrns->geometry,
-                                   DFLT_XKB_CONFIG_ROOT, maxMatch);
-
 out:
     if (maxMatch)
         *maxMatch = extra;
index f303536..56c6d12 100644 (file)
@@ -323,21 +323,6 @@ FindKeyNameForAlias(struct xkb_desc * xkb, unsigned long lname,
     int i;
     char name[XkbKeyNameLength + 1];
 
-    if (xkb && xkb->geom && xkb->geom->key_aliases)
-    {
-        struct xkb_key_alias * a;
-        a = xkb->geom->key_aliases;
-        LongToKeyName(lname, name);
-        name[XkbKeyNameLength] = '\0';
-        for (i = 0; i < xkb->geom->num_key_aliases; i++, a++)
-        {
-            if (strncmp(name, a->alias, XkbKeyNameLength) == 0)
-            {
-                *real_name = KeyNameToLong(a->real);
-                return True;
-            }
-        }
-    }
     if (xkb && xkb->names && xkb->names->key_aliases)
     {
         struct xkb_key_alias * a;
index b88a1c2..1b63411 100644 (file)
@@ -957,6 +957,7 @@ FreeXKBFile(XkbFile *file)
         case XkmSymbolsIndex:
         case XkmKeyNamesIndex:
         case XkmGeometryIndex:
+        case XkmGeometryFile:
             FreeStmt(file->defs);
             break;
         }
index f0e2716..c49c940 100644 (file)
@@ -2159,7 +2159,7 @@ CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
 
         /* now copy info into xkb. */
         if (info.aliases)
-            ApplyAliases(xkb, False, &info.aliases);
+            ApplyAliases(xkb, &info.aliases);
         for (i = 0; i < XkbNumKbdGroups; i++)
         {
             if (info.groupNames[i] != None)
index cee6856..e462b29 100644 (file)
@@ -42,7 +42,7 @@ unsigned int warningLevel = 0;
 static XkbFile *
 XkbKeymapFileFromComponents(const struct xkb_component_names * ktcsg)
 {
-    XkbFile *keycodes, *types, *compat, *symbols, *geometry;
+    XkbFile *keycodes, *types, *compat, *symbols;
     IncludeStmt *inc;
 
     if (!ktcsg) {
@@ -65,10 +65,6 @@ XkbKeymapFileFromComponents(const struct xkb_component_names * ktcsg)
     symbols = CreateXKBFile(XkmSymbolsIndex, NULL, (ParseCommon *)inc, 0);
     AppendStmt(&keycodes->common, &symbols->common);
 
-    inc = IncludeCreate(ktcsg->geometry, MergeDefault);
-    geometry = CreateXKBFile(XkmGeometryIndex, NULL, (ParseCommon *)inc, 0);
-    AppendStmt(&keycodes->common, &geometry->common);
-
     return CreateXKBFile(XkmKeymapFile, ktcsg->keymap ? ktcsg->keymap : strdup(""),
                          &keycodes->common, 0);
 }
@@ -108,7 +104,6 @@ XkbComponentsFromRules(const char *rules, const XkbRF_VarDefsPtr defs)
         free(names->types);
         free(names->compat);
         free(names->symbols);
-        free(names->geometry);
         free(names);
         names = NULL;
         ERROR("no components returned from XKB rules \"%s\"\n", rulesPath);
@@ -153,7 +148,6 @@ xkb_compile_keymap_from_rules(const struct xkb_rule_names *rmlvo)
     free(names->types);
     free(names->compat);
     free(names->symbols);
-    free(names->geometry);
     free(names);
 
     return xkb;
index 502b0ba..b0026d0 100644 (file)
@@ -343,9 +343,6 @@ extern Bool
 CompileKeycodes(XkbFile *file, struct xkb_desc * xkb, unsigned merge);
 
 extern Bool
-CompileGeometry(XkbFile *file, struct xkb_desc * xkb, unsigned merge);
-
-extern Bool
 CompileKeyTypes(XkbFile *file, struct xkb_desc * xkb, unsigned merge);
 
 typedef struct _LEDInfo *LEDInfoPtr;
index d08408a..da2383e 100644 (file)
@@ -546,10 +546,10 @@ DoodadDecl        :       DoodadType String OBRACE VarDeclList CBRACE SEMI
                        { $$= DoodadCreate($1,$2,$4); }
                ;
 
-DoodadType     :       TEXT                    { $$= XkbTextDoodad; }
-               |       OUTLINE                 { $$= XkbOutlineDoodad; }
-               |       SOLID                   { $$= XkbSolidDoodad; }
-               |       LOGO                    { $$= XkbLogoDoodad; }
+DoodadType     :       TEXT                    { $$= 0; }
+               |       OUTLINE                 { $$= 0; }
+               |       SOLID                   { $$= 0; }
+               |       LOGO                    { $$= 0; }
                ;
 
 FieldSpec      :       Ident                   { $$= $1; }
diff --git a/src/xkbgeom.h b/src/xkbgeom.h
deleted file mode 100644 (file)
index 6cb6e21..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-Copyright 2009  Dan Nicholson
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the authors or their
-institutions shall not be used in advertising or otherwise to promote the
-sale, use or other dealings in this Software without prior written
-authorization from the authors.
-*/
-
-#ifndef _XKBGEOM_H_
-#define _XKBGEOM_H_
-
-#include <X11/X.h>
-#include <X11/Xdefs.h>
-#include "xkbcommon/xkbcommon.h"
-
-extern void
-XkbcFreeGeometry(struct xkb_desc * xkb);
-
-extern int
-XkbcAllocGeomKeyAliases(struct xkb_geometry * geom, int nKeyAliases);
-
-extern int
-XkbcAllocGeometry(struct xkb_desc * xkb, struct xkb_geometry_sizes * sizes);
-
-extern struct xkb_property *
-XkbcAddGeomProperty(struct xkb_geometry * geom, const char *name, const char *value);
-
-extern struct xkb_color *
-XkbcAddGeomColor(struct xkb_geometry * geom, const char *spec, unsigned int pixel);
-
-extern struct xkb_outline *
-XkbcAddGeomOutline(struct xkb_shape * shape, int sz_points);
-
-extern struct xkb_shape *
-XkbcAddGeomShape(struct xkb_geometry * geom, uint32_t name, int sz_outlines);
-
-extern struct xkb_key *
-XkbcAddGeomKey(struct xkb_row * row);
-
-extern struct xkb_row *
-XkbcAddGeomRow(struct xkb_section * section, int sz_keys);
-
-extern struct xkb_section *
-XkbcAddGeomSection(struct xkb_geometry * geom, uint32_t name,
-                   int sz_rows, int sz_doodads, int sz_over);
-
-extern union xkb_doodad *
-XkbcAddGeomDoodad(struct xkb_geometry * geom, struct xkb_section * section, uint32_t name);
-
-extern struct xkb_overlay_row *
-XkbcAddGeomOverlayRow(struct xkb_overlay * overlay, int row_under, int sz_keys);
-
-extern struct xkb_overlay *
-XkbcAddGeomOverlay(struct xkb_section * section, uint32_t name, int sz_rows);
-
-/***====================================================================***/
-
-extern Bool
-XkbcComputeShapeBounds(struct xkb_shape * shape);
-
-extern Bool
-XkbcComputeSectionBounds(struct xkb_geometry * geom, struct xkb_section * section);
-
-#endif /* _XKBGEOM_H_ */
index 4673f0d..32d2382 100644 (file)
@@ -91,9 +91,6 @@ extern const char *
 XkbcConfigText(unsigned config);
 
 extern const char *
-XkbcGeomFPText(int val);
-
-extern const char *
 XkbcActionTypeText(unsigned type);
 
 extern const char *
index 975c358..da672eb 100644 (file)
@@ -32,7 +32,7 @@ int main(int argc, char *argv[])
 {
     struct xkb_component_names *new, *old = NULL;
 
-    if (argc != 6 && argc != 11) {
+    if (argc != 5 && argc != 9) {
         fprintf(stderr, "usage: canonicalise (new kccgst) [old kccgst]\n");
         return 1;
     }
@@ -45,31 +45,27 @@ int main(int argc, char *argv[])
     }
     new->keycodes = strdup(argv[1]);
     new->compat = strdup(argv[2]);
-    new->geometry = strdup(argv[3]);
-    new->symbols = strdup(argv[4]);
-    new->types = strdup(argv[5]);
+    new->symbols = strdup(argv[3]);
+    new->types = strdup(argv[4]);
 
-    if (argc == 11) {
+    if (argc == 9) {
         old = calloc(1, sizeof(*old));
         if (!old) {
             fprintf(stderr, "failed to calloc old\n");
             return 1;
         }
-        old->keycodes = strdup(argv[6]);
-        old->compat = strdup(argv[7]);
-        old->geometry = strdup(argv[8]);
-        old->symbols = strdup(argv[9]);
-        old->types = strdup(argv[10]);
+        old->keycodes = strdup(argv[5]);
+        old->compat = strdup(argv[6]);
+        old->symbols = strdup(argv[7]);
+        old->types = strdup(argv[8]);
     }
 
     xkb_canonicalise_components(new, old);
 
-    printf("%s %s %s %s %s\n", new->keycodes, new->compat, new->geometry,
-           new->symbols, new->types);
+    printf("%s %s %s %s\n", new->keycodes, new->compat, new->symbols, new->types);
 
     free(new->keycodes);
     free(new->compat);
-    free(new->geometry);
     free(new->symbols);
     free(new->types);
     free(new);
@@ -77,7 +73,6 @@ int main(int argc, char *argv[])
     if (old) {
         free(old->keycodes);
         free(old->compat);
-        free(old->geometry);
         free(old->symbols);
         free(old->types);
         free(old);
index db3587c..7e20622 100755 (executable)
@@ -11,9 +11,8 @@ log_kccgst()
 {
     echo "  keycodes: $1" >>"$log"
     echo "  compat: $2" >>"$log"
-    echo "  geometry: $3" >>"$log"
-    echo "  symbols: $4" >>"$log"
-    echo "  types: $5" >>"$log"
+    echo "  symbols: $3" >>"$log"
+    echo "  types: $4" >>"$log"
 }
 
 rm -f "$log"
@@ -44,12 +43,12 @@ test() {
 
 # This is a bit of a horror, but I can't really remember how to properly
 # handle arrays in shell, and I'm offline.
-twopart_new="+inet(pc104)        %+complete     pc104   pc(pc104)+%+ctrl(nocaps)          |complete"
-twopart_old="xfree86             basic          invalid us(dvorak)                        xfree86"
-twopart_exp="xfree86+inet(pc104) basic+complete pc104   pc(pc104)+us(dvorak)+ctrl(nocaps) xfree86|complete"
+twopart_new="+inet(pc104)        %+complete     pc(pc104)+%+ctrl(nocaps)          |complete"
+twopart_old="xfree86             basic          us(dvorak)                        xfree86"
+twopart_exp="xfree86+inet(pc104) basic+complete pc(pc104)+us(dvorak)+ctrl(nocaps) xfree86|complete"
 
-onepart_new="evdev               complete       pc104   pc(pc104)+us+compose(ralt)        complete"
-onepart_exp="evdev               complete       pc104   pc(pc104)+us+compose(ralt)        complete"
+onepart_new="evdev               complete       pc(pc104)+us+compose(ralt)        complete"
+onepart_exp="evdev               complete       pc(pc104)+us+compose(ralt)        complete"
 
 test "$twopart_exp" "$twopart_new" "$twopart_old"
 echo >>"$log"
index b1a1152..e397fbc 100644 (file)
@@ -36,10 +36,10 @@ int main(int argc, char *argv[])
     struct xkb_component_names ktcsg;
     struct xkb_desc * xkb;
 
-    /* Require rmlvo */
-    if (argc < 6) {
+    /* Require Kc + T + C + S */
+    if (argc < 5) {
         fprintf(stderr, "Not enough arguments\n");
-        fprintf(stderr, "Usage: %s KEYCODES TYPES COMPAT SYMBOLS GEOMETRY\n",
+        fprintf(stderr, "Usage: %s KEYCODES TYPES COMPAT SYMBOLS\n",
                 argv[0]);
         exit(1);
     }
@@ -49,7 +49,6 @@ int main(int argc, char *argv[])
     ktcsg.types = argv[2];
     ktcsg.compat = argv[3];
     ktcsg.symbols = argv[4];
-    ktcsg.geometry = argv[5];
 
     xkb = xkb_compile_keymap_from_components(&ktcsg);
 
index 6fdfb09..864e390 100755 (executable)
@@ -9,28 +9,29 @@ log="$builddir/$name.log"
 
 compile()
 {
-    echo "$prog '$1' '$2' '$3' '$4' '$5'" >>"$log"
-    $prog "$1" "$2" "$3" "$4" "$5" >>"$log" 2>&1 || exit $?
+    echo "$prog '$1' '$2' '$3' '$4'" >>"$log"
+    $prog "$1" "$2" "$3" "$4" >>"$log" 2>&1 || exit $?
 }
 
 failcompile()
 {
-    echo "$prog '$1' '$2' '$3' '$4' '$5'" >>"$log"
-    if $prog "$1" "$2" "$3" "$4" "$5" >>"$log" 2>&1; then
+    echo "$prog '$1' '$2' '$3' '$4'" >>"$log"
+    if $prog "$1" "$2" "$3" "$4" >>"$log" 2>&1; then
         exit 1
     fi
 }
 
 rm -f "$log"
 
-compile "xfree86+aliases(qwerty)" "" "" "" ""
-compile "xfree86+aliases(qwertz)" "" "" "pc+de" ""
-compile "xfree86+aliases(qwerty)" "complete" "complete" "pc+us" "pc(pc105)"
+compile "xfree86+aliases(qwertz)" "complete" "complete" "pc+de"
+compile "xfree86+aliases(qwerty)" "complete" "complete" "pc+us"
 compile "xfree86+aliases(qwertz)" "complete" "complete" \
-    "pc+de+level3(ralt_switch_for_alts_toggle)+group(alts_toggle)" \
-    "pc(pc104)"
+    "pc+de+level3(ralt_switch_for_alts_toggle)+group(alts_toggle)"
 
-failcompile "" "" "" "" "" ""
-failcompile "" "complete" "" "" "" ""
-failcompile "" "" "complete" "" "" ""
-failcompile "badnames" "complete" "complete" "pc+us" "pc(pc101)"
+failcompile "" "" "" ""
+failcompile "xfree86+aliases(qwerty)" "" "" ""
+failcompile "xfree86+aliases(qwertz)" "" "" "pc+de"
+failcompile "xfree86+aliases(qwertz)" "complete" "" "pc+de"
+failcompile "xfree86+aliases(qwertz)" "" "complete" "pc+de"
+failcompile "xfree86+aliases(qwertz)" "complete" "complete" ""
+failcompile "badnames" "complete" "pc+us" "pc(pc101)"