summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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>
2012-10-24More READMEDaniel Stone1-1/+4
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-10-24README updatesDaniel Stone1-2/+2
Good thing I didn't check this before I made a release. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-10-24Bump to 0.2.0xkbcommon-0.2.0Daniel Stone1-1/+1
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-10-23doc: various fixesRan Benita1-46/+49
Just moving around / fixing syntax / grammar. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-23doc: move include_path functions to a separate groupRan Benita1-25/+38
These are 'special intrest' function, like the logging functions, so it's nice to have them in their own logical group. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-23test/interactive: use num_layouts_for_key()Ran Benita1-2/+3
This is the more appropriate for a specific key (also considering the num_layouts() is a bit of a made-up value). Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-23keymap: use plain array for keymap->group_namesRan Benita4-24/+18
Again it is not resized. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-23state: fix typo in state component copyingRan Benita1-1/+1
Gladly no-one should have been fast enough to hit this. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-24autogen: use --force instead of --symlinkDaniel Stone1-1/+1
--force copies and installs all the autotools support files, rather than making symlinks, which can sometimes break things when upgrading your system autotools. This is what xserver does. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-10-22Change update_mask arguments to read 'depressed' instead of 'base'Ran Benita1-2/+2
Just to be consistent, as we use 'depressed' everywhere else in the API. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-22test/interactive: add option to show state changesRan Benita1-6/+43
Pass -c to see. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-22Report which components of the state have changedRan Benita2-43/+90
We add a return value to the xkb_state_update_key and xkb_state_update_mask, which reports to the caller which of the state components have changed as a result. This restores the XKB functionality of the XkbStateNotify and XkbIndicatorsStateNotify events. See: http://www.x.org/releases/current/doc/kbproto/xkbproto.html#Events It is quite useful in some situations. For example, it allows an application to avoid doing some work if nothing of relevance in the state has changed. Say, a keyboard layout applet. Also useful for debugging. The deltas themselves are not provided, because I can't see a use case. If needed, it should be possible to add some API for that. In xkbcommon, keymaps are immutable, so all of the other *Notify events from XKB are irrelevant. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-22state: add struct state_componentsRan Benita1-68/+72
This holds all of the state component fields in the state in one struct. We will later want to keep the previous state components after updates, so this will allow us to do it without duplicating the fields. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-22Split the mods, layout, leds parts of xkb_state_componentsRan Benita9-106/+161
Note first: This commits breaks the ABI somewhat. If an application is run against this commit without recompiling against the updated header, these break: - xkb_state_layout_*_is_active always retuns false. - xkb_state_serialize_mods always returns 0. So it might break layout switching in some applications. However, xkbcommon-compat.h provides the necessary fixes, so recompiling should work (though updating the application is even better). Split the enum to its individual components, which enables us to refer to them individually. We will use that later for reporting which components of the state have changed after update. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-22doc: add note about X11 vs. extended keycodesRan Benita1-0/+20
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-21Silence a couple of warningsRan Benita2-1/+4
These appear to come and go randomly. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-18Move _text() functions from keymap-dump to text.cRan Benita3-77/+81
And make them use context_get_buffer() instead of using a static char array. This was the last non-thread-safe piece we had, as far as I can tell. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-18Remove a couple more uses of static char buffersRan Benita2-6/+5
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-18Contextualize GetBuffer()Ran Benita6-32/+35
Instead storing the buffer in a non-thread-safe static array, we move it to the context. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-18Clean up xkb_sym_interpret a bitRan Benita5-60/+32
First we split the LEVEL_ONE_ONLY bit off of the 'match' field, which allows us to turn enum xkb_match_operation to a simple enum and remove the need for MATCH_OP_MASK. Next we rename 'act' to 'action', because we've settled on that everywhere else. Finally, SIMatchText is changed to not handle illegal values - it shouldn't get any. This removes one usage of the GetBuffer hack. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-17Commit and distribute ks_tables.hRan Benita4-9/+4685
The ks_tables.h file is generated by makekeys.py from xkbcommon-keysyms.h, which in turn is generated initially by 'make update-keysyms'. The xkbcommon-keysyms.h file is commited to git and distributed in the tarball. Since ks_tables.h should only ever change when xkbcommon-keysyms.h changes, it is more sensible to update them together and treat them the same, instead of generating ks_tables.h every time for every builder with 'make', as we do now. This means we don't need python as a build dependency (only the one running update-keysyms, i.e. no one, needs this), and we can be sure exactly the same file is used by everyone. We also don't need to run makekeys.py on every build. Signed-off-by: Ran Benita <ran234@gmail.com>