From 82dd58358bd341f8ad71155a53a561cf311ac974 Mon Sep 17 00:00:00 2001 From: Alexey Gladkov Date: Sun, 28 Jan 2007 21:39:38 +0300 Subject: [PATCH] [SYSTEM] Apply patch from SUSE. Apply kbd-1.12.diff cumulative patch from SUSE distribution. --- data/keymaps/i386/include/ctrl.map | 3 +++ data/keymaps/i386/qwerty/defkeymap.map | 6 +++--- data/keymaps/i386/qwertz/fr_CH-latin1.map | 1 - data/keymaps/i386/qwertz/fr_CH.map | 1 - data/keymaps/mac/all/mac-de_CH.map | 2 ++ data/keymaps/mac/all/mac-dk-latin1.map | 4 +--- po/Makefile.in | 2 +- src/Makefile.in | 3 ++- src/kdfontop.c | 6 ++---- src/loadunimap.c | 19 ++++++++++++++++++- src/loadunimap.h | 6 ++++++ src/mapscrn.c | 1 + src/paths.h | 1 + src/psf.h | 7 +++++++ src/psffontop.c | 28 ++++++++++++++++++++-------- src/psffontop.h | 12 +++++++++++- src/psfxtable.c | 2 ++ src/setfont.c | 14 ++++++++++++++ 18 files changed, 94 insertions(+), 24 deletions(-) diff --git a/data/keymaps/i386/include/ctrl.map b/data/keymaps/i386/include/ctrl.map index 3db7259..3b5e3d3 100644 --- a/data/keymaps/i386/include/ctrl.map +++ b/data/keymaps/i386/include/ctrl.map @@ -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) diff --git a/data/keymaps/i386/qwerty/defkeymap.map b/data/keymaps/i386/qwerty/defkeymap.map index 520dd22..2ef9cc8 100644 --- a/data/keymaps/i386/qwerty/defkeymap.map +++ b/data/keymaps/i386/qwerty/defkeymap.map @@ -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" diff --git a/data/keymaps/i386/qwertz/fr_CH-latin1.map b/data/keymaps/i386/qwertz/fr_CH-latin1.map index ca2c8bc..5170219 100644 --- a/data/keymaps/i386/qwertz/fr_CH-latin1.map +++ b/data/keymaps/i386/qwertz/fr_CH-latin1.map @@ -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 diff --git a/data/keymaps/i386/qwertz/fr_CH.map b/data/keymaps/i386/qwertz/fr_CH.map index a195e2e..b82ca5a 100644 --- a/data/keymaps/i386/qwertz/fr_CH.map +++ b/data/keymaps/i386/qwertz/fr_CH.map @@ -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 diff --git a/data/keymaps/mac/all/mac-de_CH.map b/data/keymaps/mac/all/mac-de_CH.map index 91faf34..9842b40 100644 --- a/data/keymaps/mac/all/mac-de_CH.map +++ b/data/keymaps/mac/all/mac-de_CH.map @@ -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 diff --git a/data/keymaps/mac/all/mac-dk-latin1.map b/data/keymaps/mac/all/mac-dk-latin1.map index 75b2bc6..386e387 100644 --- a/data/keymaps/mac/all/mac-dk-latin1.map +++ b/data/keymaps/mac/all/mac-dk-latin1.map @@ -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 diff --git a/po/Makefile.in b/po/Makefile.in index 99e762a..0691bb4 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -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 diff --git a/src/Makefile.in b/src/Makefile.in index 5383eda..0c99a0a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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 diff --git a/src/kdfontop.c b/src/kdfontop.c index da81b64..d64f21f 100644 --- a/src/kdfontop.c +++ b/src/kdfontop.c @@ -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; } diff --git a/src/loadunimap.c b/src/loadunimap.c index c1d4620..98a6b54 100644 --- a/src/loadunimap.c +++ b/src/loadunimap.c @@ -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 1) + appendseparator(fp, 1, utf8); +#endif + if (debug) printf ("\nchar %03x: ", i); + for(j=0; jprev; - 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; } diff --git a/src/psffontop.h b/src/psffontop.h index 0611451..525a50f 100644 --- a/src/psffontop.h +++ b/src/psffontop.h @@ -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 */ diff --git a/src/psfxtable.c b/src/psfxtable.c index 1a55c85..3d112f7 100644 --- a/src/psfxtable.c +++ b/src/psfxtable.c @@ -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; diff --git a/src/setfont.c b/src/setfont.c index 8b37c21..4e9b928 100644 --- a/src/setfont.c +++ b/src/setfont.c @@ -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"); -- 2.7.4