|
33a66515
|
2012-09-12T19:55:06
|
|
API change: Rename xkb_map_* and group -> layout
Move xkb_map_* functions to xkb_keymap_*, xkb_key_* functions under
either xkb_keymap or xkb_state, and rename groups to layout in all
user-visible API.
Backwards-compatible hooks are provided, such that old source will
build, but silently mangled to the new names, and old binaries will
also continue to work.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
005dee2b
|
2012-09-20T23:28:27
|
|
Add _xkbcommon_ prefix to parser and lexer symbols
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
80e15681
|
2012-09-12T19:52:30
|
|
Add xkbcommon-compat.h and compat.c
So we can start renaming stuff while retaining backwards source and
binary compatibility.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
2c96828f
|
2012-09-19T16:44:15
|
|
test: add print-compiled-keymap tool
This just prints the compiled keymap string for to the given command
line arguments. This often useful when developing.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
6b66afc4
|
2012-09-19T15:56:07
|
|
state: handle ACTION_LOCK_NO_{UN,}LOCK for mods
xkblib spec says:
XkbSA_LockNoLock If set, and the action type is XkbSA_LockMods,
the server only unlocks the action modifiers.
XkbSA_LockNoUnlock If set, and the action is XkbSA_LockMods,
the server only locks the action modifiers.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
9c2a5c6c
|
2012-09-19T15:23:35
|
|
xkbcomp/keymap: correct ACTION_MODS_LOOKUP_MODS handling
The xkblib spec says:
If XkbSA_UseModMapMods is not set in the flags field, the mask,
real_mods, vmods1, and vmods2 fields are used to determine the
action modifiers. Otherwise they are ignored and the modifiers
bound to the key (client map->modmap[keycode]) are used instead.
So we should just assign the modmap without considering what's there.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
9aee332e
|
2012-09-18T17:31:55
|
|
Fix a couple of mistakes from previous commits
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
de4098a0
|
2012-09-14T17:50:31
|
|
keysym-utf8: Optimise the keysym to utf8 lookup
This change adds range checks based on the lowest keysym and highest keysym in
the table. This allows a quick check to be applied to identify if the keysym
is inside the table.
To really give value to this optimisation the table is split to have a
separate table for the keypad keysyms.
The test suite passes with this change.
Signed-off-by: Rob Bradford <rob@linux.intel.com>
|
|
ac872bdf
|
2012-09-17T14:24:38
|
|
symbols: fix buffer overflow with illegal explicit group
Trying ''./test/interactive -l us:5' causes us to crash.
The <layout>:<N> syntax says to put this layout at the N'th level.
However the code (inherited from xkbcomp) doesn't check that the group
is valid, and then happily indexes keyi->groups with it, which has a
static size of XKB_NUM_GROUPS (the SetExplicitGroup function assumes the
index is valid). So any value a user might put there > 4 makes nice
things happen.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
dbd7a953
|
2012-09-16T15:57:36
|
|
keyseq: add test for repeat-shift-repeat-unshift-repeat
e.g. hhhhhHHHHHHHhhhhhh with shift down and up in the middle.
Unfortunately trying a quick test with test/interactive is not possible
because the evdev soft-repeat stops the repeat when another key is
pressed. So you need real soft-repeat for that.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
b2110705
|
2012-09-16T14:45:32
|
|
Organize src/ and test/ headers
- Add context.h and move context-related functions from xkb-priv.h to
it.
- Move xkb_context definition back to context.c.
- Add keysym.h and move keysym upper/lower/keypad from xkb-priv.h to it.
- Rename xkb-priv.h to map.h since it only contains keymap-related
definitions and declarations now.
- Remove unnecessary includes and some and some other small cleanups.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
e670d084
|
2012-09-16T13:33:09
|
|
include: improve file-not-found error reporting
Only report it once, and not only for rules.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
09a4f2ca
|
2012-09-15T13:39:14
|
|
keycodes: add KeyNameInfo
Instead of keeping the two files and names arrays.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
b979a5e9
|
2012-09-15T02:24:17
|
|
keycodes: rename computedMin/Max to min/max_key_code
min/max_key_code is more descriptive and matches the names of these
field in xkb_keymap.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
4b69d6f7
|
2012-09-15T02:09:34
|
|
keycodes: ignore explicit minimum/maximum statements
These statements are pretty pointless for us; we don't restrict keycodes
like X does, and if someone writes e.g. maximum = 255 but only has 100
keys, we currently happily alloc all those empty keys. xkbcomp already
handles the case when these statements aren't given, and uses a computed
min/max instead. We should just always use that.
(Of course since keycodes/evdev currently uses almost all of the
keycodes in the range it declares, including 255, this doesn't save any
memory for the common user right now).
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
c53122cb
|
2012-09-14T21:53:27
|
|
symbols: remove useless grow_alloc of keys array
This just does a big, mostly too big, allocation to save about a dozen
malloc calls. Remove it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
9a27ac72
|
2012-09-14T16:10:47
|
|
state: use filter->priv instead of modifying the action
in xkb_filter_group_set_new.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
8098daa0
|
2012-09-14T16:01:11
|
|
state: move filter initialization to the dispatcher
This removes all of the boilerplate from the *_new functions, and leaves
them just as simple functions which perform the effect of the action on state.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
2c19c938
|
2012-09-14T15:33:54
|
|
state: call xkb_filter_new from the dispatcher
Pass the new filter as a parameter instead of getting a new one in each
action function, and introducing a failure condition there.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
04f1b3be
|
2012-09-14T15:29:12
|
|
state: dispatch actions from a table
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
18a0ead5
|
2012-09-14T15:17:20
|
|
Rename ACTION_TYPE_LAST to _ACTION_TYPE_NUM_ENTRIES
It's not really "last" per-se, and we use this other format in some
other enums.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
16425ffa
|
2012-09-14T11:26:36
|
|
state: don't keep the xkb_state in the filters
Just pass it as a parameter: to make state.c a bit less stateful.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
c2570d51
|
2012-09-14T11:17:30
|
|
state, map: constify references to xkb_key
Makes it clear that we treat the keys as immutible values in these
files.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
841f3223
|
2012-09-14T11:02:12
|
|
state, map: use keycodes only for the API functions
The policy is now consistent: every API functions which recieves a
keycode should resolve it to an xkb_key first thing, and all the
internal functions use that instead of the keycode.
To facilitate it a bit, we move the KeycodeInRange check to XkbKey
itself, which returns NULL if the keycode is illegal.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
4d3d2ef0
|
2012-09-14T01:09:37
|
|
rules: fix mmap failure handling
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
96c21e15
|
2012-09-14T00:21:54
|
|
Clean up Init/Clear functions
- The Clear* functions should just free the memory associated with the
object. If the object is used again, it is Init'd again.
- s/Free/Clear if the actual pointer is not free'd.
- Zeroise object in Init and only initialize non-zero fields.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7b5a1dd5
|
2012-09-13T21:06:36
|
|
symbols: refactor CoypSymbolsDef
To make it easier to follow.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
4c16b39f
|
2012-09-13T21:06:10
|
|
symbols: FindAutomaticType only needs the context
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
8862fd80
|
2012-09-13T11:49:02
|
|
keyseq: test that de(neo) is working properly
This layout stretches us pretty well, so it's good for testing nothing
breaks. There are a couple of things that need looking into, though
(particularly the level5 issue).
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
dd6124ca
|
2012-09-13T20:59:27
|
|
symbols: store actions from symbols in the right offset
This regression was introduced in 93ce9c7d4f7. This meant that actions
specified inside key {} statments were always going to the first group.
But actions are almost never specified in xkb_symbols so this wasn't
noticed.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
898d6fd4
|
2012-09-13T01:33:49
|
|
symbols: remove CopyKeyInfo
The code is better without it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
3abfe83e
|
2012-09-12T23:51:19
|
|
symbols: fix real/alias key merge ordering bug
Background:
The CopySymbolsDef has a comment on a couple of lines which supposedly
fixed a bug:
/*
* kt_index[i] may have been set by a previous run (if we have two
* layouts specified). Let's not overwrite it with the ONE_LEVEL
* default group if we dont even have keys for this group anyway.
*
* FIXME: There should be a better fix for this.
*/
if (!darray_empty(groupi->levels))
key->kt_index[i] = types[i];
But neither the comment nor the fix make any sense, because the kt_index
is indexed per group, i.e. each group gets its own type.
The original xkbcomp commit which added this (36fecff58) points to this
bug: https://bugzilla.redhat.com/show_bug.cgi?id=436626
which complains about -layout "ru,us" -variant "phonetic," not working
properly. And indeed when we try:
sudo ./test/interactive -l ru,us -v
the first group doesn't get any syms for the main keys.
The problem (Clearly the fix above is useless):
The ru(phonetic) map is specified using aliases, e.g. LatQ, LatW instead
of AD01, AD02, etc. When combined with another layout which uses the
real names (AD01, AD02), the symbols code should recognize they are the
same key and merge them into one KeyInfo. The current code does that,
but it doesn't catch the case where the alias was processes *before* the
real one; so we get two KeyInfo's and the later one wins. So e.g. the
ru(phonetic) symbols are ignored.
The fix:
Before adding a new KeyInfo to the keys array, always replace its name
by the real name, which avoids the entire issue. Luckily this is done
pretty late so most error messages should still show the alias name.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
1d6bffc9
|
2012-09-12T23:29:49
|
|
symbols: add CopySymbolsToKeymap
Like in the other sections.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
376e45eb
|
2012-09-12T21:32:25
|
|
symbols: remove mention of keycodes in CopySymbolsDef
Since now we only use the keycode in this function for logging, it's
better not to mention the keycode at all because the XkbKeyGetKeycode
macro is implemented using a dirty hack 0_0
The key name is sufficient to determine uniquely where to look.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
77ab928e
|
2012-09-12T21:24:28
|
|
symbols: remove unneeded recursion form CopySymbolsDef
This function does some funky stuff, which, as far as I can tell, was
needed to support the functionality of giving different keycodes the
same name and thus make them duplicates (MERGE_ALT_FORM). This stuff was
removed as useless in 0765064b3, but this leftover wasn't noticed.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
ce5dbeff
|
2012-09-11T14:47:01
|
|
symbols: add LevelInfo
Add a LevelInfo to hold a single array of level specific info inside
a GroupInfo, instead of keeping the acts, symsMapIndex and
symsMapNumEntries arrays and the numLevels field separate and in sync.
This simplifies the code, and goes a long way toward making the
key-merging code somewhat understandable. Also uses less memory.
Note that the syms array is still in GroupInfo for now, with the levels
holding offsets into it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
ca870318
|
2012-09-11T16:14:16
|
|
symbols: make xkb_key::syms a plain array
It's never resized.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
ee3ade39
|
2012-09-10T22:02:18
|
|
symbols: shorten symsMapNumEntries to uint from size_t
size_t is too wide for this in 64-bit machines.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
3cfcbbab
|
2012-09-11T09:43:08
|
|
symbols: consolidate group merging in MergeGroups
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
db45d664
|
2012-09-10T13:34:36
|
|
symbols: add GroupInfo
GroupInfo keeps all of the info for a specific group in one struct.
This is the old array-of-structures vs. structure-of-arrays, but in this
case readability wins. It would also help with lifting the
XkbNumKbdGroups limit, because we only have to worry about one array
(instead of 6).
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a9fa3739
|
2012-09-12T16:39:54
|
|
keymap-dump: don't write spaces between multiple-syms-per-level
This can get a bit unwieldy.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
2a5b0c9d
|
2012-09-10T23:18:58
|
|
symbols: use darray for ModMapEntry instead of list
There's no need for a list here.
[This also happens to be the last place list.h is used.]
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
886b0ca5
|
2012-09-10T23:24:19
|
|
state: remove unused next field from xkb_filter
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
2de55601
|
2012-09-12T16:58:57
|
|
Update COPYING
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
b4b40d73
|
2012-09-12T16:54:07
|
|
Copyright updates
With Dan Nicholson's permission (via email), update his copyright and
license statements to the standard X.Org boilerplate MIT license, as
both myself and Ran have been using.
Clean up my copyright declarations (in some cases to correct ownership),
and add copyright/license statements from myself and/or Ran where
appropriate.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
14cd8c79
|
2012-09-11T17:00:38
|
|
utils: Replace DEC copyright with Ran's
This is not something I do often, but I have good reason here ...
utils.h has been totally rewritten since import, and now contains no
original DEC content. Everything in here has been added by Ran, and I
do not believe that any lingering content from previous iterations is
substantial enough as to be copyrightable.
Replace DEC's copyright (and license with hostile advertising clause)
with Ran's boilerplate copyright and license statement.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
095a7f4c
|
2012-09-11T16:49:04
|
|
xkbcommon-keysyms: Add header protection
As there is currently no stable release of xkbcommon, other projects might
want to include a copy of the keysyms so they can be used even though
libxkbcommon may not be available on the machine. However, if xkbcommon.h
is still included, conflicts will occur. Hence, to avoid nasty hacks,
simply include a header protection in xkbcommon upstream.
[daniels: Added protection to Makefile.am's update-keysyms, as well as
XKB_KEY_NoSymbol, and a comment noting that it shouldn't be
updated directly.]
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
e9405fa2
|
2012-09-11T15:11:35
|
|
Android.mk: Remove unnecessary for loop
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
82de180e
|
2012-09-11T15:09:37
|
|
Remove unused ExprResolveKeyName
The only user was removed in 314965b1.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
14741800
|
2012-09-11T14:52:27
|
|
Constify keysym <-> Unicode lookup table
Before:
text data bss dec hex filename
234422 11288 2304 248014 3c8ce obj-amd64/.libs/libxkbcommon.so.0.0.0
After:
text data bss dec hex filename
240694 5016 2304 248014 3c8ce obj-amd64/.libs/libxkbcommon.so.0.0.0
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
517c7ed7
|
2012-08-20T15:34:07
|
|
xkbcommon.h build fix for missing stdarg.h
In file included from external/collabora/libxkbcommon/src/xkb-priv.h:87,
from external/collabora/libxkbcommon/src/xkbcomp/xkbcomp.h:30,
from external/collabora/libxkbcommon/src/xkbcomp/xkbcomp-priv.h:30,
from external/collabora/libxkbcommon/src/xkbcomp/action.h:30,
from external/collabora/libxkbcommon/src/xkbcomp/action.c:27:
external/collabora/libxkbcommon/xkbcommon/xkbcommon.h:279: error: expected declaration specifiers or '...' before 'va_list'
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
|
|
9e6ff7bb
|
2012-09-11T14:27:54
|
|
Update Android.mk
Squashed from commits by Helio Chissini de Castro
<helio.chissini.de.castro@collabora.co.uk> and Pekka Paalanen
<ppaalanen@gmail.com>.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
28bd10ce
|
2012-09-11T14:10:41
|
|
kbproto unentanglement: drop dependency
\o\ \o/ /o/
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
fa1ea9a5
|
2012-09-11T14:09:20
|
|
kbproto unentanglement: XkbGeomPtsPerMM
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
e60e9523
|
2012-09-11T12:35:24
|
|
kbproto unentanglement: XkbExplicit*Mask
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
2eab7efc
|
2012-09-11T12:32:18
|
|
kbproto unentanglement: XkbSI_AutoRepeat
That was the only interp flag, so just turn it into a straight boolean.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
a8d462e3
|
2012-09-11T12:28:29
|
|
kbproto unentanglement: XkbSI match flags
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
ed9fd5be
|
2012-09-11T12:20:21
|
|
kbproto unentanglement: control actions
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
6573aca0
|
2012-09-10T21:05:04
|
|
kbproto unentanglement: XkbMaxShiftLevel
... by removing its only use.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
32bf4053
|
2012-09-10T20:44:52
|
|
kbproto unentanglement: Xkb{Wrap,Clamp,Redirect}IntoRange
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
461f8a76
|
2012-09-10T20:40:05
|
|
actions: Remove PointerDefault affect field
This was always set to affect the default button, so no need for it.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
70c775f6
|
2012-09-10T20:38:46
|
|
kbproto unentanglement: action flags
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
b6e04571
|
2012-09-10T20:16:05
|
|
kbproto unentanglement: XkbLC_*
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
830fe671
|
2012-09-10T20:07:54
|
|
kbproto unentanglement: XkbIM_*
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
0b2506db
|
2012-09-10T19:23:16
|
|
kbproto unentanglement: action types
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
314965b1
|
2012-08-21T14:40:51
|
|
Remove deprecated actions
We didn't do anything with ISO_Lock, ActionMessage, RedirectKey, and the
device-specifying variants of the pointer actions, so remove those.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
b04d896a
|
2012-08-21T12:48:20
|
|
kbproto unentanglement: XkbNumVirtualMods
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
74ec4c1c
|
2012-08-21T12:47:28
|
|
kbproto unentanglement: XkbNumIndicators
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
4b8ceae9
|
2012-08-21T12:45:03
|
|
kbproto untanglement: XkbKbdNumGroups
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
f5dffd2b
|
2012-08-21T11:21:19
|
|
kbproto untanglement: XkbKeyNameLength
Define it ourselves as XKB_KEY_NAME_LENGTH and use that, instead of the
one from XKB.h.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
3b6b214c
|
2012-08-28T18:04:25
|
|
rules: use goto instead of state variable
There's no noticeable speed difference, but I think it's nicer and more
explicit than the previous code. Some people just don't like goto,
though..
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
0071227e
|
2012-08-26T08:54:31
|
|
rules: rewrite
Rewrite the rules file parser for clarity, performance and memory usage
reduction. The previous implementation was quite hard to navigate and
did a lot of unnecessary work and copying.
This implementation keeps along just the state necessary, and doesn't
perform any copying of the file's content (although the entire file is
mmap'ed as before). Hopefully it's also easier to understand, has better
documentation, and better error checking and reporting. We try to
reproduce the previous behavior in every case.
Note: the diff is pretty confusing; it's likely better to look at the
file directly.
Benchmarks:
On an old 32-bit Intel processor.
gcc -O2 -pg
./test/rulescomp bench
grof test/rulescomp
Before:
compiled 1000 keymaps in 14.863564304s
% cumulative self self total
time seconds seconds calls ms/call ms/call name
49.33 4.43 4.43 30610000 0.00 0.00 yylex
17.93 6.04 1.61 31000 0.05 0.22 yyparse
6.57 6.63 0.59 1000 0.59 0.59 load_rules
3.23 6.92 0.29 3637000 0.00 0.00 AppendStmt
2.45 7.14 0.22 472000 0.00 0.00 AddKeySymbols
2.12 7.33 0.19 3591000 0.00 0.00 atom_intern
2.12 7.52 0.19 518000 0.00 0.00 FindNamedKey
2.00 7.70 0.18 230000 0.00 0.00 FreeStmt
1.78 7.86 0.16 1000 0.16 0.17 UpdateModifiersFromCompat
1.34 7.98 0.12 732000 0.00 0.00 AddKeyName
1.34 8.10 0.12 __x86.get_pc_thunk.bx
After:
compiled 1000 keymaps in 13.874666269s
% cumulative self self total
time seconds seconds calls ms/call ms/call name
49.82 4.26 4.26 30610000 0.00 0.00 yylex
22.22 6.16 1.90 31000 0.06 0.22 yyparse
2.92 6.41 0.25 3591000 0.00 0.00 atom_intern
2.57 6.63 0.22 1000 0.22 0.25 xkb_components_from_rules
2.11 6.81 0.18 3637000 0.00 0.00 AppendStmt
2.11 6.99 0.18 230000 0.00 0.00 FreeStmt
1.99 7.16 0.17 518000 0.00 0.00 FindNamedKey
1.99 7.33 0.17 1000 0.17 0.17 UpdateModifiersFromCompat
1.99 7.50 0.17 __x86.get_pc_thunk.bx
1.52 7.63 0.13 150000 0.00 0.00 AddInterp
1.40 7.75 0.12 472000 0.00 0.00 AddKeySymbols
On a newer 64-bit Intel processor.
gcc -O2
./test/rules-file bench
Before:
processed 20000 times in 15.940546625s
After:
processed 20000 times in 5.295026345s
Allocations:
gcc -O2
valgrind test/rulescomp
Before:
total heap usage: 257,519 allocs, 257,519 frees, 14,766,529 bytes allocated
After:
total heap usage: 240,756 allocs, 240,756 frees, 14,007,886 bytes allocated
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
54d1d5ed
|
2012-09-04T17:40:09
|
|
compat: make LEDInfo a wrapper around xkb_indicator_map
instead of duplicating the fields. The same is done in SymInterpInfo
which wraps xkb_sym_interpret.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
5f613988
|
2012-09-04T17:20:46
|
|
Fold keymap->indicator_names into keymap->indicators
This makes sense, since giving a name to an indicator 'activates' the
indicator_map in that index.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
af2a8b3a
|
2012-09-02T21:45:42
|
|
Unify some string tables from xkbcomp, text and keymap-dump
We move the LookupEntry struct from expr.h to text.h, along with most of
the lookup tables. This makes them available everywhere.
Looking up a value in the LookupEntry format is slower than direct index
mapping, but it allows multiple names per value (with the canonical one
being first) and "all"- and "none"-type masks. These functions are not
used anywhere efficiency matters.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7ae0c6ba
|
2012-08-31T19:26:51
|
|
Convert rest of names in xkb_keymap back to atoms
These were kept as atoms, but since the keymap was exposed in the API,
we converted them to strings; no the keymap is no longer exposed, so we
can go back to atoms. They make the keymap smaller (at least on 64-bit
machines) and the comparisons faster.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
1a996883
|
2012-08-31T19:05:49
|
|
expr: make ResolveString return an atom
Almost all callers do xkb_atom_intern on the currently returned string,
while ResolveString converts the atom to the string to begin with...
uselss double work.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7aa31097
|
2012-08-31T18:52:26
|
|
atom: add xkb_atom_lookup
This will only lookup the string and return the atom if found; it will
not intern it if not. This is useful when e.g. getting a string from the
user (which may be arbitrary) and comparing against atoms.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
651e1dab
|
2012-08-31T18:47:28
|
|
atom: separate lookup logic from atom_intern
This would allow us to add a non-interning xkb_atom_lookup function.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
f205d0f9
|
2012-08-31T18:22:03
|
|
atom: make type and name of the 'a' field clearer
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
1aa6e2b1
|
2012-08-28T19:07:07
|
|
test/rules-file: add benchmark
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
480f919d
|
2012-08-29T11:54:05
|
|
test: add rmlvo-to-kccgst tool
For a quick look at what components result from the rules.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7f04ffc4
|
2012-08-29T12:10:28
|
|
rules: fix check for appending '|' character when applying
There are two ways to separate multiple files in XKB include statements:
'+' will cause the later file to override the first in case of conflict,
while '|' will cause it augment it (this is done by xkbcomp). '!' is
unrelated here.
Since '|' is practically never used, this wasn't noticed.
In the modified test, the '|some_compat' previously was just ignored.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
41472822
|
2012-08-29T15:17:00
|
|
Use XKB_MOD_INVALID instead of XkbNoModifier
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
300f3fb1
|
2012-08-29T10:12:56
|
|
Don't printf NULL strings
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
bce90d5b
|
2012-08-29T10:06:47
|
|
xkbcomp: add debug messages of the RMLVO and KcCGST
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
8e6fce9b
|
2012-08-29T00:44:58
|
|
include: document ParseIncludeMap better
The format of the include statment is not explained anywhere, the code
is confusing and the comments misleading. Try to explain it better.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
2a026f6f
|
2012-08-28T15:55:35
|
|
test/data/symbols: keypad can only have one default section
Avoids a warning, from xkeyboard-config:
commit 6676053f2c93596c2aaa9905151a5c76355a1540
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Fri Jun 29 09:53:45 2012 +1000
symbols: keypad can only have one default section
Warning: Multiple default components in keypad
Using x11, ignoring pointerkeys
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
799cc064
|
2012-08-28T15:05:01
|
|
include: properly use the default map if none is found
For some reason this piece of code wasn't copied from xkbcomp, which
causes all of the warnings like these:
Warning: No map in include statement, but "pc" contains several; Using first defined map, "pc105"
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
f3c4032f
|
2012-08-30T20:23:35
|
|
Set log level for tests through env, not directly
This way the test logs have all the information, but we don't get eye
bleed every time we run them manually. One can always use
TESTS_ENVIRONMENT (we correctly use AM_TESTS_ENVIRONMENT now), or set
the envvars from the shell.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
8d7d9792
|
2012-08-28T00:42:59
|
|
log: replace "priority" by "level" everywhere
Now that we don't use syslog, "level" does sound more commonplace. We
should change it while there is still nobody using it.
Also leave some space between the integers of the xkb_log_level enum
values, if we ever need to shove more in between.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
95d4fb9e
|
2012-09-03T10:28:58
|
|
action: fix LookupEntry for "lockdevbtn"
xkbcomp has that bug as well, guess no one uses it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7e0c49e0
|
2012-09-02T16:33:02
|
|
action: remove redundant check
The NoAction handler always errors out with the same message.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
87bfd973
|
2012-09-02T11:29:31
|
|
action: keep array of default actions, instead of list of changes
The implementation of changing the default properties of actions, e.g. a
statements such as (from test/data/compat/basic):
setMods.clearLocks= True;
latchMods.clearLocks= True;
latchMods.latchToLock= True;
works by keeping a list of ActionInfo's, each containing the neccesary
info from each statement, and then when some action comes up (e.g. in an
interpret statment) it goes through the list, and applies the relevent
ActionInfo's to the newly-constructed xkb_action.
Instead of doing this, we add a struct ActionsInfo, which contains an
array of xkb_actions, one for each type. When a default changing
statement appears, we change the action in the array; when a new action
comes up, we just copy from the array. This is simpler to figure out,
and pretty straightforward.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
4ca85c7b
|
2012-09-02T16:16:57
|
|
action: disallow setting an action_field default for all types
Currently where it is possible to write:
setMods.clearLocks = True;
It's also possible to write:
action.clearLocks = True;
This will set the default value for the clearLocks action field for
*all* action types, as opposed to just setMods in this case. If
subsequently an action is used for which this field does not make sense,
it will error out.
This doesn't make any sense, because any given field is only possible by at
most 3 or 4 action types... which you might as well write explicitly and
avoid the side effect mentioned above.
Needless to say this is one of xkbcomp's "hidden features" and is not
used anywhere; remove it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
ba9f66bd
|
2012-09-02T10:35:08
|
|
action: clean up formatting of extern functions
Make it a bit easier to understand what they do.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
1736e7da
|
2012-08-31T12:12:13
|
|
types: don't strdup a default name
None of the other files does that.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
149e1b2f
|
2012-08-31T12:06:50
|
|
types: use darray for KeyTypesInfo instead of list
Simpler, uses less memory and more efficient.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
8654d36e
|
2012-08-27T23:00:07
|
|
types: remove outdated comments
The code is pretty straightforward now...
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
db639be6
|
2012-09-03T10:23:44
|
|
keymap: optimize FindInterpsForKey a bit
Signed-off-by: Ran Benita <ran234@gmail.com>
|