Beispiel #1
0
static Status
XkbInitNames(XkbSrvInfoPtr xkbi,SrvXkmInfo *file)
{
XkbDescPtr	xkb;
XkbNamesPtr	names;
Status		rtrn;
Atom		unknown;

    xkb= xkbi->desc;
    if ((rtrn=XkbAllocNames(xkb,XkbAllNamesMask,0,0))!=Success)
	return rtrn;
    unknown= CREATE_ATOM("unknown");
    names = xkb->names;
    if (names->keycodes==None)		names->keycodes= unknown;
    if (names->geometry==None)		names->geometry= unknown;
    if (names->phys_symbols==None)	names->phys_symbols= unknown;
    if (names->symbols==None)		names->symbols= unknown;
    if (names->types==None)		names->types= unknown;
    if (names->compat==None)		names->compat= unknown;
    if ((file->xkbinfo.defined&XkmVirtualModsMask)==0) {
	if (names->vmods[vmod_NumLock]==None)
	    names->vmods[vmod_NumLock]= CREATE_ATOM("NumLock");
	if (names->vmods[vmod_Alt]==None)
	    names->vmods[vmod_Alt]= CREATE_ATOM("Alt");
	if (names->vmods[vmod_AltGr]==None)
	    names->vmods[vmod_AltGr]= CREATE_ATOM("ModeSwitch");
    }

    if (((file->xkbinfo.defined&XkmIndicatorsMask)==0)||
	((file->xkbinfo.defined&XkmGeometryMask)==0)) {
	initIndicatorNames(NULL,xkb);
	if (names->indicators[LED_CAPS-1]==None)
	    names->indicators[LED_CAPS-1] = CREATE_ATOM("Caps Lock");
	if (names->indicators[LED_NUM-1]==None)
	    names->indicators[LED_NUM-1] = CREATE_ATOM("Num Lock");
	if (names->indicators[LED_SCROLL-1]==None)
	    names->indicators[LED_SCROLL-1] = CREATE_ATOM("Scroll Lock");
#ifdef LED_COMPOSE
	if (names->indicators[LED_COMPOSE-1]==None)
	    names->indicators[LED_COMPOSE-1] = CREATE_ATOM("Compose");
#endif
    }
#ifdef DEBUG_RADIO_GROUPS
    if (names->num_rg<1) {
	names->radio_groups= (Atom *)_XkbCalloc(RG_COUNT, sizeof(Atom));
	if (names->radio_groups) {
	    names->num_rg = RG_COUNT;
	    names->radio_groups[RG_BOGUS_FUNCTION_GROUP]= CREATE_ATOM("BOGUS");
	}
    }
#endif
    if (xkb->geom!=NULL)
	 names->geometry= xkb->geom->name;
    else names->geometry= unknown;
    return Success;
}
Beispiel #2
0
static Status
XkbInitNames(XkbSrvInfoPtr xkbi)
{
XkbDescPtr	xkb;
XkbNamesPtr	names;
Status		rtrn;
Atom		unknown;

    xkb= xkbi->desc;
    if ((rtrn=XkbAllocNames(xkb,XkbAllNamesMask,0,0))!=Success)
	return rtrn;
    unknown= CREATE_ATOM("unknown");
    names = xkb->names;
    if (names->keycodes==None)		names->keycodes= unknown;
    if (names->geometry==None)		names->geometry= unknown;
    if (names->phys_symbols==None)	names->phys_symbols= unknown;
    if (names->symbols==None)		names->symbols= unknown;
    if (names->types==None)		names->types= unknown;
    if (names->compat==None)		names->compat= unknown;
    if (!(xkb->defined & XkmVirtualModsMask)) {
        if (names->vmods[vmod_NumLock]==None)
            names->vmods[vmod_NumLock]= CREATE_ATOM("NumLock");
        if (names->vmods[vmod_Alt]==None)
            names->vmods[vmod_Alt]= CREATE_ATOM("Alt");
        if (names->vmods[vmod_AltGr]==None)
            names->vmods[vmod_AltGr]= CREATE_ATOM("ModeSwitch");
    }

    if (!(xkb->defined & XkmIndicatorsMask) ||
        !(xkb->defined & XkmGeometryMask)) {
        initIndicatorNames(NULL,xkb);
        if (names->indicators[LED_CAPS-1]==None)
            names->indicators[LED_CAPS-1] = CREATE_ATOM("Caps Lock");
        if (names->indicators[LED_NUM-1]==None)
            names->indicators[LED_NUM-1] = CREATE_ATOM("Num Lock");
        if (names->indicators[LED_SCROLL-1]==None)
            names->indicators[LED_SCROLL-1] = CREATE_ATOM("Scroll Lock");
#ifdef LED_COMPOSE
        if (names->indicators[LED_COMPOSE-1]==None)
            names->indicators[LED_COMPOSE-1] = CREATE_ATOM("Compose");
#endif
    }

    if (xkb->geom!=NULL)
	 names->geometry= xkb->geom->name;
    else names->geometry= unknown;

    return Success;
}