makekeys: Move all of the table generation to Python

This makes it easier to run the Python script manually.
master
Jasper St. Pierre 2013-07-17 17:49:10 -04:00
parent 870913c234
commit 938a2c379b
2 changed files with 4 additions and 3 deletions

View File

@ -192,8 +192,7 @@ update-keysyms:
-e 's/#define\s*\(\w*\)XK_/#define XKB_KEY_\1/' \
-e '/\(#ifdef\|#ifndef\|#endif\)/d' $(KEYSYMDEFS) >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
echo -en '\n\n#endif\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
echo -en '/* This file is autogenerated from Makefile.am; please do not commit directly. */\n\n' > $(top_srcdir)/src/ks_tables.h
LC_CTYPE=C python $(top_srcdir)/makekeys.py $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h >> $(top_srcdir)/src/ks_tables.h
LC_CTYPE=C python $(top_srcdir)/makekeys.py $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h > $(top_srcdir)/src/ks_tables.h
# Run this if you add/remove a new keyword to the xkbcomp scanner,
# or just want to regenerate the gperf file.

View File

@ -6,7 +6,9 @@ pattern = re.compile(r'^#define\s+XKB_KEY_(?P<name>\w+)\s+(?P<value>0x[0-9a-fA-F
matches = [pattern.match(line) for line in open(sys.argv[1])]
entries = [(m.group("name"), int(m.group("value"), 16)) for m in matches if m]
print('''struct name_keysym {
print('''/* This file is autogenerated from Makefile.am; please do not commit directly. */
struct name_keysym {
const char *name;
xkb_keysym_t keysym;
};\n''')