Commit Graph

61 Commits (5eb0a70e61528adba4f14fe1c7e058cc01378c4c)

Author SHA1 Message Date
Ran Benita 12b3495ddf Remove unused 'which' and 'merge' arguments
Signed-off-by: Ran Benita <ran234@gmail.com>

[daniels: Updated for xkb_desc -> xkb_keymap changes.]
2012-05-01 13:57:31 +01:00
Ran Benita a641a1859b 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.]
2012-04-30 17:05:57 +01:00
Ran Benita a39ed85f56 Fix formatting in xkbcomp headers
Signed-off-by: Ran Benita <ran234@gmail.com>

[daniels: Fixed for xkb_desc -> xkb_keymap change.]
2012-04-30 17:00:47 +01:00
Ran Benita 073a21076c 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>
2012-04-09 13:58:44 +01:00
Daniel Stone ef88c7efab 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>
2012-04-09 13:47:23 +01:00
Daniel Stone f249919ec6 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.]
2012-04-03 15:11:42 +01:00
Daniel Stone 93ce9c7d4f 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>
2012-03-29 16:31:09 +01:00
Daniel Stone 034ffce664 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>
2012-03-27 17:22:35 +01:00
Ran Benita 602e87805b 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>
2012-03-27 14:16:36 +01:00
Ran Benita 2165e16ed9 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>
2012-03-27 14:15:31 +01:00
Ran Benita f08ce9b71b 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>
2012-03-27 14:13:24 +01:00
Ran Benita 3104a8ef18 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]
2012-03-27 14:12:34 +01:00
Daniel Stone 1afc6fca4d 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>
2012-03-21 02:17:58 +00:00
Daniel Stone 7dbd304021 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>
2012-03-16 14:22:04 +00:00
Daniel Stone f40e0790f2 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>
2012-03-16 13:59:24 +00:00
Daniel Stone 3560bf7bf4 Also update vmod -> indicator maps
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-03-15 08:36:09 +00:00
Daniel Stone 0e0b5b00af 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>
2012-03-14 18:24:37 +00:00
Daniel Stone 62444a117c Convert interp action from xkb_any_action to xkb_action
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-03-14 17:06:09 +00:00
Daniel Stone a0e756fd83 Introduce xkb_atom_t type
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-03-09 19:30:31 +00:00
Daniel Stone b28823cc59 Remove KcCGST names from the map
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-03-09 16:04:00 +00:00
Ran Benita c800c60ace Don't leak ActionInfo's
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-04 00:04:04 +02:00
Ran Benita c50c87bca2 Don't leak the various *Info's names when overriding them
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-04 00:04:04 +02:00
Ran Benita 889a299e3b Free XkbFile's when no longer needed
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-04 00:04:04 +02:00
Ran Benita d2c3dd0c21 Constify some more text functions
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-03 01:17:57 +02:00
Ran Benita eb738b13ce Constify global tables
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-03 01:17:57 +02:00
Ran Benita 4bc839ab89 Use memset instead of bzero
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-02 22:41:20 +02:00
Ran Benita a3e40917ee Remove return's at the end of void functions
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-02 22:41:20 +02:00
Ran Benita f278cea107 Remove all uses of the register keyword
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-02 22:41:20 +02:00
Ran Benita 6a34e4e19a Don't check for NULL before free()
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-03-02 22:41:20 +02:00
Ran Benita a0dd052644 Remove unused includes of "tokens.h"
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-02-25 11:59:56 +02:00
Daniel Stone 590df28cc5 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>
2012-02-20 16:35:39 +00:00
Daniel Stone 482d4faaa1 Remove priv arguments from ExprResolveBoolean
They've never been used.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 13:44:27 +00:00
Daniel Stone 3151ce36fa Remove priv arguments from ExprResolveModMask
What with them now being unused and all.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-20 13:34:36 +00:00
Daniel Stone 67605d2c90 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>
2012-02-20 13:32:09 +00:00
Daniel Stone c45cdb0c67 Still more memory leak fixes
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-16 00:22:11 +00:00
Daniel Stone 1a6c3807d6 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>
2012-02-15 16:24:50 +00:00
Kristian Høgsberg a63e82be2a Rename XkbcInternAtom() to xkb_intern_atom() and export
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2011-01-29 14:10:22 -05:00
Kristian Høgsberg 125691573c 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...
2010-10-20 15:57:45 -04:00
Kristian Høgsberg b3805a2360 Get rid of a few unused #defines in public header 2010-07-02 14:21:59 -04:00
Kristian Høgsberg 9f6026867a 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.
2010-07-02 12:20:54 -04:00
Kristian Høgsberg e10e16ad2f Constify XkbcAtomText()
Atoms aren't mutable and this lets us put tbGetBuffer() back in the box.
2010-06-30 17:30:42 -04:00
Kristian Høgsberg 399d4bd678 Drop malloc wrappers 2010-06-28 06:58:01 -04:00
Daniel Stone 2fb329c964 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>
2010-06-23 16:25:10 +01:00
Daniel Stone b38525421f 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>
2010-06-22 15:57:16 +01:00
Daniel Stone 15b0db5492 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>
2010-06-22 15:57:16 +01:00
Daniel Stone d2d787df65 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>
2010-06-22 15:56:56 +01:00
Daniel Stone ad0a3d7c52 xkbcomp: Don't leak atom text and string exprs
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:55 +01:00
Dan Nicholson 6a84a34d86 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.
2009-04-08 07:46:25 -07:00
Dan Nicholson 5889cef809 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.
2009-04-05 20:27:35 -07:00
Dan Nicholson a2e597675b xkbcomp: Don't say we're exiting when we're not 2009-04-04 12:50:27 -07:00