summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:13 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:13 +0000
commit37ebbbe7b11febaf548006a9b73db0eebf79881a (patch)
tree61b33bfceb94acec99084a416397d2838018b160
parent287ac4c6af61d8f9f95cd3b3219c979e1329a2fe (diff)
downloadxorg-app-xkbcomp-37ebbbe7b11febaf548006a9b73db0eebf79881a.tar.gz
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_901xf86-4_3_99_16
-rw-r--r--README.config8
-rw-r--r--README.enhancing16
-rw-r--r--expr.c15
-rw-r--r--geometry.c12
-rw-r--r--symbols.c57
-rw-r--r--xkbcomp.c42
-rw-r--r--xkbcomp.man4
-rw-r--r--xkbscan.c33
8 files changed, 123 insertions, 64 deletions
diff --git a/README.config b/README.config
index d4d289a..9a94577 100644
--- a/README.config
+++ b/README.config
@@ -19,7 +19,7 @@ don't need to touch any of xkb configuration files.
2. Selecting XKB Configuration
-The easiest and the most natural way how to specify a keyboard mapping is tu
+The easiest and the most natural way how to specify a keyboard mapping is to
use rules component. As its name suggests it describes a number of general
rules how to combine all bits and pieces into a valid and useful keyboard
mapping. All you need to do is to select a suitable rules file and then to
@@ -99,7 +99,7 @@ Then the configuration snippet could look like this:
Of course, this can be also done at runtime using utility setxkbmap. Shell
command loading the same keyboard mapping would look like:
- setxkmap -rules xfree86 -model logicordless -layout "us,cz,de" \
+ setxkbmap -rules xfree86 -model logicordless -layout "us,cz,de" \
-option "grp:alt_shift_toggle"
2.3 Even More Advanced Configuration
@@ -192,7 +192,7 @@ been obsoleted by previously described rules files which are far more flexi-
ble and allow simpler and more intuitive syntax. It is preserved merely for
compatibility reasons. Avoid using it if it is possible.
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/XKB-Config.sgml,v 1.2 2003/02/25 19:31:02 dawes Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/XKB-Config.sgml,v 1.4 dawes Exp $
-$XFree86: xc/programs/xkbcomp/README.config,v 1.3 2003/02/25 21:32:33 dawes Exp $
+$XFree86: xc/programs/xkbcomp/README.config,v 1.6 2003/09/21 01:55:04 dawes Exp $
diff --git a/README.enhancing b/README.enhancing
index a711d72..695cc5d 100644
--- a/README.enhancing
+++ b/README.enhancing
@@ -132,12 +132,12 @@ comfortable to add one additional XKB term - group. You can think of a group
as of a vector of columns per each keycode (naturally the dimension of this
vector may differ for different keycodes). What is it good for? The group is
not very useful unless you intend to use more than one logically different
-set of symbols (like more than one alphabet) defined in a single mapping
-table. But then, the group has a natural meaning - each symbol set has its
-own group and changing it means selecting a different one. XKB approach
-allows up to four different groups. The columns inside each group are called
-(shift) levels. The X server knows the current group and reports it together
-with modifier set and with a keycode in key events.
+set of symbols (like more than one alphabet) defined in a single mapping ta-
+ble. But then, the group has a natural meaning - each symbol set has its own
+group and changing it means selecting a different one. XKB approach allows
+up to four different groups. The columns inside each group are called (shift)
+levels. The X server knows the current group and reports it together with
+modifier set and with a keycode in key events.
To sum it up:
@@ -505,7 +505,7 @@ rules file described above the .lst file could look like:
And that should be it. Enjoy creating your own xkb mapping.
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/XKB-Enhancing.sgml,v 1.2 2003/02/25 19:31:02 dawes Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/XKB-Enhancing.sgml,v 1.2 dawes Exp $
-$XFree86: xc/programs/xkbcomp/README.enhancing,v 1.3 2003/02/25 21:32:33 dawes Exp $
+$XFree86: xc/programs/xkbcomp/README.enhancing,v 1.5 2003/10/19 19:57:44 dawes Exp $
diff --git a/expr.c b/expr.c
index 2b98266..f48bcb9 100644
--- a/expr.c
+++ b/expr.c
@@ -24,7 +24,7 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/programs/xkbcomp/expr.c,v 3.6 2002/06/05 00:00:37 dawes Exp $ */
+/* $XFree86: xc/programs/xkbcomp/expr.c,v 3.7 2003/08/06 14:04:05 eich Exp $ */
#include "xkbcomp.h"
#include "tokens.h"
@@ -569,9 +569,16 @@ ExprDef *left,*right;
if (expr->type==TypeString) {
register char *str;
str= XkbAtomGetString(NULL,expr->value.str);
- if ((str!=None)&&(strlen(str)==1)) {
- val_rtrn->uval= str[0];
- return True;
+ if (str!=None)
+ switch (strlen(str)) {
+ case 0:
+ val_rtrn->uval= 0;
+ return True;
+ case 1:
+ val_rtrn->uval= str[0];
+ return True;
+ default:
+ break;
}
}
if ((expr->type!=TypeInt)&&(expr->type!=TypeFloat)) {
diff --git a/geometry.c b/geometry.c
index 2cffc33..6a249de 100644
--- a/geometry.c
+++ b/geometry.c
@@ -24,7 +24,7 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/programs/xkbcomp/geometry.c,v 1.4 2002/06/05 00:00:37 dawes Exp $ */
+/* $XFree86: xc/programs/xkbcomp/geometry.c,v 1.5 2003/08/06 14:04:05 eich Exp $ */
#include "xkbcomp.h"
#include "tokens.h"
@@ -280,11 +280,11 @@ PropertyInfo * next;
info->nProps= 0;
}
for (tmp=pi;tmp!=NULL;tmp=next) {
- if (pi->name)
- uFree(pi->name);
- if (pi->value)
- uFree(pi->value);
- pi->name= pi->value=NULL;
+ if (tmp->name)
+ uFree(tmp->name);
+ if (tmp->value)
+ uFree(tmp->value);
+ tmp->name= tmp->value=NULL;
next= (PropertyInfo *)tmp->defs.next;
uFree(tmp);
}
diff --git a/symbols.c b/symbols.c
index 4eb2ef1..83c1527 100644
--- a/symbols.c
+++ b/symbols.c
@@ -24,7 +24,7 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/programs/xkbcomp/symbols.c,v 3.14 2002/12/20 20:18:33 paulo Exp $ */
+/* $XFree86: xc/programs/xkbcomp/symbols.c,v 3.16 2003/10/31 14:32:04 pascal Exp $ */
#include "xkbcomp.h"
#include "tokens.h"
@@ -1507,20 +1507,54 @@ register unsigned n;
}
static Bool
-FindAutomaticType(int width,KeySym *syms,Atom *typeNameRtrn)
+KSIsLower (KeySym ks)
{
+ KeySym lower, upper;
+ XConvertCase(ks, &lower, &upper);
+
+ if (lower == upper)
+ return False;
+ return (ks == lower ? True : False);
+}
+
+static Bool
+KSIsUpper (KeySym ks)
+{
+ KeySym lower, upper;
+ XConvertCase(ks, &lower, &upper);
+
+ if (lower == upper)
+ return False;
+ return (ks == upper ? True : False);
+}
+
+static Bool
+FindAutomaticType(int width,KeySym *syms,Atom *typeNameRtrn, Bool *autoType)
+{
+ *autoType = False;
if ((width==1)||(width==0)) {
*typeNameRtrn= XkbInternAtom(NULL,"ONE_LEVEL",False);
+ *autoType = True;
} else if (width == 2) {
- if ( syms && XkbKSIsLower(syms[0]) && XkbKSIsUpper(syms[1]) )
+ if ( syms && KSIsLower(syms[0]) && KSIsUpper(syms[1]) ) {
*typeNameRtrn= XkbInternAtom(NULL,"ALPHABETIC",False);
- else if ( syms && (XkbKSIsKeypad(syms[0]) || XkbKSIsKeypad(syms[1])) )
+ } else if ( syms &&
+ (XkbKSIsKeypad(syms[0]) || XkbKSIsKeypad(syms[1])) ) {
*typeNameRtrn= XkbInternAtom(NULL,"KEYPAD",False);
- else *typeNameRtrn= XkbInternAtom(NULL,"TWO_LEVEL",False);
+ *autoType = True;
+ } else {
+ *typeNameRtrn= XkbInternAtom(NULL,"TWO_LEVEL",False);
+ *autoType = True;
+ }
} else if (width <= 4 ) {
- if ( syms && XkbKSIsLower(syms[0]) && XkbKSIsUpper(syms[1]) )
- *typeNameRtrn= XkbInternAtom(NULL,
- "FOUR_LEVEL_ALPHABETIC",False);
+ if ( syms && KSIsLower(syms[0]) && KSIsUpper(syms[1]) )
+ if ( KSIsLower(syms[2]) && KSIsUpper(syms[3]) )
+ *typeNameRtrn= XkbInternAtom(NULL,
+ "FOUR_LEVEL_ALPHABETIC",False);
+ else
+ *typeNameRtrn= XkbInternAtom(NULL,
+ "FOUR_LEVEL_SEMIALPHABETIC",False);
+
else if ( syms && (XkbKSIsKeypad(syms[0]) || XkbKSIsKeypad(syms[1])) )
*typeNameRtrn= XkbInternAtom(NULL,
"FOUR_LEVEL_KEYPAD",False);
@@ -1558,7 +1592,7 @@ PrepareKeyDef(KeyInfo *key)
}
key->typesDefined |= 1 << i;
}
- if (key->actsDefined & 1) {
+ if ((key->actsDefined & 1) && key->acts[0]) {
key->acts[i]= uTypedCalloc(width, XkbAction);
if (key->acts[i] == NULL)
continue;
@@ -1566,7 +1600,7 @@ PrepareKeyDef(KeyInfo *key)
width * sizeof(XkbAction));
key->actsDefined |= 1 << i;
}
- if (key->symsDefined & 1) {
+ if ((key->symsDefined & 1) && key->syms[0]) {
key->syms[i]= uTypedCalloc(width, KeySym);
if (key->syms[i] == NULL)
continue;
@@ -1657,8 +1691,7 @@ unsigned types[XkbNumKbdGroups];
if (key->dfltType!=None)
key->types[i]= key->dfltType;
else if (FindAutomaticType(key->numLevels[i],key->syms[i],
- &key->types[i])) {
- autoType= True;
+ &key->types[i], &autoType)) {
}
else {
if (warningLevel>=5) {
diff --git a/xkbcomp.c b/xkbcomp.c
index 6b72d47..bf8a723 100644
--- a/xkbcomp.c
+++ b/xkbcomp.c
@@ -24,7 +24,7 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/programs/xkbcomp/xkbcomp.c,v 3.18 2002/11/15 03:14:12 dawes Exp $ */
+/* $XFree86: xc/programs/xkbcomp/xkbcomp.c,v 3.21 2003/10/08 11:13:03 eich Exp $ */
#include <stdio.h>
#include <ctype.h>
@@ -88,7 +88,6 @@ static Display * inDpy;
static Display * outDpy;
static Bool showImplicit= False;
static Bool synch= False;
-static Bool merge= False;
static Bool computeDflts= False;
static Bool xkblist= False;
unsigned warningLevel= 5;
@@ -135,8 +134,6 @@ Usage(int argc,char *argv[])
M(" default is all options off\n");
}
M("-m[ap] <map> Specifies map to compile\n");
- if (!xkblist)
- M("-merge Merge file with map on server\n");
M("-o <file> Specifies output file name\n");
if (!xkblist) {
M("-opt[ional] <parts> Specifies optional components of keymap\n");
@@ -199,6 +196,7 @@ register int i,tmp;
xkblist= True;
}
for (i=1;i<argc;i++) {
+ int itmp;
if ((argv[i][0]!='-')||(uStringEqual(argv[i],"-"))) {
if (!xkblist) {
if (inputFile==NULL)
@@ -236,7 +234,8 @@ register int i,tmp;
debugFlags= 1;
}
else {
- sscanf(argv[++i],"%i",&debugFlags);
+ if (sscanf(argv[++i],"%i",&itmp) == 1)
+ debugFlags = itmp;
}
INFO1("Setting debug flags to %d\n",debugFlags);
}
@@ -334,7 +333,7 @@ register int i,tmp;
else inputMap= argv[i];
}
else if ((strcmp(argv[i],"-merge")==0)&&(!xkblist)) {
- merge= True;
+ /* Ignored */
}
else if (strcmp(argv[i],"-o")==0) {
if (++i>=argc) {
@@ -392,10 +391,12 @@ register int i,tmp;
}
else if (strncmp(argv[i],"-p",2)==0) {
if (isdigit(argv[i][2])) {
- sscanf(&argv[i][2],"%i",&dirsToStrip);
+ if (sscanf(&argv[i][2],"%i",&itmp) == 1)
+ dirsToStrip = itmp;
}
else if ((i<(argc-1))&&(isdigit(argv[i+1][0]))) {
- sscanf(argv[++i],"%i",&dirsToStrip);
+ if (sscanf(argv[++i],"%i",&itmp) == 1)
+ dirsToStrip = itmp;
}
else {
dirsToStrip= 0;
@@ -443,12 +444,14 @@ register int i,tmp;
}
else if (strncmp(argv[i],"-w",2)==0) {
if ((i>=(argc-1))||(!isdigit(argv[i+1][0]))) {
+ warningLevel = 0;
if (isdigit(argv[i][1]))
- sscanf(&argv[i][1],"%i",&warningLevel);
- else warningLevel= 0;
+ if (sscanf(&argv[i][1],"%i",&itmp) == 1)
+ warningLevel = itmp;
}
else {
- sscanf(argv[++i],"%i",&warningLevel);
+ if (sscanf(argv[++i],"%i",&itmp) == 1)
+ warningLevel = itmp;
}
}
else if ((strcmp(argv[i],"-xkb")==0)&&(!xkblist)) {
@@ -874,16 +877,29 @@ Status status;
* -- Branden Robinson
*/
int outputFileFd;
+ int binMode = 0;
+ const char *openMode = "w";
unlink(outputFile);
+#ifdef O_BINARY
+ switch (outputFormat) {
+ case WANT_XKM_FILE:
+ binMode = O_BINARY;
+ openMode = "wb";
+ break;
+ default:
+ binMode = 0;
+ break;
+ }
+#endif
outputFileFd= open(outputFile, O_WRONLY|O_CREAT|O_EXCL,
- S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH|binMode);
if (outputFileFd<0) {
ERROR1("Cannot open \"%s\" to write keyboard description\n",
outputFile);
ACTION("Exiting\n");
exit(1);
}
- out= fdopen(outputFileFd, "w");
+ out= fdopen(outputFileFd, openMode);
/* end BR */
if (out==NULL) {
ERROR1("Cannot open \"%s\" to write keyboard description\n",
diff --git a/xkbcomp.man b/xkbcomp.man
index 481d2a3..29c19c1 100644
--- a/xkbcomp.man
+++ b/xkbcomp.man
@@ -3,7 +3,7 @@
.\"
.\"
.\"
-.\" $XFree86: xc/programs/xkbcomp/xkbcomp.man,v 1.10 2002/11/15 03:14:12 dawes Exp $
+.\" $XFree86: xc/programs/xkbcomp/xkbcomp.man,v 1.11 2003/07/28 21:57:02 herrb Exp $
.\"
.TH XKBCOMP 1 __xorgversion__
.SH NAME
@@ -38,7 +38,7 @@ is updated with the compiled keymap.
.PP
The name of the \fIdestination\fP is usually computed from the name
of the source, with the extension replaced as appropriate. When compiling
-a single map from a file which contains several maps, \fIxkbcom\fP constructs
+a single map from a file which contains several maps, \fIxkbcomp\fP constructs
the destination file name by appending an appropriate extension to the
name of the map to be used.
.SH OPTIONS
diff --git a/xkbscan.c b/xkbscan.c
index 45cbe0a..579583b 100644
--- a/xkbscan.c
+++ b/xkbscan.c
@@ -24,7 +24,7 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/programs/xkbcomp/xkbscan.c,v 3.11 2002/06/05 00:00:38 dawes Exp $ */
+/* $XFree86: xc/programs/xkbcomp/xkbscan.c,v 3.12 2003/08/06 14:04:05 eich Exp $ */
#include <stdio.h>
#include <ctype.h>
@@ -173,34 +173,37 @@ int ch;
int tmp,stop;
ch = stop = 0;
if (((tmp=getc(yyin))!=EOF) && (isdigit(tmp)) &&
- (tmp!='8') && (tmp!='9')) {
+ (tmp!='8') && (tmp!='9')) {
ch= (ch*8)+(tmp-'0');
}
else {
stop= 1;
ungetc(tmp,yyin);
}
- if ((!stop) && ((tmp=getc(yyin))!=EOF) && (isdigit(tmp)) &&
+ if (!stop) {
+ if (((tmp=getc(yyin))!=EOF) && (isdigit(tmp)) &&
(tmp!='8') && (tmp!='9')) {
- ch= (ch*8)+(tmp-'0');
- }
- else {
- stop= 1;
- ungetc(tmp,yyin);
+ ch= (ch*8)+(tmp-'0');
+ }
+ else {
+ stop= 1;
+ ungetc(tmp,yyin);
+ }
}
- if ((!stop) && ((tmp=getc(yyin))!=EOF) && (isdigit(tmp)) &&
+ if (!stop) {
+ if (((tmp=getc(yyin))!=EOF) && (isdigit(tmp)) &&
(tmp!='8') && (tmp!='9')) {
- ch= (ch*8)+(tmp-'0');
- }
- else {
- stop= 1;
- ungetc(tmp,yyin);
+ ch= (ch*8)+(tmp-'0');
+ }
+ else {
+ stop= 1;
+ ungetc(tmp,yyin);
+ }
}
}
}
else return ERROR_TOK;
}
-
if ( nInBuf < BUFSIZE-1 )
buf[nInBuf++] = ch;
}