Lines Matching defs:xkb
44 XkbAllocCompatMap(XkbDescPtr xkb, unsigned which, unsigned nSI)
49 if (!xkb)
51 if (xkb->compat) {
52 if (xkb->compat->size_si >= nSI)
54 compat = xkb->compat;
87 xkb->compat = compat;
92 XkbFreeCompatMap(XkbDescPtr xkb, unsigned which, Bool freeMap)
96 if ((xkb == NULL) || (xkb->compat == NULL))
98 compat = xkb->compat;
112 xkb->compat = NULL;
120 XkbAllocNames(XkbDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases)
124 if (xkb == NULL)
126 if (xkb->names == NULL) {
127 xkb->names = calloc(1, sizeof(XkbNamesRec));
128 if (xkb->names == NULL)
131 names = xkb->names;
132 if ((which & XkbKTLevelNamesMask) && (xkb->map != NULL) &&
133 (xkb->map->types != NULL)) {
137 type = xkb->map->types;
138 for (i = 0; i < xkb->map->num_types; i++, type++) {
147 if ((!XkbIsLegalKeycode(xkb->min_key_code)) ||
148 (!XkbIsLegalKeycode(xkb->max_key_code)) ||
149 (xkb->max_key_code < xkb->min_key_code))
151 names->keys = calloc((xkb->max_key_code + 1), sizeof(XkbKeyNameRec));
207 XkbFreeNames(XkbDescPtr xkb, unsigned which, Bool freeMap)
211 if ((xkb == NULL) || (xkb->names == NULL))
213 names = xkb->names;
217 XkbClientMapPtr map = xkb->map;
247 xkb->names = NULL;
255 XkbAllocControls(XkbDescPtr xkb, unsigned which)
257 if (xkb == NULL)
260 if (xkb->ctrls == NULL) {
261 xkb->ctrls = calloc(1, sizeof(XkbControlsRec));
262 if (!xkb->ctrls)
269 XkbFreeControls(XkbDescPtr xkb, unsigned which, Bool freeMap)
271 if (freeMap && (xkb != NULL) && (xkb->ctrls != NULL)) {
272 free(xkb->ctrls);
273 xkb->ctrls = NULL;
281 XkbAllocIndicatorMaps(XkbDescPtr xkb)
283 if (xkb == NULL)
285 if (xkb->indicators == NULL) {
286 xkb->indicators = calloc(1, sizeof(XkbIndicatorRec));
287 if (!xkb->indicators)
294 XkbFreeIndicatorMaps(XkbDescPtr xkb)
296 if ((xkb != NULL) && (xkb->indicators != NULL)) {
297 free(xkb->indicators);
298 xkb->indicators = NULL;
308 XkbDescRec *xkb;
310 xkb = calloc(1, sizeof(XkbDescRec));
311 if (xkb)
312 xkb->device_spec = XkbUseCoreKbd;
313 return xkb;
317 XkbFreeKeyboard(XkbDescPtr xkb, unsigned which, Bool freeAll)
319 if (xkb == NULL)
324 XkbFreeClientMap(xkb, XkbAllClientInfoMask, TRUE);
326 XkbFreeServerMap(xkb, XkbAllServerInfoMask, TRUE);
328 XkbFreeCompatMap(xkb, XkbAllCompatMask, TRUE);
330 XkbFreeIndicatorMaps(xkb);
332 XkbFreeNames(xkb, XkbAllNamesMask, TRUE);
333 if ((which & XkbGeometryMask) && (xkb->geom != NULL)) {
334 XkbFreeGeometry(xkb->geom, XkbGeomAllMask, TRUE);
336 xkb->geom = NULL;
339 XkbFreeControls(xkb, XkbAllControlsMask, TRUE);
341 free(xkb);