|
b6ddd105
|
2012-10-11T14:05:49
|
|
keymap: rename keymap->sym_interpret -> sym_interprets
This can be a bit confusing.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
e43f53a6
|
2012-10-11T14:03:03
|
|
compat: add documentation for interpret's
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
90b1984c
|
2012-10-11T12:07:43
|
|
compat: don't forget to copy XKB_MATCH_NONE interpret's
Commit a8d462e3669b1790dfad75836d5ec59e390392ef accidentally removed the
OR with XKB_MATCH_NONE. It is in fact unused though.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a86fa17a
|
2012-10-10T21:01:15
|
|
build: change to AM_MAINTAINER_MODE([enable])
Disabled maintainer mode is annoying, we have no reason to do it. The
old behavior can still be had with --disable-maintainer-mode.
See:
http://lists.x.org/archives/xorg-devel/2012-September/033757.html
http://www.gnu.org/savannah-checkouts/gnu/automake/manual/html_node/maintainer_002dmode.html
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
2c188833
|
2012-10-10T20:53:26
|
|
build: honor $NOCONFIGURE in autogen.sh
Using NOCONFIGURE=1 ./autogen.sh can prevent it from running ./configure
on its own, which is sometimes useful.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a05fbc17
|
2012-10-10T19:14:35
|
|
stringcomp: test compilation of a dump of a keymap created from rules
This would have caught the regression fixed in 2ac319c.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
9197eb0f
|
2012-10-10T19:08:01
|
|
Remove the XKB_NUM_INDICATORS limit
Use a darray instead of a static array of size 32.
We still enforce XKB_MAX_LEDS because of the size of xkb_led_mask_t.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
f3732d83
|
2012-10-10T17:51:06
|
|
keymap: don't use darray for keymap->keys
It's never resized.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
bdea377c
|
2012-10-10T17:30:15
|
|
Rename XKB_NUM_GROUPS to XKB_MAX_GROUPS
This is a more appropriate name now.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
1dbb2c4a
|
2012-10-10T12:11:43
|
|
keycodes: refactor AddIndicatorName
Make it shorter and fix the XXX.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
2f4db8a9
|
2012-10-10T09:47:31
|
|
keymap, state: don't assume led index < xkb_keymap_num_leds
xkb_keymap_num_leds() returns the number of leds that have any
possibility of being set. Even if a led is defined but can not be set in
any way, it is not counted.
In a few places currently we assume that led indexes are smaller than
this number, which is wrong both for the above reason and for the fact
that the xkb format actually allows explicitly setting the indicator
index, which means that the indexes might be non-consecutive.
We don't really have good API to iterate on leds, now, because
xkb_keymap_num_leds is pretty useless. To work around that we use
sizeof(xkb_led_mask_t) * 8.
This makes the "Group 2" led work (try switching to a layout other than
the first in test/interactive).
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
9179fed7
|
2012-10-09T20:48:35
|
|
keysym: fix xkb_keysym_is_upper/lower() to work properly
Our current code (taken from the xserver) doesn't handle unicode keysyms
at all, and there seem to be some other changes compared to libX11,
which is what xkbcomp uses. So we just copy the code that does that from
libX11.
It would be much better to not have to hardcode unicode tables like
that, but it's probably better than dealing with glibc locale stuff for
now. It also doesn't affect our binary size much.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
2ac319c5
|
2012-10-08T22:11:18
|
|
compat: fix bad interpret predicate mods "all" calculation
Commit 9984d1d03cd78eb636c75cc2bbd2d240dc1dd72f changed the type of
interpret->mods to xkb_mod_mask_t, but this bit of code assumes that the
type is uint8_t.
This code is not usually run (for example by our tests), but when it
does keymap-dump would print out all of the modifiers (including the
virtual ones) which causes recompilation of the output to fail
miserably.
https://bugs.freedesktop.org/show_bug.cgi?id=55769
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
9984d1d0
|
2012-10-06T21:37:43
|
|
keymap: use xkb_mod_mask_t for interpret->mods and modmap
These are both real modifier masks, but we keep this information only in
the program logic now so when we change it we don't have to worry about
the type.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
6d74e66e
|
2012-10-06T17:53:53
|
|
Replace 0xff with MOD_REAL_MASK_ALL
To make it easier to see where it's used. The name is just to match
MOD_REAL.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a1124b59
|
2012-10-06T17:42:21
|
|
expr: unify the real and virtual modifier functions
This again pushes the mod type annotation to the original call site, to
make it easier to grep to see where the real/virtual distinction
matters.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
39232e6d
|
2012-10-06T17:21:09
|
|
Remove now-unneeded mod type annotations
Most of the mod type annotations can now be changed to MOD_BOTH, because
if you pass a mask which can only contain real mods in the first place to
e.g. ModMaskText, then MOD_REAL and MOD_BOTH will give the same result.
In the cases where MOD_BOTH is only ever the argument, we just remove
it. What's left is where it really "matters".
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
e6e3bda3
|
2012-10-06T17:00:26
|
|
expr: share code for modifier functions
We can make more use of the functions in text.c now and remove some
cruft.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
fcceeeaf
|
2012-10-06T21:26:01
|
|
symbols: refactor AddModMapEntry
It really asks for it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
9ebd2f67
|
2012-10-06T14:34:17
|
|
text: explicitly take mod_type in mod functions
This essentially "tags" each invocation of the functions with the
modifier type of the argument, which allows for easy grepping for them
(with the aim being, to remove anything but MOD_BOTH).
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
6d580127
|
2012-10-06T14:15:06
|
|
text: share code for modifiers
Add static common functions which take enum mod_type, and change the
existing ones to use them.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
424de613
|
2012-10-05T22:46:21
|
|
Keep real and virtual mods in the same table in the keymap
We change the keymap->vmods array into keymap->mods, and change it's
member type from struct xkb_vmod to struct xkb_mod. This table now
includes the real modifiers in the first 8 places. To distinguish
between them, we add an enum mod_type to struct xkb_mod.
Besides being a more reasonable approach, this enables us to share
some code later, remove XKB_NUM_CORE_MODS (though the 0xff mask still
appears in a few places), and prepares us to flat out remove the
distinction in the future. This commit just does the conversion.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
1005b320
|
2012-10-05T22:07:04
|
|
Don't use shifted virtual modifier masks
Modifier masks can be confusing in some places. For example,
key->vmodmap only contains virtual modifiers, where the first is in
position 0, the second in 1 etc., while normally in a xkb_mod_mask_t the
virtual modifiers start from the 8th (XKB_NUM_CORE_MODS) position. This
happens in some other places as well.
Change all of the masks to be in the usual real+virtual format, and when
we need to access e.g. keymap->vmods we just adjust by
XKB_NUM_CORE_MODS. (This also goes for indexes, e.g.
interpret->virtual_modifier).
This makes this stuff easier to reason about.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
6974e1f9
|
2012-10-05T21:40:49
|
|
expr: don't expose LookupModIndex
The Lookup* functions should remain a private implementation detail of
the expr.c file.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
aed3140e
|
2012-10-05T21:06:34
|
|
Remove VModInfo for now
VModInfo currently is only used to track which virtual modifiers were
declared in the file which owns the VModInfo. This, in turn, is only
used in ResolveVirtualModifier, which in turn is only used to resolve
the virtualModifier field in an interpret statement (compat.c). In other
words, it is used to ensure that interprets can only use a vmod which
was declared in the same map.
We remove this now, because it doesn't do much and distracts from other
changes; we will later re-add it properly. Specificly, we will make it
so that virtual modifiers are not the exception in that they modify the
keymap directly, instead of keeping the changes in some *Info struct and
commiting them to the keymap at the end of the compilation. (This is bad
because if a vmod is added to the keymap, and then the compilation of
this specific file fails, the change sticks around nonetheless).
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
9a2ce2a5
|
2012-10-05T20:17:54
|
|
vmod: don't allow to add a vmod with the name of a real mod
Otherwise strange thing might ensue.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
b65980cc
|
2012-10-05T15:10:41
|
|
state: don't needlessly fetch the xkb_key
It's a leftover.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
1f4009d4
|
2012-10-04T19:44:47
|
|
vmod: remove merge argument from HandleVModDef
It's unused and unneeded.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
dd29b14e
|
2012-10-03T12:57:53
|
|
Remove the XKB_NUM_VIRTUAL_MODIFIERS limit
Turn the virtual modifiers arrays in the keymap to a single darray,
which doesn't use this limit. The number of virtual modifiers is still
limited by the size of xkb_mod_mask_t, so we make sure not to go over
that.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
8016c6f4
|
2012-10-03T20:21:05
|
|
state: simplify xkb_state_mod_index_is_active
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
e5b6055b
|
2012-10-03T20:16:09
|
|
state: don't ignore type argument in xkb_state_mod_*_are_active
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
1a6b1e07
|
2012-10-03T19:41:22
|
|
state: fix bad EFFECTIVE check in *_is_active()
This is a regression introduced in ed78fbcb30888cbfc6cd00.
XKB_STATE_EFFECTIVE is just a OR of the other states, so using & here is
completely wrong. So test/state shows for example:
dumping state for LCtrl down:
group English (US) (0): effective depressed latched locked
mod Control (2): depressed latched locked
dumping state for LCtrl + RAlt down:
group English (US) (0): effective depressed latched locked
mod Control (2): depressed latched locked
mod Mod1 (3): depressed latched locked
dumping state for RAlt down:
group English (US) (0): effective depressed latched locked
mod Mod1 (3): depressed latched locked
dumping state for Caps Lock:
group English (US) (0): effective depressed latched locked
mod Lock (1): depressed latched locked
led Caps Lock (0): active
dumping state for Alt-Shift-+
group English (US) (0): effective depressed latched locked
mod Shift (0): depressed latched locked
mod Mod1 (3): depressed latched locked
which is bogus.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
fe1faa14
|
2012-10-03T20:08:13
|
|
Use our types instead of int/uint32_t in a few places
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a75989b9
|
2012-10-04T12:39:22
|
|
Omit struct '_Name' from non-recursive struct typedefs
Just a pet peeve.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
1401b0fb
|
2012-10-04T12:27:06
|
|
expr: don't allow "none" in LookupModIndex
LookupModMask handles this before calling LookupModIndex, and the only
other user in symbols.c doesn't handle this return value at all.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
239a5be1
|
2012-10-04T11:48:56
|
|
keysym-utf: make keysym->unicode table a bit smaller
Saves a few kbytes, and unlikely to change.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
1c880887
|
2012-09-30T11:55:11
|
|
Don't scan and parse useless maps
One physical xkb file may (and usually does) contain multiple maps. For
example, the us symbols file contains a map for every variant.
Currently, when we need a map from a file (specific or default), we
parse the entire file into a list of XkbFile's, find the map we want and
discard the others. This happens for every include statement. This is a lot
of unnecessary work; this commit is a first step at making it better.
What we do now is make yyparse return one map at a time; if we find what
we want, we can stop looking and avoid processing the rest of the file.
This moves some logic from include.c to parser.y (i.e. finding the
correct map, named or default). It also necessarily removes the
CheckDefaultMap check, which warned about a file which contains multiple
default maps. We can live without it.
Some stats with test/rulecomp (under valgrind and the benchmark):
Before:
==2280== total heap usage: 288,665 allocs, 288,665 frees, 13,121,349 bytes allocated
compiled 1000 keymaps in 10.849487353s
After:
==1070== total heap usage: 100,197 allocs, 100,197 frees, 9,329,900 bytes allocated
compiled 1000 keymaps in 5.258960549s
Pretty good.
Note: we still do some unnecessary work, by parsing and discarding the
maps before the one we want. However dealing with this is more
complicated (maybe using bison's push-parser and sniffing the token
stream). Probably not worth it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
26e685da
|
2012-09-30T14:27:37
|
|
scanner: don't strdup the file name
We don't modify it and there's no way to modify the original in the
scanner_extra life time.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
ee4ab30e
|
2012-09-28T10:15:27
|
|
scanner: share code in XkbParse{File,String}
Some refactoring to prepare for changes in the parse() function.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
471ebad6
|
2012-09-30T14:23:58
|
|
scanner: remove uselss 'last symbol' error message
It never shows something useful. Besides, you already get the line
number, which is enough.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
22684cd1
|
2012-09-30T10:50:38
|
|
parser: remove XkbCompMapList rule
This rule allows you to put several xkb_keymaps in one file.
This doesn't make any sense: only the default/first can ever be used,
yet the others are fully parsed as well.
Different keymaps should just be put in different files.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
3b5ada23
|
2012-09-30T10:33:59
|
|
parser: remove XkbConfig rule
This rule allows you to write file maps as:
xkb_keycodes
<BLA> = 5;
[...]
instead of the usual format which is:
xkb_keycodes {
<BLA> = 5;
[...]
};
This is not documented, It is also not used in xkeyboard-config, and I
have never run into it otherwise. It also only allows one map per file.
It *might* be used in some obscure place, but probably nothing we should
care about; the simplified grammar is more useful for us now.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
693a1f57
|
2012-09-30T10:42:30
|
|
test/interactive: allow -k to get any absolute path
Instead of looking for a keymap in test/data.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
26cc2f40
|
2012-09-30T14:17:08
|
|
Don't use %z printf format
Some libc's don't support it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
ed1203df
|
2012-09-30T12:42:44
|
|
rules: always initialize idx variable
gcc didn't catch this one.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
92e07726
|
2012-09-27T20:16:12
|
|
test: add keycodes files which map directly to evdev codes
This is a proof-of-concept for the long key names. The keycodes in the
file evdev-xkbcommon are autogenerated from linux/input.h, and uses the
names given there; all of the previous names are aliased to the new
names, so they continue to work with the symbols files, etc.
You can try it with 'sudo ./test/interactive -r evdev-xkbcommon -n 0'
The -n 0 means that we don't offset the evdev scan codes - just feed
them directly. The -r evdev-xkbcommon just means to use a new rules file
which makes us use the new keycodes file. (The only problem I can see is
with the MENU and LSGT names which has some conflicts).
Maybe some day xkeyboard-config could ship something similar, so that
the 8 offset is unneeded.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
32c19f4b
|
2012-09-27T21:30:29
|
|
keymap-dump: make it look better with long key names
Not worth messing around with too much, just make it legible.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
984ebf98
|
2012-09-27T20:44:16
|
|
test/interactive: allow to set evdev offset
If we want to test a keymap without the usual 8 offset.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
41a7fed3
|
2012-09-27T19:21:26
|
|
Fix type of keycode in parser and ast
For some reason keycodes were listed under mapFlags in the yylval union.
Fix it and some sanity checks.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
3b389b15
|
2012-09-27T18:49:13
|
|
Don't limit key names to 4 characters
Currently you can't give a key in xkb_keycodes a name of more than
XKB_KEY_NAME_LENGTH (= 4) chars. This is a pretty annoying and arbitrary
limitation; it leads to names such as <RTSH>, <COMP>, <PRSC>, <KPAD>
etc. which may be hard to decipher, and makes it impossible to give
more standard names (e.g. from linux/input.h) to keycodes.
The purpose of this, as far as I can tell, was to save memory and to
allow encoding a key name directly to a 32 bit value (unsigned long it
was).
We remove this limitation by just storing the names as atoms; this lifts
the limit, allows for easy comparison like the unsigned long thing, and
doesn't use more memory than previous solution. It also relieves us from
doing all of the annoying conversions to/from long.
This has a large diffstat only because KeyNameText, which is used a lot,
now needs to take the context in order to resolve the atom.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
53cfe8c3
|
2012-09-27T09:19:12
|
|
xkbcomp/keymap: use default interpret in ApplyInterpsToKey
This makes the code easier to follow and does more explicitly what the
xkblib spec says:
If no matching symbol interpretation is found, the server uses a
default interpretation where:
sym = 0
flags = XkbSI_AutoRepeat
match = XkbSI_AnyOfOrNone
mods = 0
virtual_mod = XkbNoModifier
act = SA_NoAction
If a level doesn't have any keysyms, we don't apply anything to it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
11df0632
|
2012-09-27T21:11:11
|
|
state: add missing const in get_one_sym
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
5aaf65b7
|
2012-09-27T23:27:49
|
|
Add xkb_state_key_get_one_sym
The trivial wrapper around xkb_state_key_get_syms that every user to
date has implemented.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
29a8b1ce
|
2012-09-26T10:28:52
|
|
Fix size_t vs. %d warning
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
cfa6d25c
|
2012-09-25T11:49:23
|
|
symbols: get rid of autoType
The autoType variable is supposed to tell us whether the type was
explicitly specified by the user or was detected automatically according
to the keysyms. It then allows us to know whether to prints the type
when we dump the keymap to a string or not.
Right now it is not always set when we find an automatic type, according
to some apparently legacy rules. We change it to simply this: type
computed automatically? -> don't print.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
76478418
|
2012-09-25T11:35:59
|
|
symbols: separate type-finding logic from CopySymbolsDef
It's easier to follow this in isolation. Besides, previously the error
reporting wasn't done very well.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
5d265926
|
2012-09-24T14:57:30
|
|
keymap: remove some more unneeded macros
It clearer to just access the needed data directly.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
c955f8e2
|
2012-09-24T14:41:09
|
|
keymap: store a pointer to the type in xkb_group instead of index
Gets rid of some more unneeded indirection, including the XkbKeyType
macro.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
01b00d75
|
2012-09-24T12:11:31
|
|
keymap, symbols: improve xkb_key memory layout
Add struct xkb_group and xkb_level for use in xkb_key, to mirror how
it's done in KeyInfo, GroupInfo, LevelInfo in symbols.c. This
corresponds more nicely to the logical data layout (i.e. a key has
groups which have levels), and also removes a lot of copying and ugly
code due to the index indirections and separate arrays which were used
before.
This uses more memory in some places (e.g. we alloc an action for every
level even if the key doesn't have any) but less in other places (e.g.
we no longer have to pad each group to ->width levels). The numbers say
we use less overall.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
e44cd2e9
|
2012-09-24T10:55:20
|
|
symbols: move keysyms into LevelInfo
Instead of maintaining a syms array in the GroupInfo + sym_index's in
the levels. This simplifies the code somewhat.
In order not to alloc for every level instead of every group, we only do
it if the level has more than one keysym (with a union). Since for now
this is a special case, it actually works out better memory-wise.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
eaf95152
|
2012-09-24T10:16:09
|
|
symbols: fix index-out-of-bounds in FindAutomaticType
If we enter this branch, we have 3 <= width <= 4, so if the width is 3
than syms[3] is out of bounds.
Happily inherited from xkbcomp.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
504853de
|
2012-09-24T09:14:35
|
|
symbols: remove unneeded optimization
The levels will be resized to the number of levels of the type anyway,
so removing useless levels from the end here is unneeded.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
e0573c76
|
2012-09-24T00:50:19
|
|
keymap: use our type for keymap->enabled_ctrls
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a8b6b08a
|
2012-09-24T14:36:46
|
|
Add missing declaration for _xkbcommon_parse (aka yyparse)
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
1d47cbfc
|
2012-09-23T22:32:53
|
|
keymap.h: add note on why XKB_NUM_GROUPS is still there
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
d941bc0c
|
2012-09-23T22:12:43
|
|
keymap, symbols: use darray for num_groups
Instead of using a static array of size XKB_NUM_GROUPS, because we want
to get rid of this limit.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
79bbf6f7
|
2012-09-23T21:15:34
|
|
symbols: avoid possible access-out-of-bound due to explicit_group
The code that handles group name statements currently does this:
info->group_names[grp - 1 + info->explicit_group] = name;
Other than the fact that this addition makes no sense, it actually can
reach out of the bounds of the array (which is of size XKB_NUM_GROUPS)
in the (non-realistic) case where (grp - 1) is not 0 (i.e. the statement
is not name[Group1] = "foo").
We also change explicit_group to be XKB_LAYOUT_INVALID if not set
otherwise, instead of initializing it to 0; this is clearer and if
someone happens to write 'us:1' for some reason, it will discard the
other groups in the file as it should.
This entire explicit_group thing was clearly bolted on as an
afterthought.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
6d97d0ce
|
2012-09-23T20:38:25
|
|
symbols: rename SymbolsInfo groupNames to group_names
Just to match the matching field in the keymap.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7a90f9e2
|
2012-09-23T20:36:01
|
|
keymap: don't use XKB_NUM_GROUPS for key->kt_index
One unneeded XKB_NUM_GROUPS less.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
9a18b872
|
2012-09-23T17:52:51
|
|
Add format argument to xkb_keymap_get_as_string
This function really needs a format argument, for symmetry with the
keymap creation functions. If we add new formats, we will almost
certainly want to add support for serializing it into a string. It would
also allow to convert from one format to another, etc.
The in the common case, the user would just want to use the format she
used to create the keymap; for that we add a special
XKB_KEYMAP_USE_ORIGINAL_FORMAT value, which will do that (it is defined
to -1 outside of the enum because I have a feeling we might want to use
0 for something else). To support this we need to keep the format inside
the keymap. While we're at it we also initialize keymap flags properly.
This changes the API, but the old xkb_map_get_as_string name works as
expected so this is the best time to do this.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
5d31b9e3
|
2012-09-23T16:57:16
|
|
Add return value the xkb_keysym_get_name
This is useful to see whether the function was successful and whether
truncation occurred.
It just changes void -> int so shouldn't break API or ABI.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
25b83844
|
2012-09-23T16:56:48
|
|
Improve API doxygen documentation
To make it look better and a bit more structured and informative.
Not all of the functions are converted to doxygen format, so this is not
finished.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
108fa1c7
|
2012-09-22T15:02:54
|
|
Add support for building doxygen API documentation
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>
|
|
0dd40125
|
2012-09-22T10:58:00
|
|
API: add _context prefix to log-related functions
This is to follow the general scheme set by all of the other API
functions.
Since no one is using these functions yet, we don't (actually better
not) add the old names to xkbcommon-compat.h.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
be3cbc99
|
2012-09-22T10:21:22
|
|
keymap: remove XkbKeyGetKeycode
Because we keep the keycode inside the xkb_key now.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
428c6f31
|
2012-09-22T02:05:48
|
|
symbols: convert KeyInfo->groups to darray
Before it was a static array of size XKB_NUM_GROUPS.
The previous cleanups made this transition a bit easier. This is a
first step for removing the XKB_NUM_GROUPS hardcoded limit; but for now
we still check that the groups are < XKB_NUM_GROUPS (e.g. in
ResolveGroup and GetGroupIndex) until the keymap, etc. is worked out as
well.
This also makes us alloc quite a bit less (this is just rulescomp):
Before:
==51999== total heap usage: 291,474 allocs, 291,474 frees, 21,458,334 bytes allocated
After:
==31394== total heap usage: 293,595 allocs, 293,595 frees, 18,150,110 bytes allocated
This is because most rmlvo's don't use the full 4 layouts that KeyInfo
had always alloced statically before.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
f671ce07
|
2012-09-22T02:36:05
|
|
symbols: fix memleak from default KeyInfo
If the default KeyInfo gets any keysyms or actions, it needs to be
free'd.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a12b5f62
|
2012-09-22T01:30:01
|
|
symbols: disallow changing global defaults from within a key statement
Pretty much like e5fdbcbb9943e9fe, again it isn't used.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
b70abcaf
|
2012-09-21T21:39:15
|
|
symbols: fold PrepareKeyDef into CopySymbolsDef
The function is big enough already but it's nicer to read sequentially.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
419a4975
|
2012-09-21T21:16:20
|
|
state: missing XKB_EXPORT on xkb_state_key_get_level
And some error handling.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
70a82afa
|
2012-09-21T20:09:17
|
|
configure.ac: use XORG_TESTSET_CFLAG for -fvisibility=hidden
Probably shouldn't use CFLAGS for that but o well.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
18a43322
|
2012-09-21T19:57:37
|
|
configure.ac: add XORG_MEMORY_CHECK_FLAGS
Adds some memory checking (e.g. MALLOC_PERTURB_) to tests.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
414007ca
|
2012-09-21T19:48:33
|
|
configure.ac: remove XORG_CHECK_MALLOC_ZERO
We don't use its result.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
31c74272
|
2012-09-21T18:39:01
|
|
configure.ac: fix bug report url
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
67b03cea
|
2012-09-21T16:30:01
|
|
state: correctly wrap state->locked_group and ->group
These values weren't wrapped before, which caused group_index_is_active
to stop working after a few group switches.
Also, the current group-wrapping function didn't take into consideration
actions such as LockGroup=-1, which need to wrap around, etc.
xkb_layout_index_t is unsigned, but it was used to hold possibly
negative values (e.g. locked_group is 0 and gets a -1 action).
This group wrapping function should now act like the XkbAdjustGroup
function from xserver, and at least ./test/interactive doesn't bring up
any problems with group switching any more.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7d1db12d
|
2012-09-21T15:39:32
|
|
state: separate group wrapping/clamping to a function
We'll need this function for wrapping our global effective group as
well.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
ed78fbcb
|
2012-09-21T12:45:58
|
|
state: special case effective group in layout_is_active
Currently, xkb_state_layout_{index,name}_is_active may report multiple
groups as effective, because at looks at base,latched,locked separately.
But there can only be one effective group, which is computed from the
other three. So if XKB_STATE_EFFECTIVE is requested, just compare to the
effective group we have computed.
We also modify mod_{index,name}_is_active similarly, just for symmetry
(there the effective mask is just an OR of the other three so the
current test is correct).
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a8b932a0
|
2012-09-21T12:23:56
|
|
symbols: remove useless identical groups optimization
What this code does is, in case someone compile a keymap like -layout
'us,us,us' then only one group would be created. If there is anything
which differentiates between any of the groups (e.g. a variant, another
layout), then this is not done.
This is pretty obscure, only saves a few kbytes in the final keymap, and
if the user asked for it, why not let her?
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
95b23448
|
2012-09-21T11:54:35
|
|
symbols: avoid reverse iteration in PrepareKeyDef
No need for that.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
c1741732
|
2012-09-21T11:14:39
|
|
Don't choke on RMLVO layout string with holes
This old rules parser gives the same kccgst here, so in the interest of
staying compatible we shouldn't fix it there. Similarly we shouldn't
touch ParseIncludeMap, so this is the best place to handle this.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
bbaa11c6
|
2012-09-21T14:58:31
|
|
Rename map.{c,h} to keymap.{c,h}
Seeing as we don't like "map" anymore.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7dca986e
|
2012-09-21T14:55:46
|
|
state, map: check XkbKey != NULL where missing
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
debd62b5
|
2012-09-21T13:30:42
|
|
Move xkb_state functions from map.c to state.c
Seems more appropriate.
Only change is to turn some xkb_state_get_map functions to direct
state->keymap.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
d206ecd9
|
2012-09-21T14:00:00
|
|
Rename private xkb_map_new to xkb_keymap_new
To be consistent with the API rename.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
fcd20290
|
2012-09-21T14:44:17
|
|
Don't use xkbcommon-compat names in internal code
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
bf194080
|
2012-09-19T16:19:57
|
|
Promote keymap enumeration API to public
Rename the functions to get keysyms by key/layout/level to fit with the
recent public API renames, and expose them.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
33a66515
|
2012-09-12T19:55:06
|
|
API change: Rename xkb_map_* and group -> layout
Move xkb_map_* functions to xkb_keymap_*, xkb_key_* functions under
either xkb_keymap or xkb_state, and rename groups to layout in all
user-visible API.
Backwards-compatible hooks are provided, such that old source will
build, but silently mangled to the new names, and old binaries will
also continue to work.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
005dee2b
|
2012-09-20T23:28:27
|
|
Add _xkbcommon_ prefix to parser and lexer symbols
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
80e15681
|
2012-09-12T19:52:30
|
|
Add xkbcommon-compat.h and compat.c
So we can start renaming stuff while retaining backwards source and
binary compatibility.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
2c96828f
|
2012-09-19T16:44:15
|
|
test: add print-compiled-keymap tool
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>
|