summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-03-18ast-build: remove malloc_or_dieRan Benita1-82/+93
This should be fixed properly. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18keycodes: fix spelling in error messageRan Benita1-1/+1
Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18Remove list.hRan Benita2-490/+0
We don't use it anymore and it's easy to add back if needed. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18Makefile.am: don't create INSTALL and ChangeLogRan Benita2-13/+1
It may be xorg standard but it's completely useless and clutter the directory. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18keymap-dump: move writing 'key {}' in symbols to its own functionRan Benita1-100/+107
Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18keymap-dump: remove some ugly empty linesRan Benita2-9/+6
xkbcomp prints them too, but that's just annoying. Also xkb_keycodes doesn't have it already. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18keymap-dump: don't indent after xkb_keymap {Ran Benita2-1956/+1956
xkbcomp doesn't indent there, so it's easier to diff. Also saves some horizontal space which is sorely needed when looking at these files (especially the xkb_symbols). Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18keymap-dump: style cleanupsRan Benita1-74/+45
Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18ast: add error handling to XkbFileFromComponentsRan Benita1-24/+32
And try to not repeat ourselves. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18Fix dead assignmentsRan Benita4-22/+17
"Value stored to 'stmt' is never read" "Value stored to 'grp_to_use' is never read" And change 'grp' to 'group' if we're here. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18keysym: print unicode keysyms uppercase and 0-paddedRan Benita4-28/+34
Use the same format as XKeysymToString. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18Change some log functions to take ctx instead of keymapRan Benita3-10/+10
They don't need the keymap, only the context. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18keycodes: some minor styleRan Benita1-18/+25
Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18action: s/hndlrType/handler_typeRan Benita1-5/+5
Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18compat: make it clear which 'dflt' is meantRan Benita1-19/+21
Also s/dflt/default. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18symbols: make it clear which 'dflt' is meantRan Benita1-18/+18
A bit easier at a glance. Also, vowels are cool, so just say 'default'. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18ast: constify argumentRan Benita2-2/+2
Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18symbols: fix bad 'merge' assignmentRan Benita1-1/+1
Bug introduced in 2a5b0c9dc1ad1488ecc6b139fd70e464eb687da6, was causing some keys to be merged incorrectly. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18Change 'indicator' to 'led' everywhere possibleRan Benita13-227/+218
The code currently uses the two names interchangeably. Settle on 'led', because it is shorter, more recognizable, and what we use in our API (though of course the parser still uses 'indicator'). In camel case we make it 'Led'. We change 'xkb_indicator_map' to just 'xkb_led' and the variables of this type are 'led'. This mimics 'xkb_key' and 'key'. IndicatorNameInfo and LEDInfo are changed to 'LedNameInfo' and 'LedInfo', and the variables are 'ledi' (like 'keyi' etc.). This is instead of 'ii' and 'im'. This might make a few places a bit confusing, but less than before I think. It's also shorter. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18test/interactive: change variable name for 'xkb' to 'keymap'Ran Benita1-2/+3
Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18state: fix unbound virtual modifier bugRan Benita3-2/+1553
Recent xkeyboard-config introduced the following line in symbols/level3: vmods = LevelThree, However, the XKM format which xkbcomp produces for the X server can't handle explicit virtual modifiers such as this: https://bugs.freedesktop.org/show_bug.cgi?id=4927 So by doing the following, for example: setxkbmap -layout de (or another 3-level layouts) xkbcomp $DISPLAY out.xkb xkbcomp out.xkb $DISPLAY The modifier is lost and can't be used for switching to Level3 (see the included test). We, however, are affected worse by this bug when we load the out.xkb keymap. First, the FOUR_LEVEL_ALPHABETIC key type has these entries: map[None] = Level1; map[Shift] = Level2; map[Lock] = Level2; map[LevelThree] = Level3; [...] Now, because the LevelThree virtual modifier is not bound to anything, the effective mask of the "map[LevelThree]" entry is just 0. So when the modifier state is empty (initial state), this entry is chosen, and we get Level3, instead of failing to match any entry and getting the default Level1. The difference in behavior from the xserver stems from this commit: acdad6058d52dc8a3e724dc95448300850d474f2 Which removed the entry->active field. Without bugs, this would be correct; however, it seems in this case we should just follow the server's behavior. The server sets the entry->active field like so in XKBMisc.c: /* entry is active if vmods are bound */ entry->active = (mask != 0); The xkblib spec explains this field, but does not specify how to initialize it. This commit does the same as above but more directly. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18test/interactive: also print the levelRan Benita1-10/+7
Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18test/keyseq: re-add de(neo) level5 testRan Benita1-6/+5
See: https://bugs.freedesktop.org/show_bug.cgi?id=50935 This works now after syncing with recent xkeyboard-config. Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18Sync test data from xkeyboard-configRan Benita21-146/+573
Sync the files again from xkeyboard-config 2.8, since there have been some changes we should test against. Also added a script test/data/sync.sh if we want to do it again in the future. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-12-13configure.ac: add xkbcommon.com url to AC_INITRan Benita1-2/+3
Why not. Also forgot to update the xorg-utils error message when bumping the requirement. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Changed to xkbcommon.org.]
2012-12-06Parser: Initialise geometry elements for VarDeclDaniel Stone1-3/+3
We were using uninitialised memory whilst parsing geometry, leaving random contents as the return for shape/overlay/etc sections. Somehow this actually worked everywhere but under Java. https://bugs.freedesktop.org/show_bug.cgi?id=57913 Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-11-11state: rename state->cur to state->componentsRan Benita1-68/+70
'cur' doesn't make sense anymore. 'components' is a bit long for this, but not too bad, and nothing better comes to mind. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-11-11state: don't keep the previous state components in xkb_stateRan Benita1-7/+9
There is really no need to keep this in the struct, we can just allocate it on the stack when we need to. Don't know why I did it this way. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-11-11keymap: wrap the layout parameter if it is out of range for the keyRan Benita4-10/+29
The functions num_levels_for_key() and get_syms_by_level() have a 'layout' parameter. Currently it is expected that this value is always legal for the key, as determined by num_layouts_for_key(). However, there are legitimate use cases for passing an out-of-range layout there, most probably passing the effective layout, and expecting to get the keysyms/levels for just this layout. So we wrap it just as we do in the xkb_state_* functions. This is also useful for stuff like this: http://developer.gnome.org/gdk/stable/gdk-Keyboard-Handling.html#gdk-keymap-lookup-key If this behavior is not desired, the user has the option to check against num_layouts_for_key herself. https://bugs.freedesktop.org/show_bug.cgi?id=56866 Reported-by: Gatis Paeglis <gatis.paeglis@digia.com> Signed-off-by: Ran Benita <ran234@gmail.com>
2012-11-09Only distribute .tar.xz archivesDaniel Stone1-1/+1
We definitely don't need .gz anymore, and .bz2 seems on its way out. Mirror what Wayland does, and move to .xz exclusively. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-11-07Don't use trailing enum comma in public headersRan Benita1-8/+8
Pretty annoying, but C89 doesn't support that (officially), and it might cause warning with -pedantic, etc. (though you need -Wsystem-headers to see them usually). Removing them is not a big deal. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-11-07test/keysym: '\e' is non-standardRan Benita1-1/+1
test/keysym.c:139:43: warning: non-ISO-standard escape sequence, '\e' Didn't warn about it before.. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-11-06doc: clarify that keysym_to_utf8 returns size including '\0'Ran Benita1-3/+3
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-11-05keysym-utf: mark keysymtab array as staticRan Benita1-1/+1
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-11-05keysym-utf: also translate special keysyms like Tab and ReturnRan Benita2-27/+27
The keysym2ucs.c file apparently leaves out some keysyms, which libX11 deals with separately (like in _XkbHandleSpecialSym()). The problematic keysyms are the keypad ones (for which we already added some support) and keysyms which use 0xff** instead of 0x00** < 0x20. This code should fix them properly, as much as I could gather from libX11 and http://www.cl.cam.ac.uk/~mgk25/ucs/keysym2ucs.c and other sources (which are not aware of locale). https://bugs.freedesktop.org/show_bug.cgi?id=56780 Reported-by: Gatis Paeglis <gatis.paeglis@digia.com> Signed-off-by: Ran Benita <ran234@gmail.com>
2012-11-04Add some explanations on consumed modifiersRan Benita1-2/+43
This should hopefully clarify this somewhat subtle point to the uninitiated users. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-30action: don't allow private actions with a known typeRan Benita2-2/+21
Some obscure bug having to do with Private actions; see the comments. This was prompted by: https://bugs.freedesktop.org/show_bug.cgi?id=56491 Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-30build: Require xorg macros 1.16Damien Lespiau1-1/+1
For XORG_TESTSET_CFLAG and XORG_MEMORY_CHECK_FLAGS. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Cc: Daniel Stone <daniel@fooishbar.org>
2012-10-30build: Make autoreconf honour ACLOCAL_FLAGSDamien Lespiau1-1/+1
When running autoreconf, it's possible to give flags to the underlying aclocal by declaring a ACLOCAL_AMFLAGS variable in the top level Makefile.am. Putting ${ACLOCAL_FLAGS} there allows the user to set an environment variable up before running autogen.sh and pull in the right directories to look for m4 macros, say an up-to-date version of the xorg-util macros. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Cc: Daniel Stone <daniel@fooishbar.org>
2012-10-29test/keyseq: add test for setting depressed groupRan Benita1-0/+46
Tests the SetGroup action is working properly. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-29state, context: allow passing NULL to *_unref()Ran Benita4-2/+13
For error handling code, it's nice to be able to pass NULL to these function without worrying about segfaults ensuing. free() sets the precedent here. Also document this fact. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-26state: don't use xkb_keymap_num_layouts internallyRan Benita1-5/+3
Clearer and more greppable this way. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-26doc: fix wrong commentRan Benita1-1/+1
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-26state: don't use xkb_state_serialize_* internallyRan Benita1-9/+3
The code in these cases is clearer when done directly. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-26Makefile.am: move test.h to libtest_la_SOURCESRan Benita1-3/+3
Rather than EXTRA_DIST, where it doesn't belong. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-26Makefile.am: split sed script into multiple linesRan Benita1-1/+4
To make it visible on one screen. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-26configure.ac: don't tramp on user's CFLAGSRan Benita1-1/+1
The configure test shouldn't touch CFLAGS, because they come last on the command line and allow to users to override settings if needed. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-26configure.ac: add explicit PKG_PROG_PKG_CONFIGRan Benita1-0/+1
We still use pkg-config to get the xkb_base variable from xkeyboard-config, but we removed all of the other PKG_ macro calls. This still works now, because XORG_DEFAULT_OPTIONS runs it somehow. But we shouldn't rely on it. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-24test: add key processing benchmarkRan Benita3-1/+100
This runs a bunch of random keys against xkb_state_update_key() and xkb_state_key_get_one_sym(), in a fairly unintelligent way. It might be nice to check when modifying this code path, or changing it, to see things haven't slowed down considerably. However, given the numbers this benchmark gives, it is pretty clear that we are not going to be the bottleneck for anything. So this can more-or-less be ignored. Incidentally, this also turned out to be a poor man's fuzzer, because it turned up the fix in the previous commit. Maybe we should consider beefing it up with an actual 'break stuff' intention and running it as part of 'make check'. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-24state: fix possible index-out-of-bounds in action dispatch tableRan Benita1-0/+11
The current code assumes that action->type always falls in the range of the xkb_action_type enum. But keymaps can also have Private actions, which are allowed to set their own type number. So with a default xkeyboard-config keymap, keycode 86 at level 4, which triggers such an action, causes us to crash. Fix it by always checking the bounds. Signed-off-by: Ran Benita <ran234@gmail.com>