[SYSTEM] Apply patch from SUSE.
authorAlexey Gladkov <legion@altlinux.org>
Sun, 28 Jan 2007 18:39:38 +0000 (21:39 +0300)
committerAlexey Gladkov <legion@altlinux.org>
Sun, 28 Jan 2007 18:39:38 +0000 (21:39 +0300)
Apply kbd-1.12.diff cumulative patch from SUSE distribution.

18 files changed:
data/keymaps/i386/include/ctrl.map
data/keymaps/i386/qwerty/defkeymap.map
data/keymaps/i386/qwertz/fr_CH-latin1.map
data/keymaps/i386/qwertz/fr_CH.map
data/keymaps/mac/all/mac-de_CH.map
data/keymaps/mac/all/mac-dk-latin1.map
po/Makefile.in
src/Makefile.in
src/kdfontop.c
src/loadunimap.c
src/loadunimap.h
src/mapscrn.c
src/paths.h
src/psf.h
src/psffontop.c
src/psffontop.h
src/psfxtable.c
src/setfont.c

index 3db7259..3b5e3d3 100644 (file)
@@ -1,3 +1,6 @@
 keycode  29 = Caps_Lock
 keycode  58 = Control
 keycode  97 = Compose
+# keycode  97 = Control
+#      Shift keycode 97 = Compose is also popular
+# (Right Ctrl + Shift for Compose)
index 520dd22..2ef9cc8 100644 (file)
@@ -251,9 +251,9 @@ keycode 121 =
 keycode 122 =
 keycode 123 =
 keycode 124 =
-keycode 125 =
-keycode 126 =
-keycode 127 =
+keycode 125 = Decr_Console Last_Console Incr_Console Compose
+keycode 126 = Incr_Console Last_Console Decr_Console Compose
+keycode 127 = Compose Decr_Console Incr_Console Last_Console 
 string F1 = "\033[[A"
 string F2 = "\033[[B"
 string F3 = "\033[[C"
index ca2c8bc..5170219 100644 (file)
@@ -3,7 +3,6 @@
 keymaps 0-2,4-6,8,12
 include "qwertz-layout"
 include "linux-with-alt-and-altgr"
-       plain keycode  83 = KP_Comma
 strings as usual
 
 keycode   1 = Escape           Escape
index a195e2e..b82ca5a 100644 (file)
@@ -3,7 +3,6 @@
 keymaps 0-2,4-6,8,12
 include "qwertz-layout"
 include "linux-with-alt-and-altgr"
-       plain keycode  83 = KP_Comma
 strings as usual
 
 keycode   1 = Escape           Escape
index 91faf34..9842b40 100644 (file)
@@ -43,3 +43,5 @@ keycode 43 = comma semicolon
 keycode 44 = minus underscore backslash Control_underscore Meta_minus Meta_Control_underscore
 keycode 47 = period colon
 keycode 10 = less greater
+keycode 16 = z
+keycode  6 = y
index 75b2bc6..386e387 100644 (file)
@@ -28,7 +28,7 @@ keycode  33 = aring           Aring
 keycode  30 = diaeresis                circumflex      asciitilde
 keycode  41 = ae               AE              adiaeresis      Adiaeresis
 keycode  39 = oslash           Oslash          odiaeresis      Odiaeresis
-keycode  42 = numbersign       apostrophe
+keycode  42 = apostrophe       asterisk
 keycode  43 = comma            semicolon
 keycode  47 = period           colon
 keycode  44 = minus            underscore       Meta_minus
@@ -36,8 +36,6 @@ keycode  44 = minus            underscore       Meta_minus
 keycode  49 = space            space            Meta_space      nul
 keycode  10 = less             greater          bar
 
-keycode  16 = z
-keycode   6 = y
 
        alt keycode 12 = at
        alt keycode 50 = bar
index 99e762a..0691bb4 100644 (file)
@@ -13,7 +13,7 @@ INTL = /usr/share/gettext/intl
 FOREIGN=
 SHELL = /bin/sh
 
-prefix = $(DESTDIR)@prefix@
+prefix = $(DESTDIR)/usr
 datadir = $(prefix)/share
 localedir = $(datadir)/locale
 gnulocaledir = $(prefix)/share/locale
index 5383eda..0c99a0a 100644 (file)
@@ -54,7 +54,8 @@ SHCMDS  = unicode_start unicode_stop
 
 WARN   = -Wall -Wmissing-prototypes -Wstrict-prototypes
 DEFS   = -DDATADIR=\"$(DATA_DIR)\"
-CFLAGS  = -O2
+RPM_OPT_FLAGS = -O2 -Wall
+CFLAGS  = $(RPM_OPT_FLAGS)
 LDFLAGS = -s
 
 CC     = gcc
index da81b64..d64f21f 100644 (file)
@@ -170,6 +170,8 @@ getfont(int fd, char *buf, int *count, int *width, int *height) {
                return -1;
        }
 
