summaryrefslogtreecommitdiff
path: root/xkb/xkmread.c
diff options
context:
space:
mode:
authorKevin E Martin <kem@freedesktop.org>2006-07-28 17:16:32 -0400
committerKevin E Martin <kem@freedesktop.org>2006-07-28 17:16:32 -0400
commit654619d76c779606f2315782fc01d1410399fa3b (patch)
treeb9d845c0a7284a4e2bf00d9e1d8e02f3a8c08446 /xkb/xkmread.c
parent79016d4036786b091a9b9d1133a6cdfedd6c277d (diff)
Revert xkb changes that broke XkbGetKeyboard()
Diffstat (limited to 'xkb/xkmread.c')
-rw-r--r--xkb/xkmread.c94
1 files changed, 10 insertions, 84 deletions
diff --git a/xkb/xkmread.c b/xkb/xkmread.c
index 5441243ed..fec86874f 100644
--- a/xkb/xkmread.c
+++ b/xkb/xkmread.c
@@ -167,89 +167,6 @@ int count,nRead=0;
return nRead;
}
-unsigned
-_XkbKSCheckCase(KeySym ks)
-{
-unsigned set,rtrn;
-
- set= (ks & (~0xff)) >> 8;
- rtrn= 0;
- switch (set) {
- case 0: /* latin 1 */
- if (((ks>=XK_A)&&(ks<=XK_Z))||
- ((ks>=XK_Agrave)&&(ks<=XK_THORN)&&(ks!=XK_multiply))) {
- rtrn|= _XkbKSUpper;
- }
- if (((ks>=XK_a)&&(ks<=XK_z))||
- ((ks>=XK_agrave)&&(ks<=XK_ydiaeresis))) {
- rtrn|= _XkbKSLower;
- }
- break;
- case 1: /* latin 2 */
- if (((ks>=XK_Aogonek)&&(ks<=XK_Zabovedot)&&(ks!=XK_breve))||
- ((ks>=XK_Racute)&&(ks<=XK_Tcedilla))) {
- rtrn|= _XkbKSUpper;
- }
- if (((ks>=XK_aogonek)&&(ks<=XK_zabovedot)&&(ks!=XK_caron))||
- ((ks>=XK_racute)&&(ks<=XK_tcedilla))) {
- rtrn|= _XkbKSLower;
- }
- break;
- case 2: /* latin 3 */
- if (((ks>=XK_Hstroke)&&(ks<=XK_Jcircumflex))||
- ((ks>=XK_Cabovedot)&&(ks<=XK_Scircumflex))) {
- rtrn|= _XkbKSUpper;
- }
- if (((ks>=XK_hstroke)&&(ks<=XK_jcircumflex))||
- ((ks>=XK_cabovedot)&&(ks<=XK_scircumflex))) {
- rtrn|= _XkbKSLower;
- }
- break;
- case 3: /* latin 4 */
- if (((ks>=XK_Rcedilla)&&(ks<=XK_Tslash))||
- (ks==XK_ENG)||
- ((ks>=XK_Amacron)&&(ks<=XK_Umacron))) {
- rtrn|= _XkbKSUpper;
- }
- if (((ks>=XK_rcedilla)&&(ks<=XK_tslash))||
- (ks==XK_eng)||
- ((ks>=XK_amacron)&&(ks<=XK_umacron))) {
- rtrn|= _XkbKSLower;
- }
- break;
- case 18: /* latin 8 */
- if ((ks==XK_Babovedot)||
- ((ks>=XK_Dabovedot)&&(ks<=XK_Wacute))||
- ((ks>=XK_Ygrave)&&(ks<=XK_Fabovedot))||
- (ks==XK_Mabovedot)||
- (ks==XK_Pabovedot)||
- (ks==XK_Sabovedot)||
- (ks==XK_Wdiaeresis)||
- ((ks>=XK_Wcircumflex)&&(ks<=XK_Ycircumflex))) {
- rtrn|= _XkbKSUpper;
- }
- if ((ks==XK_babovedot)||
- (ks==XK_dabovedot)||
- (ks==XK_fabovedot)||
- (ks==XK_mabovedot)||
- ((ks>=XK_wgrave)&&(ks<=XK_wacute))||
- (ks==XK_ygrave)||
- ((ks>=XK_wdiaeresis)&&(ks<=XK_ycircumflex))) {
- rtrn|= _XkbKSLower;
- }
- break;
- case 19: /* latin 9 */
- if ((ks==XK_OE)||(ks==XK_Ydiaeresis)) {
- rtrn|= _XkbKSUpper;
- }
- if (ks==XK_oe) {
- rtrn|= _XkbKSLower;
- }
- break;
- }
- return rtrn;
-}
-
/***====================================================================***/
static int
@@ -1251,10 +1168,14 @@ int nRead;
*loaded_rtrn|= XkmGeometryMask;
break;
default:
+ _XkbLibError(_XkbErrBadImplementation,
+ XkbConfigText(tmpTOC.type,XkbMessage),0);
nRead= 0;
break;
}
if (nRead!=tmpTOC.size) {
+ _XkbLibError(_XkbErrBadLength,XkbConfigText(tmpTOC.type,XkbMessage),
+ nRead-tmpTOC.size);
return 0;
}
return (nRead>=0);
@@ -1288,6 +1209,8 @@ char name[100];
return _XkbDupString(name);
break;
default:
+ _XkbLibError(_XkbErrBadImplementation,
+ XkbConfigText(tmpTOC.type,XkbMessage),0);
break;
}
return NULL;
@@ -1353,6 +1276,8 @@ unsigned which= need|want;
tmp= ReadXkmGeometry(file,result);
break;
default:
+ _XkbLibError(_XkbErrBadImplementation,
+ XkbConfigText(tmpTOC.type,XkbMessage),0);
tmp= 0;
break;
}
@@ -1362,7 +1287,8 @@ unsigned which= need|want;
result->defined|= (1<<toc[i].type);
}
if (nRead!=tmpTOC.size) {
- return 0;
+ _XkbLibError(_XkbErrBadLength,XkbConfigText(tmpTOC.type,XkbMessage),
+ nRead-tmpTOC.size);
}
}
return which;