summaryrefslogtreecommitdiff
path: root/Makefile.am
AgeCommit message (Collapse)AuthorFilesLines
2012-10-17Commit and distribute ks_tables.hRan Benita1-5/+4
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>
2012-10-16makekeys: replace helper with python script and binary searchRan Benita1-7/+2
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-12Change log env vars to XKB_LOG_LEVEL/VERBOSITYRan Benita1-2/+2
A bit more consistent and descriptive. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-24Add support for building doxygen API documentationRan Benita1-0/+26
Simple HTML docs generated from the doxygen comments. After running 'make' or 'make doc', try firefox doc/html/index.html to see it (if you have doxygen). It's also installed with 'make install'. You can use --enable-docs or --disable-docs, or specifically --with-doxygen or --without-doxygen (autodetected, default yes). The docs are currently not distributed in the tarball, because I couldn't make it work properly in all cases :/ Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-24configure.ac: add XORG_MEMORY_CHECK_FLAGSRan Benita1-1/+2
Adds some memory checking (e.g. MALLOC_PERTURB_) to tests. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-24configure.ac: remove XORG_CHECK_MALLOC_ZERORan Benita1-3/+1
We don't use its result. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-24Rename map.{c,h} to keymap.{c,h}Ran Benita1-2/+2
Seeing as we don't like "map" anymore. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-20Add _xkbcommon_ prefix to parser and lexer symbolsDaniel Stone1-0/+1
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-09-20Add xkbcommon-compat.h and compat.cDaniel Stone1-2/+4
So we can start renaming stuff while retaining backwards source and binary compatibility. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-09-19test: add print-compiled-keymap toolRan Benita1-1/+3
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>
2012-09-16Organize src/ and test/ headersRan Benita1-2/+4
- 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>
2012-09-11xkbcommon-keysyms: Add header protectionDavid Herrmann1-1/+5
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>
2012-09-03test/rules-file: add benchmarkRan Benita1-1/+1
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-03test: add rmlvo-to-kccgst toolRan Benita1-1/+3
For a quick look at what components result from the rules. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-03Set log level for tests through env, not directlyRan Benita1-1/+3
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>
2012-09-02Add xkbcomp/keymap.c and move some code thereRan Benita1-0/+1
Add CompileKeymap to do most of what compile_keymap_file does now, and move UpdateKeymapFromModifiers along with it from (mostly unrelated) compat.c. Also rename UpdateKeymapFromModifiers to UpdateDerivedKeymapFields, because it does more than update the modifiers. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-01Organize xkbcomp/ header filesRan Benita1-6/+8
Various non-functional changes: - Re-add keycodes.h and move some stuff there. - Add parser-priv.h for internal bison/flex stuff. - Don't include headers from other headers, such that file dependencies are immediate in each file. - Rename xkbcomp.h -> ast.h, parseutils.{c,h} -> ast-build.{c,h} - Rename path.{c,h} -> include.{c,h} - Rename keytypes.c -> types.c - Make the naming of XkbFile-related functions more consistent. - Move xkb_map_{new,ref,unref} to map.c. - Remove most extern keyword from function declarations, it's just noise (XKB_EXPORT is what's important here). - Append XKBCOMP_ to include guards. - Shuffle some code around to make all of this work. Splitting this would be a headache.. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-08-10Remove xkbcomp/misc.cRan Benita1-1/+0
The KeyName functions are more appropriate in keycodes.c. The ProcessIncludeFile can go to path.c along with the other functions dealing with includes. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-08-08android: add build filesPekka Paalanen1-0/+16
squashed: android: set xkb config path Conflicts: Makefile.am
2012-08-08test/dump: Remove superfluous testDaniel Stone1-2/+0
No longer necessary now we have stringcomp doing a full round-trip test for us. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-08-08Rename xkey test to keysymDaniel Stone1-2/+2
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-08-08Staticise xkb_map_new_from_kccgstDaniel Stone1-2/+0
We didn't expose this to the outside world, and its only trivial user was xkb_map_new_from_rules. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-07-28Add an interactive evdev testRan Benita1-1/+4
The program reads key events from evdev input devices, puts them through the library and prints some information about them. It's nice for experimenting, quick testing and trying to break it with random stuff (already found some!). It is called "interactive" for lack of a better name. It's a bit hackish, but can easily be extended, made more portable etc, in the future. Signed-off-by: Ran Benita <ran234@gmail.com> Conflicts: Makefile.am test/.gitignore
2012-07-27Remove alloc.{c,h}Ran Benita1-2/+0
These functions are more appropriate elsewhere now. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-23Add test for logging functionalityRan Benita1-1/+3
Just to make sure everything works properly. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-23Add logging APIRan Benita1-1/+0
Add new public API to provide the library users with some options to control and customize the logging output from the library. It is based upon the skeleton from the libabc demo libray: https://git.kernel.org/?p=linux/kernel/git/kay/libabc.git which is public domain and works pretty well. This requires passing in the context object in every logging call, and thus the conversion is done file by file. We also remove the global warningLevel variable in favor of a verbosity level in the context, which can be set by the user and is silent by default. One issue is the ACTION calls, which, while nice, do not play very well with line- and priority-based logging, and would require some line continuation handling or keeping state or some other compromise. So instead remove these and just inline them with their respective warning/error. So instead of: ERROR("Memory allocation failed\n") ACTION("Removing all files on hardisk\n") its something like that: log_err("Memory allocation failed; Removing all files on harddisk\n") Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-23build: drop the include/ directoryRan Benita1-6/+5
The include/ dir is somewhat redundant and makes it just a bit harder to handle the -I directives from out side of automake; without it the default $(top_buildir) just works. Here's also some further justifications I found: http://smcv.pseudorandom.co.uk/2008/09/pc-uninstalled/ Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-18Move indicators.c code into compat.cRan Benita1-2/+0
It is only used there. Allows some refactoring. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-18Convert macros to inline functionsRan Benita1-1/+0
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-18Move alias.c functions into keycodes.cRan Benita1-2/+0
They are only used in this file. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-18Add common linked list implementationRan Benita1-0/+1
Taken from xserver/include/list.h. The changes made are: * Drop the xorg_ prefix and some typedef from the end. * Rename _for_each_entry macros to just _foreach (like darray). * Rename list_is_empty to list_empty (like darray). * Add a list_replace function which we use later. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-14Move CompileKeymap into xkbcomp.cRan Benita1-1/+0
It's nicer to see the code where its used. Removes keymap.c. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-13Rename KSIsLower/Upper and move to keysym.cRan Benita1-1/+0
Seems like a more natural place, and allows to remove the src/misc.c file. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-13Move ComputeEffectiveMap code and avoid some duplicationRan Benita1-1/+0
The ComputeEffectiveMap function is only called from keytypes.c, with the last argument NULL, so we can move it there and remove some code. The function XkbcVirtualModsToRealMods, of which the above is the only user, is already implemented more simply in compat.c, so make this one non-static and use it. This leaves src/xkb.c empty, so remove it. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-13remove unused function xkb_canonicalise_componentsRan Benita1-2/+0
commit 46441b1184dfa8553409d493ae6336aabb900d79 removed this from the public API, and we don't need it internally. So send it to the archives. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-12Add a library of common test functionsDaniel Stone1-5/+9
Including creating a context (will come in useful soon), opening and reading files, and compiling keymaps. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-18Add a test for the results of key sequencesRan Benita1-1/+3
This test verifies the core purpose of this library, which is to translate the user's keypresses into keysyms according to the keymap and the XKB specification. The tests emulate a series of key presses, and checks that the resulting keysyms are what we expect. Several of the tests currently fail, and plenty more should be added and maybe split up. It also currently uses an RMLVO keymap, which comes from the xkeyboard-config data set, and whose behaviour may change in the future. So it should probably be changed to use several files of our own, but it's OK for now. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-06-09Remove configure check for X11 keysym filesRan Benita1-1/+8
Since every user building the library, even from git, doesn't need these files anymore, there's no need to check for them (this goes for makekeys as well). The only remaining user is the update-keysyms target, but whoever will run it again (if ever) will probably know what he's doing (at least enough to run git diff before git commit). And the defaults should be fine too. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-06-08Add API for getting unicode representation of a keysymRob Bradford1-0/+1
This code uses a table and code derived from http://www.cl.cam.ac.uk/~mgk25/ucs/keysym2ucs.c The added API calls are: xkb_keysym_to_utf32 xkb_keysym_to_utf8 [daniels: Changed API to be more in line with keysym_get_name, added test, changed formatting to 4-space.]
2012-06-04Use $(top_builddir) rather than relative pathsDaniel Stone1-3/+3
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-04Work around stupid automake dependency-tracking bugDaniel Stone1-0/+4
bison/flex-generated objects, when being run in a VPATH build with --disable-dependency-tracking (i.e. Gentoo), would fail to be created because automake didn't bother creating the destination directories before trying to create the objects. Fix this by depending on the destination directory stamp, which according to the automake mailing list, should hopefully remain fairly stable. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-29Add test for xkb_map_new_from_stringDaniel Stone1-1/+3
Using data from xkb_map_get_as_string. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-29Add xkb_map_get_as_stringDaniel Stone1-1/+4
Returns a newly-allocated string representing the specified keymap. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-22Import darray.h for common dynamic array codeRan Benita1-0/+1
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-20rules: add testRan Benita1-2/+11
Add a non-extensive test to check that some basic things (e.g. rule matching, var substitution, indexes and groups) work as expected. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-20rules: only export a single functionRan Benita1-2/+2
Really all we need from this file is a way to get xkb_component_names from an xkb_rule_names, which is now the only thing being exposed. This should allow for some much needed refactoring of this code. Since this is only used by xkbcomp.c and uses xkbcomp functions, also move rules.{c,h} under the xkbcomp dir. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-19Create path.h for the path.c functionsRan Benita1-0/+1
No need to stash them in xkbcomp-priv.h; files which need the functions should explicitly include them. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-18Fix out-of-tree build for config.hPekka Paalanen1-1/+1
config.h appreas in the build dir, not src dir. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-18Add benchmarking test to rulescompDaniel Stone1-1/+1
Apparently it only takes us 8ms to build keymaps. Nice! Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-11Use $(AM_V_GEN) to prettyfi makekeys stepKristian Høgsberg1-1/+1