src/xkbcomp/compat.c


Log

Author Commit Date CI Message
Ran Benita 119c952b 2012-07-17T00:53:07 compat: use list instead of CommonInfo in LEDInfo Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 50b25a12 2012-07-17T11:03:43 Use xkb_group_index_t for group variables throughout Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita e21fc886 2012-07-17T00:43:59 compat: use list instead of CommonInfo in SymInterpInfo Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita ba4320f7 2012-07-16T22:45:16 Move indicators.c code into compat.c It is only used there. Allows some refactoring. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita dfa0929c 2012-07-16T22:15:43 Convert macros to inline functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita d0097f4e 2012-07-15T15: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>
Ran Benita ad8875c5 2012-07-15T14:02:36 Remove GroupsWidth macro Use key->width directly instead. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 4ccb0ef5 2012-07-15T13: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>
Ran Benita e8a6a5f0 2012-07-15T10: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>
Ran Benita 81d029f5 2012-07-15T11: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>
Ran Benita caca60f3 2012-07-15T01: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>
Ran Benita 1313af8f 2012-07-15T01:31:34 Get rid of xkb_key_names Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 50fef8eb 2012-07-15T00:46:31 Get rid of xkb_indicator Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita ed082617 2012-07-15T00: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>
Ran Benita 3de9d874 2012-07-15T00:26:28 Get rid of xkb_server_map Same as xkb_client_map which was removed before. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 219243fe 2012-07-15T00:06:11 Get rid of xkb_client_map We don't make this distinction anymore, and the separate allocations just make it harder to reason about. Since we require that all of symbols, types, compat etc. be present, we should just put stuff directly in the keymap struct. Signed-off-by: Ran Benita <ran234@gmail.com>
Daniel Stone 9308a460 2012-07-17T10: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>
Ran Benita 6c3e0811 2012-07-14T15:14:44 Convert missed enum merge_mode variables Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 43bf4136 2012-07-14T15:19:12 Fix fileID mess A few problems here: * In e.g. keycodes.c the fileID field of the Info struct was never initialized to the id of the appropriate file, so it was always 0. There's some code which uses it, mostly for warnings. * Some of the fileID fields were unsigned char, which overflows several times, seeing as the ID in some of our tests can get > 1000 (because we reuse the context). * Some sign mismatches. * fileID vs file_id. Hopefully this fixes everything. I doubt this stuff had ever worked as intended, in xkbcomp or otherwise. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 3e65531f 2012-07-13T17:31:30 Move ComputeEffectiveMap code and avoid some duplication 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>
Ran Benita b7c0737a 2012-07-13T14:40:14 compat: fix XkbSI_AllOf matching condition To quote the spec: XkbSI_AllOf All of the bits that are on in mods must be set, but others may be set as well. Here "mods" refers to interp->mods. This matches xserver/libX11. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita f0599675 2012-07-11T16:16:20 dump: add back kccgst names Readd the component names to the keymap->names struct. This is used when printing the component, e.g. xkb_keymap { xkb_keycodes "evdev+aliases(qwerty)" { instead of xkb_keymap { xkb_keycodes { This makes diffing against xkbcomp $DISPLAY a bit easier and is kind of useful anyway. Signed-off-by: Ran Benita <ran234@gmail.com>
Daniel Stone cfed7960 2012-07-03T21:13:11 Remove 'force' argument from BindIndicators It was always true in the one callsite, so just remove the other branches. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone b10f924b 2012-07-03T21:22:09 Make BindIndicators static Since BindIndicators was only ever called immediately after CopyIndicatorMapDefs, move it up in the file and turn it into a static function, which avoids the need to ever pass the unbound LEDs around. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone d38d16e1 2012-07-03T21:17:11 Change BindIndicators return to void Since it could only ever return true, which avoids a totally unnecessary cleanup path. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone 9116e02d 2012-07-03T21:15:28 Remove 'unboundRtrn' argument from BindIndicators It was only ever passed as NULL from its single callsite, so just remove it and be done with it. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Ran Benita 7111eb8e 2012-06-29T17:45:47 compat: move some unclear code where it belongs It seems like at some point it was needed to break the abstraction and perform this piece of code in the context above CompileCompatMap. The extra argument and the typedef look strange now, and doesn't seem to be needed any more, so move them back. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 213dcf68 2012-06-29T17:31:10 Use enum for merge mode The merge mode shows up in a lot of functions, so it's useful to give it a distinct type. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 48b4d30a 2012-06-29T17:05:33 Use enum for file types enums are nice for some type safety and readability. This one also removes the distinction between file type mask / file type index and some naming consistency. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita f637d35a 2012-06-27T00:22:31 Use void* instead of old style char* in CommonInfo functions Removes some annoying casts. Signed-off-by: Ran Benita <ran234@gmail.com>
Daniel Stone 2cb6c35b 2012-06-22T16:08:05 Don't set explicit repeat masks when derived If we've only derived that a key should repeat, rather than had it explicitly specified, don't set the explicit member. Fixes the dump test. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone fe89d031 2012-06-22T15:26:07 Work out a default repeat for all keys Our early exit in ApplyInterpsToKey meant we weren't hitting the code that's supposed to set a sensible default autorepeat value for most keys. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Ran Benita c65a3596 2012-05-22T10:59:46 keytypes: use darray for xkb_kt_map_entry's Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita c2ac3a2b 2012-05-22T08:07:52 keytypes: use darray for key types in the client map Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 56150416 2012-05-22T00:52:28 compat: use darray for sym_interprets Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita d15fa57a 2012-05-13T17:21:02 Remove FileHandler callback argument It's unneeded; the same function is always passed. Signed-off-by: Ran Benita <ran234@gmail.com>
Daniel Stone 6433d72e 2012-05-09T20:12:12 Merge remote-tracking branch 'krh/keysyms' Conflicts: src/keysym.c src/misc.c src/text.h src/xkbcomp/expr.c src/xkbcomp/parser.y src/xkbcomp/parseutils.c src/xkbcomp/symbols.c Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Kristian Høgsberg ace1e5df 2012-05-09T09:05:00 Use our own keysyms
Ran Benita e7bb1e5f 2012-05-09T15:03:11 Shorten context to ctx (This breaks the API.) "context" is really annoying to type all the time (and we're going to type it a lot more :). "ctx" is clear, concise and common in many other libraries. Use it! Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Fix for xkb -> keymap change.]
Ran Benita cdd2906d 2012-05-09T13:50:05 Make the context available for XkbcAtomText And rename the function to xkb_atom_text. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb -> keymap.]
Ran Benita 8d680e80 2012-05-09T12:01:03 Make the context available for XkbcAtomGetString In preparation of contextualizing atom handling. Since we touch every function call, we also rename the function to xkb_atom_strdup to match xkb_atom_intern, and be more descriptive. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb -> keymap.]
Ran Benita c117318f 2012-05-09T11:47:20 Make the context available to xkb_intern_atom In preparation of contextualizing the atom table. Since we touch every function call, also rename the function to xkb_atom_intern, to match better with the rest (which will also be renamed). Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Fixed for 'xkb' -> 'keymap'.]
Daniel Stone 38cb6390 2012-05-09T15: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>
Ran Benita 33273304 2012-05-08T13:57:07 Rename xkbcomp/misc.h to xkbcomp-priv.h and use it The include dependencies were quite convoluted, where you change the order and get a ton of errors. Instead, change one file to act as the internal interface for the xkbcomp files, and make every file use it. Also drop the pointless "xkb" prefix to file names. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita dccdf32c 2012-05-08T01:08:07 Refactor Compile<component> functions The error handling was not ideal, so unify it. Also makes the functions a bit easier to read. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 12b3495d 2012-04-11T01:55:50 Remove unused 'which' and 'merge' arguments Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb_desc -> xkb_keymap changes.]
Ran Benita a641a185 2012-04-06T03:38:55 Use stdbool.h 'Cause defining your own True and False is so 1990's. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Fixed for xkb_desc -> xkb_keymap changes.]
Ran Benita a39ed85f 2012-04-05T11:24:39 Fix formatting in xkbcomp headers Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Fixed for xkb_desc -> xkb_keymap change.]
Ran Benita 073a2107 2012-04-08T15: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>
Daniel Stone ef88c7ef 2012-04-03T15: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>
Daniel Stone f249919e 2012-04-03T13:44:21 include resets group compatibility modifiers #43091 This change makes sure that include does not overwrite previous compatibility modifier settings when the included files does not explicitly specify them. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> Reviewed-by: Daniel Stone <daniel@fooishbar.org> [Cross-picked from xkbcomp commit 14470719.]
Daniel Stone 93ce9c7d 2012-03-29T16: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>
Daniel Stone 034ffce6 2012-03-27T17:22:35 Use xkb_contexts in keymap compilation Primarily for the include path, but also for the logging in future. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Ran Benita 602e8780 2012-03-24T13: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>
Ran Benita 2165e16e 2012-03-24T02: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>
Ran Benita f08ce9b7 2012-03-24T00:26:12 Use strcasecmp consistently instead of uStrCaseCmp There's no use calling the same thing by a different name. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 3104a8ef 2012-03-24T00: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]
Daniel Stone 1afc6fca 2012-03-21T02:17:58 Don't clear real mods in action modmask Previously, we would clear out the real modmask when updating the modmask for action maps, if not using the key's modmask. The correct behaviour here is instead to use the key's modmask if using the modmap, else use the real mods provided with the action originally. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone 7dbd3040 2012-03-16T14:22:04 More useful errors for invalid keysyms Instead of generating a fairly droll internal error, generate a warning also telling us exactly where the bad definition was. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone f40e0790 2012-03-16T13:59:24 Fix non-useModMapMods action masks By ensuring their mask is only the vmods, rather than also potentially including the key's modmap. Also remove the unnecessary vmodmask indirection. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone 3560bf7b 2012-03-15T08:36:09 Also update vmod -> indicator maps Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone 0e0b5b00 2012-03-14T18:24:37 Update modifiers after building keymap The server used to have to go and do this on our own, but we can do better than that: after we've compiled the keymap, go through and bind virtual modifiers to everything that needs it. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone 62444a11 2012-03-14T17:06:09 Convert interp action from xkb_any_action to xkb_action Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone a0e756fd 2012-03-09T19:09:25 Introduce xkb_atom_t type Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone b28823cc 2012-03-09T16:04:00 Remove KcCGST names from the map Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Ran Benita c800c60a 2012-03-01T19:25:37 Don't leak ActionInfo's Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita c50c87bc 2012-03-01T21:26:25 Don't leak the various *Info's names when overriding them Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 889a299e 2012-03-02T14:49:36 Free XkbFile's when no longer needed Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita d2c3dd0c 2012-03-02T22:31:29 Constify some more text functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita eb738b13 2012-03-02T17:40:19 Constify global tables Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita a3e40917 2012-03-01T23:43:51 Remove return's at the end of void functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 4bc839ab 2012-02-29T20:50:17 Use memset instead of bzero Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita f278cea1 2012-02-29T20:25:11 Remove all uses of the register keyword Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 6a34e4e1 2012-02-29T19:56:39 Don't check for NULL before free() Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita a0dd0526 2012-02-25T11:46:12 Remove unused includes of "tokens.h" Signed-off-by: Ran Benita <ran234@gmail.com>
Daniel Stone 590df28c 2012-02-20T16:35:39 Move groupNames mask definition to its user groupNames was declared in compat.c as a global to anything which included compat.h (for which groupNames was its sole reason to exist), but only ever used in indicators.c. Which is kind of fortunate, given that e314931e removed identical definitions of groupNames (as integers, not masks) from both action.c and symbols.c. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone 482d4faa 2012-02-20T13:44:27 Remove priv arguments from ExprResolveBoolean They've never been used. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone 3151ce36 2012-02-20T13:34:36 Remove priv arguments from ExprResolveModMask What with them now being unused and all. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone 67605d2c 2012-02-20T13:32:09 Introduce ExprResolveVModMask Which is just a slightly more typesafe wrapper around the chained ExprResolveModMask everyone was using earlier. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone c45cdb0c 2012-02-16T00:22:11 Still more memory leak fixes Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone 1a6c3807 2012-02-15T15:58:14 vmod: Pass xkb_desc explicitly to vmod functions Some error paths don't set info->xkb correctly, so just do like most utility functions and pass the xkb_desc explicitly. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Kristian Høgsberg a63e82be 2010-12-17T21:14:54 Rename XkbcInternAtom() to xkb_intern_atom() and export Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Kristian Høgsberg 12569157 2010-10-20T15:57:45 Restore compatible action structs This unbreaks the X server code to serialize an xkb_desc, but loses the 32 bit vmod fields. Needs some work...
Kristian Høgsberg b3805a23 2010-07-02T12:26:43 Get rid of a few unused #defines in public header
Kristian Høgsberg 9f602686 2010-07-01T14:35:24 Pull in enough structs and defines from XKBstr.h to only need XKB.h We want to move away from sharing implementation structs and let libX11 and libxkbcommon use each their own set of structs.
Kristian Høgsberg e10e16ad 2010-06-30T17:20:56 Constify XkbcAtomText() Atoms aren't mutable and this lets us put tbGetBuffer() back in the box.
Kristian Høgsberg 399d4bd6 2010-06-28T06:58:01 Drop malloc wrappers
Daniel Stone 2fb329c9 2010-06-23T16:25:10 Copy and duplicate XkbModsRec and XkbKTMapEntryRec Copy these types in so we can extend the vmod size. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone 15b0db54 2010-06-17T05:56:08 Copy in XkbCompatMapRec and XkbSymInterpretRec These contain actions, so transition them ahead to XkbcAction and move them into XKBcommon.h. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone b3852542 2010-06-21T14:27:58 Interp: More lazy keysym resolution Resolve the keysyms when we create an InterpDef, rather than directly in the parser. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone d2d787df 2010-06-17T00:51:49 Regroup actions into current vs. deprecated, resize vmod Use Xkbc* for all our actions that we intend to keep around, and Xkb* for deprecated ones we can hopefully get rid of, at least internally. While we're at it, make vmods be a uint32_t. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone ad0a3d7c 2010-06-15T15:20:32 xkbcomp: Don't leak atom text and string exprs Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Dan Nicholson 6a84a34d 2009-04-08T07:46:25 Remove all non-public API from XKBcommon.h header The noble intention was to expose all the new API and new generic types in the split out kbproto headers through XKBcommon.h. It turns out that would be a massive amount of work in the server. Someday, but first just wedging in XkbCompileKeymap* would be good. Most of the API is in new internal xkb*.h headers. In order to allow the XKBcommon.h header to be used from the server, we can't pull in other headers from kbproto since the server has its own copies. However, types that are different (XkbDescRec, XkbAction) still have Xkbc equivalents here, and I think they should be used in the server.
Dan Nicholson 5889cef8 2009-04-05T20:27:35 Require strdup and remove utils wrapper This kills a couple warnings from using the uStringDup wrapper. If you don't have strdup on your platform, you have bigger issues.
Dan Nicholson a2e59767 2009-04-04T12:50:27 xkbcomp: Don't say we're exiting when we're not
Dan Nicholson 5c910623 2009-04-04T09:19:51 Remove trailing spaces in source files
Dan Nicholson a27e56b6 2009-03-31T07:21:20 xkbcomp: Remove duplicated macros
Dan Nicholson 2671b777 2009-03-28T14:06:26 Add more *Text functions from xkbfile This should cover all the usage in xkbcomp. The format arguments were dropped except for the special case of XkbModMaskText, which needs to write in XkbCFile format in HandleVModDef. This was just changed to a Bool to avoid the need for the macros in XKBfile.h. The function prefixes have been renamed to be unique from xkbfile.
Dan Nicholson b9335d58 2009-03-28T14:09:36 Kill off usage of Display The use of Display in xkbcomp always boiled down to passing it to XkbInternAtom and XkbAtomGetString. This shouldn't be a problem here.
Dan Nicholson 39d7be43 2009-03-28T11:45:05 xkbcomp: Use xkbcommon allocation functions s/XkbAlloc/XkbcAlloc/ so we don't know XKBlib.