Commit Graph

8 Commits (e55a0cead1a5ce907de3171366c706280b9b875d)

Author SHA1 Message Date
Ran Benita 1d5ae2263a makekeys: mark keysym_names as static
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-01-11 00:26:58 +02:00
Jasper St. Pierre 0628b9b2b3 makekeys: Add a gcc pragma to ignore -Woverlength-strings 2014-01-01 13:03:33 -05:00
Jasper St. Pierre eef3ab2364 makekeys: Put a comment describing the origin of the file 2014-01-01 13:03:32 -05:00
Jasper St. Pierre 68c61e7f7d ks_tables: Put all keysym names in one giant block
This makes the file take two segments instead of potentially many, causing
relocation issues.
2014-01-01 13:03:29 -05:00
Jasper St. Pierre 938a2c379b makekeys: Move all of the table generation to Python
This makes it easier to run the Python script manually.
2014-01-01 13:01:18 -05:00
Jasper St. Pierre 870913c234 makekeys: Remove some semis
Python doesn't have these
2014-01-01 13:01:18 -05:00
David Herrmann 7b3bd11f92 Add xkb_keysym_from_name() flags argument for case-insensitive search
This adds a flags argument to xkb_keysym_from_name() so we can perform a
case-insensitive search. This should really be supported as many keysyms
have really weird capitalization-rules.

However, as this may produce conflicts, users must be warned to only use
this for fallback paths or error-recovery. This is also the reason why the
internal XKB parsers still use the case-sensitive search.

This also adds some test-cases so the expected results are really
produced. The binary-size does _not_ change with this patch. However,
case-sensitive search may be slightly slower with this patch. But this is
barely measurable.

[ran: use bool instead of int for icase, add a recommendation to the
doc, and test a couple "thorny" cases.]

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-16 21:29:09 +02:00
Ran Benita 5fff637e07 makekeys: replace helper with python script and binary search
This removes the complicated and undocumented hash-table creation-helper
and replaces it with an autogenerated sorted array. The search uses simple
bsearch() now.

We also tried using gperf but it turned out to generate way to big
hashtables and when reducing the size it isn't really faster than
bsearch() anymore.

There are no users complaining about the speed of keysym lookups and we
have no benchmarks that tell that we are horribly slow. Hence, we can
safely use the simpler approach and drop all that old code.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-16 21:10:04 +02:00