Commit Graph

67 Commits (699a0b841c26020815cf276980ad5ccaded7494a)

Author SHA1 Message Date
Ran Benita cdd2906de3 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.]
2012-05-09 15:55:40 +01:00
Ran Benita 8d680e808a 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.]
2012-05-09 15:43:47 +01:00
Ran Benita c117318ff1 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'.]
2012-05-09 15:31:43 +01:00
Daniel Stone 38cb639082 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>
2012-05-09 15:17:25 +01:00
Ran Benita 33273304f2 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>
2012-05-08 17:29:41 +01:00
Ran Benita dccdf32cc4 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>
2012-05-08 17:29:10 +01:00
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