kc3-lang/libxkbcommon/src/map.c

Branch :


Log

Author Commit Date CI Message
58f8d2c1 2012-07-20 17:09:49 utils: remove Xfuncproto.h and use our own macros Add XKB_EXPORT to replace _X_EXPORT, and copy the definitions of _X_ATTRIBUTE_FOO as ATTR_FOO. Signed-off-by: Ran Benita <ran234@gmail.com>
50b25a12 2012-07-17 11:03:43 Use xkb_group_index_t for group variables throughout Signed-off-by: Ran Benita <ran234@gmail.com>
8237e9c7 2012-07-17 11:56:00 Remove _X_EXPORT from xkb_key_get_group/level We should add them to xkbcommon.h if they need to. Signed-off-by: Ran Benita <ran234@gmail.com>
d0097f4e 2012-07-15 15:55:34 Pass around xkb_key's instead of keycodes This way we don't need to look up the key every time. We now only deal with keycodes in the public API and in keycodes.c. Also adds an xkb_foreach_key macro, which is used a lot. Signed-off-by: Ran Benita <ran234@gmail.com>
35a93b8e 2012-07-15 14:35:57 map: verifiy that the keycode is legal In case someone passes in a bad keycode. Signed-off-by: Ran Benita <ran234@gmail.com>
4ccb0ef5 2012-07-15 13:51:34 Get rid of group_info This is 8 bits which hold how many groups the key has, what to do the key group is out of bound and the group to redirect to if want to. This may save a few bytes, but is really annoying. So instead, just lay out the fields separately. We can optimize later in a sane way, with pahole, bitfields, etc. if we want. Signed-off-by: Ran Benita <ran234@gmail.com>
e8a6a5f0 2012-07-15 10:38:05 Add common xkb_key struct Instead of having a million arrays from the keycode to various key-specific info in the keymap, add a single struct xkb_key to hold all of the data for the key in one object. This way we can pass it around, do some refactoring and make the code simpler. It's also nice to see everything in one place. The keys array is still indexed by keycode, which is suboptimal because there may be a lot of holes (i.e. unused keycodes between min_key_code and max_key_code). By the end of this series it would be abstracted enough to replace it by a hash table or similar if there's ever a need. Signed-off-by: Ran Benita <ran234@gmail.com>
81d029f5 2012-07-15 11:52:54 Replace xkb_keycode_t 'key' variable name by 'kc' We want to reserve the name 'key' for something else. Signed-off-by: Ran Benita <ran234@gmail.com>
caca60f3 2012-07-15 01:45:34 Move per_key_repeats and enabled_ctrls to keymap All of the per-key data and global flags are now visible directly in the keymap. Signed-off-by: Ran Benita <ran234@gmail.com>
1313af8f 2012-07-15 01:31:34 Get rid of xkb_key_names Signed-off-by: Ran Benita <ran234@gmail.com>
50fef8eb 2012-07-15 00:46:31 Get rid of xkb_indicator Signed-off-by: Ran Benita <ran234@gmail.com>
ed082617 2012-07-15 00:39:15 Get rid of xkb_compat_map Same as xkb_{client,server}_map which were already removed. Signed-off-by: Ran Benita <ran234@gmail.com>
9308a460 2012-07-17 10:20:15 Run source tree through uncrustify .uncrustify.cfg committed for future reference also, but had to manually fix up a few things: it really likes justifying struct initialisers. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
c6c937ab 2012-07-15 17:35:35 Fix typo in out of range group calculation Signed-off-by: Ran Benita <ran234@gmail.com>
acdad605 2012-06-22 16:03:17 Don't ignore inactive type entries An entry for a type will only get marked as active if a virtual modifier can be directly mapped to it, and not if an action indirectly leads to it (e.g. LevelThree). We don't really need this test since entries which can never be triggered ... won't be triggered. The entire map->active thing should probably just go away. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
8e2c66e9 2012-06-22 15:27:05 Add xkb_key_repeats Does what it says on the box. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
955ed8c4 2012-06-06 10:38:45 state: use darray for filters For the darray we need to specify the explicit struct xkb_filter type instead of void*, so we move the definition of struct xkb_state into state.c thus making it opaque even from the rest of the files. It has enough getters to get going and is otherwise good style. Signed-off-by: Ran Benita <ran234@gmail.com>
c65a3596 2012-05-22 10:59:46 keytypes: use darray for xkb_kt_map_entry's Signed-off-by: Ran Benita <ran234@gmail.com>
7a1201bd 2012-05-09 20:51:37 Change xkb_key_get_syms to just return a bare int Signed-off-by: Daniel Stone <daniel@fooishbar.org>
38cb6390 2012-05-09 15:15:30 Change all 'xkb' xkb_keymap names to 'keymap' To make it a bit more clear what it actually is. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
b610b2b9 2012-05-08 14:52:23 Rename XKBcommonint.h to xkb-priv.h and use it Make the files in the src/* directory use their own header or a consilidated private header. This makes the file dependencies clearer. Also drop the pointless "xkb" file name prefix, add split a few declarations to their own files (atom.h and text.h). Signed-off-by: Ran Benita <ran234@gmail.com>
8fbd44fd 2012-04-06 03:12:50 Implicitly include config.h in all files The definitions in config.h should be available in all files an implementation detail; it can be included through the build system instead of having each file pull it every time. This is especially helpful with AC_USE_SYSTEM_EXTENSIONS, as _GNU_SOURCE and friends can have an effect by merely being defined, which can lead to some confusion if its effective for only half the files. And we don't really support a build _without_ config.h; so, one less thing to worry about. Signed-off-by: Ran Benita <ran234@gmail.com>
18e6a6a4 2012-04-05 10:47:43 Remove Xfuncproto.h and XKB.h from xkbcommon/xkbcommon.h The kbproto header is already not needed here anymore. Move the _X_EXPORT's to the corresponding function definitions, and use straight extern "C" clauses instead of _XFUNCPROTOBEGIN/END. It also makes more sense to have the EXPORT's in the source files, as it provides some documentation to the reader, whereas in the header it's obvious. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb_keymap changes.]
073a2107 2012-04-08 15:40:12 Constify the syms_out argument to xkb_key_get_syms() The caller should not mess around with these as they come directly from our internal structs. Signed-off-by: Ran Benita <ran234@gmail.com>
ef88c7ef 2012-04-03 15:14:16 Rename xkb_desc to xkb_keymap struct xkb_desc was just a hangover from the old XkbDescRec, which isn't a very descriptive name. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
93ce9c7d 2012-03-29 16:31:09 Full support for multiple keysyms per level Which also involved moving the global symbol map to be per-key instead; this should probably be split out into a separate commit. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
602e8780 2012-03-24 13:27:48 Define our own NoSymbol value and use it Since we have our own xkb_keysym_t type, it makes sense to have our own NoSymbol value instead of the one from X11/X.h. Signed-off-by: Ran Benita <ran234@gmail.com>
d3908b63 2012-03-24 12:33:28 Define our own None atom value Since we define our own xkb_atom_t type, it makes sense not to use the X11/X.h None value. This way we can also remove a lot of X11 includes. Signed-off-by: Ran Benita <ran234@gmail.com>
2165e16e 2012-03-24 02:36:11 Fix all -Wsign-compare warnings i.e comparison of signed and unsigned values. These are mostly harmless but fixing them allows to compile cleanly with -Wextra. Signed-off-by: Ran Benita <ran234@gmail.com>
3104a8ef 2012-03-24 00:12:08 Move utility macro from XKBcommonint.h to utils.h And merge all the similar ones into the same name. The u* prefix is chosen over the _Xkb prefix because it has more uses throughout the codebase. But It should now be simple to choose a nice prefix and stay consistent. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: fixed for the case where we have strcasecmp]
3d672fcf 2012-03-22 14:32:53 Add LED state API And also convert state.c to use the state API for mods and groups, rather than testing the state members directly. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
cfb07724 2012-03-22 14:30:58 Fix documentation bugs with mod/group state API Signed-off-by: Daniel Stone <daniel@fooishbar.org>
edcaab65 2012-03-21 15:25:32 Round out new state API Signed-off-by: Daniel Stone <daniel@fooishbar.org>
ecea0d71 2012-03-21 02:20:07 Add new state API Add new API to deal with xkb_state objects, including xkb_state_update_key, which runs the XKB action machinery internally to calculate what exactly happens to the state when a given key is pressed or released. The canonical way to deal with keys is now: struct xkb_state *state = xkb_state_new(xkb); xkb_keysym_t *syms; int num_syms; xkb_state_update_key(state, key, is_down); num_syms = xkb_key_get_syms(state, key, &syms); More state handling API, including a way to get at or ignore preserved modifiers, is on its way. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
272ccbf4 2012-03-21 02:19:44 Remove some rogue fprintfs Oops. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
4e704e7f 2012-03-14 17:05:09 Add xkb_get_syms_by_level Which allows you to pass in a group and a level rather than a fully-formed state. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
bc074525 2012-03-13 19:06:05 Add xkb_key_get_syms API (And a slight cosmetic header reformatting.) Signed-off-by: Daniel Stone <daniel@fooishbar.org>