+       /* The other methods do not support width != 8 */
+       if (width) *width = 8;
        /* Second attempt: GIO_FONTX */
        cfd.charcount = *count;
        cfd.charheight = 0;
@@ -179,8 +181,6 @@ getfont(int fd, char *buf, int *count, int *width, int *height) {
                *count = cfd.charcount;
                if (height)
                        *height = cfd.charheight;
-               if (width)
-                       *width = 8;
                return 0;
        }
        if (errno != ENOSYS && errno != EINVAL) {
@@ -201,8 +201,6 @@ getfont(int fd, char *buf, int *count, int *width, int *height) {
        *count = 256;
        if (height)
                *height = 0;    /* undefined, at most 32 */
-       if (width)
-               *width = 8;
        return 0;
 }
 
index c1d4620..98a6b54 100644 (file)
@@ -35,6 +35,7 @@ static char *unisuffixes[] = { "", ".uni", 0 };
 #include "version.h"
 int verbose = 0;
 int force = 0;
+int debug = 0;
 
 static void
 usage(void) {
@@ -345,13 +346,29 @@ appendunicodemap(int fd, FILE *fp, int fontsize, int utf8) {
        descr = getunicodemap(fd);
        list = descr.entries;
 
+               
        for(i=0; i<fontsize; i++) {
-               for(j=0; j<descr.entry_ct; j++)
+#if 0
+               /* More than one mapping is not a sequence! */
+               int no = 0;
+               for(j=0; j<descr.entry_ct; j++) 
                        if (list[j].fontpos == i)
+                               no++;
+               if (no > 1)
+                       appendseparator(fp, 1, utf8);
+#endif         
+               if (debug) printf ("\nchar %03x: ", i);
+               for(j=0; j<descr.entry_ct; j++)
+                       if (list[j].fontpos == i) {
+                               if (debug)
+                                       printf ("%04x ", list[j].unicode);
                                appendunicode(fp, list[j].unicode, utf8);
+                       }
                appendseparator(fp, 0, utf8);
        }
 
+
+       if (debug) printf ("\n");
        if (verbose)
                printf(_("Appended Unicode map\n"));
 }
index 7c4aec0..8a1b393 100644 (file)
@@ -1,4 +1,10 @@
 /* loadunimap.h */
+
+#ifndef _LOADUNIMAP_H
+#define _LOADUNIMAP_H
+
 void saveunicodemap(int fd, char *oufil);      /* save humanly readable */
 void loadunicodemap(int fd, char *ufil);
 void appendunicodemap(int fd, FILE *fp, int ct, int utf8);
+
+#endif         /* _LOADUNIMAP_H */
index f93ae9d..8793eb5 100644 (file)
@@ -32,6 +32,7 @@ static char *mapsuffixes[] = { "", ".trans", "_to_uni.trans", 0 };
 #include "version.h"
 
 int verbose = 0;
+int debug = 0;
 
 int
 main(int argc, char *argv[]) {
index 9c15303..10d3a15 100644 (file)
@@ -28,3 +28,4 @@ extern char pathname[];
 extern void fpclose(FILE *fp);
 
 extern int verbose;
+extern int debug;
index 5019d87..e2ef799 100644 (file)
--- a/src/psf.h
+++ b/src/psf.h
@@ -1,3 +1,5 @@
+/* psf.h */
+
 /*
  * Format of a psf font file:
  *
@@ -30,6 +32,9 @@
  * namely when there is no precomposed Unicode value for the glyph.
  */
 
+#ifndef _PSF_H
+#define _PSF_H
+
 
 #define PSF1_MAGIC0    0x36
 #define PSF1_MAGIC1    0x04
@@ -91,3 +96,5 @@ struct psf2_header {
 #define PSF2_MAGIC_OK(x)       ((x)[0]==PSF2_MAGIC0 && (x)[1]==PSF2_MAGIC1 \
                                && (x)[2]==PSF2_MAGIC2 && (x)[3]==PSF2_MAGIC3)
 
+
+#endif /* _PSF_H */
index a99d9e7..9a2252f 100644 (file)
@@ -10,6 +10,7 @@
 #include "psf.h"
 #include "psffontop.h"
 #include "utf8.h"
+#include "paths.h"
 
 extern char *progname;
 
@@ -32,16 +33,18 @@ addpair(struct unicode_list *up, unsigned int uc) {
 
 static void
 addseq(struct unicode_list *up, unsigned int uc) {
-       struct unicode_list *ul;
        struct unicode_seq *us;
+       struct unicode_seq *usl;
+       struct unicode_list *ul = up->prev;
 
-       ul = up->prev;
+       usl = ul->seq;
+       while (usl->next) usl = usl->next;
        us = xmalloc(sizeof(struct unicode_seq));
        us->uc = uc;
-       us->prev = ul->seq->prev;
-       us->prev->next = us;
+       us->prev = usl;
        us->next = NULL;
-       ul->seq->prev = us;
+       usl->next = us;
+       //ul->seq->prev = us;
 }
 
 static unsigned int
@@ -190,7 +193,7 @@ readpsffont(FILE *fontf, char **allbufp, int *allszp,
         * just read the entire file.
         */
        if (fontf) {
-               inputbuflth = 16384;    /* random */
+               inputbuflth = MAXFONTSIZE/4;    /* random */
                inputbuf = xmalloc(inputbuflth);
                n = 0;
 
@@ -366,6 +369,13 @@ appendunicode(FILE *fp, unsigned int uc, int utf8) {
                perror("appendunimap");
                exit(1);
        }
+       if (debug) {
+               printf ("(");
+               if (!utf8)
+                       printf ("U+");
+               while (n < 6) printf ("%02x ", out[n++]);
+               printf (")");
+       }
 }
 
 void
@@ -437,7 +447,7 @@ writepsffontheader(FILE *ofil, int width, int height, int fontlen,
 }
 
 
-void
+int
 writepsffont(FILE *ofil, char *fontbuf, int width, int height, int fontlen,
             int psftype, struct unicode_list *uclistheads) {
        int bytewidth, charsize, flags, utf8, i;
@@ -456,7 +466,8 @@ writepsffont(FILE *ofil, char *fontbuf, int width, int height, int fontlen,
        utf8 = (psftype == 2);
 
        fwrite(fontbuf, charsize, fontlen, ofil);
-       if (uclistheads != NULL) {
+       /* unimaps: -1 => do nothing: caller will append map */
+       if (uclistheads != NULL && uclistheads != (struct unicode_list*)-1) {
                struct unicode_list *ul;
                struct unicode_seq *us;
 
@@ -475,5 +486,6 @@ writepsffont(FILE *ofil, char *fontbuf, int width, int height, int fontlen,
                        appendseparator(ofil, 0, utf8);
                }
        }
+       return utf8;
 }
 
index 0611451..525a50f 100644 (file)
@@ -1,3 +1,11 @@
+/* psffontop.h */
+
+#ifndef _PSFFONTOP_H
+#define _PSFFONTOP_H
+
+/* Maximum font size that we try to handle */
+#define MAXFONTSIZE 65536
+
 typedef unsigned int unicode;
 
 struct unicode_seq {
@@ -17,7 +25,7 @@ extern int readpsffont(FILE *fontf, char **allbufp, int *allszp,
                       int *fontwidthp, int *fontlenp, int fontpos0,
                       struct unicode_list **uclistheadsp);
 
-extern void writepsffont(FILE *ofil, char *fontbuf,
+extern int writepsffont(FILE *ofil, char *fontbuf,
                         int width, int height, int fontlen, int psftype,
                         struct unicode_list *uclistheads);
 
@@ -29,3 +37,5 @@ extern void writepsffontheader(FILE *ofil,
 
 extern void appendunicode(FILE *fp, unsigned int uc, int utf8);
 extern void appendseparator(FILE *fp, int seq, int utf8);
+
+#endif         /* _PSFFONTOP_H */
index 1a55c85..3d112f7 100644 (file)
@@ -225,6 +225,8 @@ read_itable(FILE *itab, int fontlen, struct unicode_list **uclistheadsp) {
        }
 }
 
+int debug = 0;
+
 int
 main(int argc, char **argv) {
        char *ifname, *ofname, *itname, *otname;
index 8b37c21..4e9b928 100644 (file)
@@ -48,6 +48,7 @@ extern void disactivatemap(int fd);
 
 int verbose = 0;
 int force = 0;
+int debug = 0;
 
 /* search for the font in these directories (with trailing /) */
 char *fontdirpath[] = { "", DATADIR "/" FONTDIR "/", 0 };
@@ -331,15 +332,28 @@ do_loadtable(int fd, struct unicode_list *uclistheads, int fontsize) {
        up = xmalloc(maxct * sizeof(struct unipair));
        for (i = 0; i < fontsize; i++) {
                ul = uclistheads[i].next;
+               if (debug) printf ("char %03x:", i);
                while(ul) {
                        us = ul->seq;
                        if (us && ! us->next) {
                                up[ct].unicode = us->uc;
                                up[ct].fontpos = i;
                                ct++;
+                               if (debug) printf (" %04x", us->uc);
                        }
+                       else
+                               if (debug) {
+                                       printf (" seq: <");
+                                       while (us) {
+                                               printf (" %04x", us->uc);
+                                               us = us->next;
+                                       }
+                                       printf (" >");
+                               }
                        ul = ul->next;
+                       if (debug) printf (",");
                }
+               if (debug) printf ("\n");
        }
        if (ct != maxct) {
                char *u = _("%s: bug in do_loadtable\n");