|
fbe5e675
|
2013-02-28T10:48:40
|
|
Add environment overrides for default RMLVO
You can now set default values in the environment, as well as a context
option to ignore the environment, e.g. for tests.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
57bfde3a
|
2013-03-04T18:41:13
|
|
keymap: rename xkb_kt_map_entry to xkb_key_type_entry
That's a better name and fits more nicely.
Also change type->map to type->entries.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
0513686b
|
2013-03-14T12:45:34
|
|
rules: be more paranoid in scanner
This can't happen, but better safe than sorry. The optimizations were
noticeable but negligible.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
0e200bd5
|
2013-03-13T13:55:11
|
|
rules: quiet a gcc warning
src/xkbcomp/rules.c:620:36: error: 'idx' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Can't happen but no harm done.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
9f75e0ab
|
2013-03-07T01:15:21
|
|
state: use stdbool in filters
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
6a39a065
|
2013-03-04T18:35:56
|
|
Fix pointer style nit
(I really dislike this one for some reason..)
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
56ba9866
|
2013-03-04T14:16:36
|
|
Remove file_id entirely
It is not used anymore.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
64c00262
|
2013-03-04T14:15:32
|
|
symbols: remove file_id
See previous commits.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
4921eb74
|
2013-03-04T14:11:13
|
|
compat: remove file_id
See previous commit.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
2b6e576f
|
2013-03-04T14:04:49
|
|
types: remove file_id
See previous commit.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
2ddb9e4f
|
2013-03-04T14:00:44
|
|
types: put all copy-to-keymap code in one function
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
4bd0610f
|
2013-03-04T13:21:42
|
|
keycodes: remove KeyNamesInfo::merge
Not used.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
b06ef2b8
|
2013-03-04T13:06:38
|
|
keycodes: unwrap KeyNameInfo
We don't need the struct any more, it only contains one field now.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a78c1f0a
|
2013-03-04T12:53:32
|
|
keycodes: remove file_id
The file_id thing is used to identify the XkbFile some statement
originally came from. This is needed to avoid spurious warnings; for
example, if you write the same alias twice in a file, that's redundant,
and you'd want a warning about it. However if intentionally override it
from another file, that's fine, and you shouldn't get a warning. So by
comparing the file_id's the needed log verbosity is changed.
However, the file_id mechanism is really not needed, because we already
have that info! Each KeyNamesInfo corresponds to one XkbFile, so if the
conflict occurred while handling that one file -> same_file = true, and
if it occurs while merging two Info's -> same_file = false.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
f8d3ec9f
|
2013-03-04T12:27:06
|
|
keymap: don't use darray for key aliases
With a little tweak to the copy-to-keymap routine in keycodes.c we can
use a normal array.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
ea3cf26d
|
2013-03-04T10:33:18
|
|
keycodes: don't do unnecessary copies while merging
If 'into' in empty we can just steal 'from'.
Also move the alias-merging into the big function, it's nicer this way.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a7b1f80d
|
2013-03-02T20:43:57
|
|
Build cleanly with clang
clang doesn't like the use of typeof with out default flags, so just
don't use it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
14842d6d
|
2013-03-01T21:48:02
|
|
keymap: abstract a bit over the keymap format
Make it a bit easier to experiment with other formats.
Add a struct xkb_keymap_format_operations, which currently contains the
keymap compilation and _get_as_string functions. Each format can
implement whatever it wants from these.
The current public entry points become wrappers which do some error
reporting, allocation etc., and calling to the specific format. The
wrappers are all moved to src/keymap.c, so there are no XKB_EXPORT's
under src/xkbcomp/ anymore.
The only format available now is normal text_v1.
This is all not very KISS, and adds some indirection, but it is helpful
and somewhat cleaner.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
d1eae42a
|
2013-03-01T21:31:08
|
|
text: some style changes
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
4e8dcca8
|
2013-03-01T18:33:40
|
|
text: clean up and fix the *MaskText functions
The snprintf trick that LedStateText and ControlMaskText do cannot work,
because you can't use the buffer as an argument to write to itself!
(posix at least has 'restrict' there). So those two actually never
worked for more than one value (i.e. with a +).
Fix that, and do the same cleanup to ModMaskText. Now we have 3
functions which look exactly the same, oh well.
Also increase the context text buffer size, you never know.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
540feef3
|
2013-03-01T13:51:13
|
|
More spelling errors
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
cd6a71fc
|
2013-03-04T02:12:00
|
|
state: small style fix
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
71eb033e
|
2013-03-03T21:35:43
|
|
Move a couple of general keymap functions from keycodes.c
To get a key by name and resolve an alias - this makes sense for
everyone.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
82c3e393
|
2013-03-03T15:10:45
|
|
keycodes: remove unneeded alias conflict check
This is already checked when adding a new alias and merging aliases, so
it can never happen when we get to copying to the keymap.
Also the log verbosity decision there is quite useless, we should just
warn always and be done with it. So we can remove the file_id from
AliasInfo, and collapse the alias functions together.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
614f60e3
|
2013-03-03T00:11:27
|
|
xkbcomp: handle XKB file include's better
The 'merge_mode' situation is quite messy, and we've introduced a
regression compared to original xkbcomp: when handling a composite
include statement, such as
replace "foo(bar)+baz(bla)|doo:dee"
and merging the entire resulting *Info back into the including *Info,
we actually use the merge mode that is set by the last part (here it is
"augment" because of the '|'), when we should be using the one set for
the whole statement (here "replace").
We also take the opportunity to clean up a bit.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
b36d5b23
|
2013-02-25T17:00:53
|
|
parser: also skip 'section' ELEMENT
It's for geometry only.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
35657c66
|
2013-02-25T16:38:56
|
|
ast-build: remove malloc_or_die
This should be fixed properly.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a7b9c73d
|
2013-02-25T16:08:08
|
|
keycodes: fix spelling in error message
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
958b2728
|
2013-02-25T12:37:28
|
|
Remove list.h
We don't use it anymore and it's easy to add back if needed.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
98ccbf9a
|
2013-02-25T12:17:27
|
|
keymap-dump: move writing 'key {}' in symbols to its own function
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
4a59c84e
|
2013-02-25T12:09:17
|
|
keymap-dump: remove some ugly empty lines
xkbcomp prints them too, but that's just annoying. Also xkb_keycodes
doesn't have it already.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
e95dac76
|
2013-02-25T12:03:06
|
|
keymap-dump: don't indent after xkb_keymap {
xkbcomp doesn't indent there, so it's easier to diff.
Also saves some horizontal space which is sorely needed when looking at
these files (especially the xkb_symbols).
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
9842b7a5
|
2013-02-25T11:50:26
|
|
keymap-dump: style cleanups
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
d1f7100b
|
2013-02-25T01:12:38
|
|
ast: add error handling to XkbFileFromComponents
And try to not repeat ourselves.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a46e4cc1
|
2013-02-25T00:19:51
|
|
Fix dead assignments
"Value stored to 'stmt' is never read"
"Value stored to 'grp_to_use' is never read"
And change 'grp' to 'group' if we're here.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
c7aef166
|
2013-02-19T15:57:14
|
|
keysym: print unicode keysyms uppercase and 0-padded
Use the same format as XKeysymToString.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
dd81d5e0
|
2013-02-08T00:07:28
|
|
Change some log functions to take ctx instead of keymap
They don't need the keymap, only the context.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a4904ee1
|
2013-02-09T21:46:09
|
|
keycodes: some minor style
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
60bb639b
|
2013-02-08T14:03:36
|
|
action: s/hndlrType/handler_type
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
fab28da3
|
2013-02-08T16:06:35
|
|
compat: make it clear which 'dflt' is meant
Also s/dflt/default.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
b5c1b1d2
|
2013-02-07T23:28:18
|
|
symbols: make it clear which 'dflt' is meant
A bit easier at a glance. Also, vowels are cool, so just say 'default'.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
fc56b513
|
2013-02-08T00:02:49
|
|
ast: constify argument
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
164cec66
|
2013-02-19T11:10:23
|
|
symbols: fix bad 'merge' assignment
Bug introduced in 2a5b0c9dc1ad1488ecc6b139fd70e464eb687da6, was causing
some keys to be merged incorrectly.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
8cee7490
|
2013-02-17T22:18:57
|
|
Change 'indicator' to 'led' everywhere possible
The code currently uses the two names interchangeably.
Settle on 'led', because it is shorter, more recognizable, and what we
use in our API (though of course the parser still uses 'indicator').
In camel case we make it 'Led'.
We change 'xkb_indicator_map' to just 'xkb_led' and the variables of
this type are 'led'. This mimics 'xkb_key' and 'key'.
IndicatorNameInfo and LEDInfo are changed to 'LedNameInfo' and
'LedInfo', and the variables are 'ledi' (like 'keyi' etc.). This is
instead of 'ii' and 'im'.
This might make a few places a bit confusing, but less than before I
think. It's also shorter.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
089c3a18
|
2013-02-17T14:59:50
|
|
state: fix unbound virtual modifier bug
Recent xkeyboard-config introduced the following line in symbols/level3:
vmods = LevelThree,
However, the XKM format which xkbcomp produces for the X server can't
handle explicit virtual modifiers such as this:
https://bugs.freedesktop.org/show_bug.cgi?id=4927
So by doing the following, for example:
setxkbmap -layout de (or another 3-level layouts)
xkbcomp $DISPLAY out.xkb
xkbcomp out.xkb $DISPLAY
The modifier is lost and can't be used for switching to Level3 (see the
included test).
We, however, are affected worse by this bug when we load the out.xkb
keymap. First, the FOUR_LEVEL_ALPHABETIC key type has these entries:
map[None] = Level1;
map[Shift] = Level2;
map[Lock] = Level2;
map[LevelThree] = Level3;
[...]
Now, because the LevelThree virtual modifier is not bound to anything,
the effective mask of the "map[LevelThree]" entry is just 0. So when
the modifier state is empty (initial state), this entry is chosen, and
we get Level3, instead of failing to match any entry and getting the
default Level1.
The difference in behavior from the xserver stems from this commit:
acdad6058d52dc8a3e724dc95448300850d474f2
Which removed the entry->active field. Without bugs, this would be
correct; however, it seems in this case we should just follow the
server's behavior.
The server sets the entry->active field like so in XKBMisc.c:
/* entry is active if vmods are bound */
entry->active = (mask != 0);
The xkblib spec explains this field, but does not specify how to
initialize it. This commit does the same as above but more directly.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
bb620df7
|
2012-12-06T15:04:15
|
|
Parser: Initialise geometry elements for VarDecl
We were using uninitialised memory whilst parsing geometry, leaving
random contents as the return for shape/overlay/etc sections. Somehow
this actually worked everywhere but under Java.
https://bugs.freedesktop.org/show_bug.cgi?id=57913
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
f1598469
|
2012-11-11T16:14:30
|
|
state: rename state->cur to state->components
'cur' doesn't make sense anymore. 'components' is a bit long for this,
but not too bad, and nothing better comes to mind.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7372c9f1
|
2012-11-11T16:06:54
|
|
state: don't keep the previous state components in xkb_state
There is really no need to keep this in the struct, we can just allocate
it on the stack when we need to.
Don't know why I did it this way.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
60bd9202
|
2012-11-11T00:22:46
|
|
keymap: wrap the layout parameter if it is out of range for the key
The functions num_levels_for_key() and get_syms_by_level() have a
'layout' parameter. Currently it is expected that this value is always
legal for the key, as determined by num_layouts_for_key(). However,
there are legitimate use cases for passing an out-of-range layout there,
most probably passing the effective layout, and expecting to get the
keysyms/levels for just this layout. So we wrap it just as we do in the
xkb_state_* functions.
This is also useful for stuff like this:
http://developer.gnome.org/gdk/stable/gdk-Keyboard-Handling.html#gdk-keymap-lookup-key
If this behavior is not desired, the user has the option to check
against num_layouts_for_key herself.
https://bugs.freedesktop.org/show_bug.cgi?id=56866
Reported-by: Gatis Paeglis <gatis.paeglis@digia.com>
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
d9317d5f
|
2012-11-05T21:50:38
|
|
keysym-utf: mark keysymtab array as static
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7891c917
|
2012-11-05T21:34:59
|
|
keysym-utf: also translate special keysyms like Tab and Return
The keysym2ucs.c file apparently leaves out some keysyms, which libX11
deals with separately (like in _XkbHandleSpecialSym()).
The problematic keysyms are the keypad ones (for which we already added
some support) and keysyms which use 0xff** instead of 0x00** < 0x20.
This code should fix them properly, as much as I could gather from
libX11 and http://www.cl.cam.ac.uk/~mgk25/ucs/keysym2ucs.c and other
sources (which are not aware of locale).
https://bugs.freedesktop.org/show_bug.cgi?id=56780
Reported-by: Gatis Paeglis <gatis.paeglis@digia.com>
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
998c957a
|
2012-10-30T18:21:56
|
|
action: don't allow private actions with a known type
Some obscure bug having to do with Private actions; see the comments.
This was prompted by:
https://bugs.freedesktop.org/show_bug.cgi?id=56491
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7261f404
|
2012-10-29T01:00:27
|
|
state, context: allow passing NULL to *_unref()
For error handling code, it's nice to be able to pass NULL to these
function without worrying about segfaults ensuing. free() sets the
precedent here.
Also document this fact.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a51ee704
|
2012-10-26T16:24:11
|
|
state: don't use xkb_keymap_num_layouts internally
Clearer and more greppable this way.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
ee6f3f28
|
2012-10-26T16:12:28
|
|
state: don't use xkb_state_serialize_* internally
The code in these cases is clearer when done directly.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
6f093ad5
|
2012-10-24T23:09:26
|
|
state: fix possible index-out-of-bounds in action dispatch table
The current code assumes that action->type always falls in the range of
the xkb_action_type enum. But keymaps can also have Private actions,
which are allowed to set their own type number.
So with a default xkeyboard-config keymap, keycode 86 at level 4, which
triggers such an action, causes us to crash.
Fix it by always checking the bounds.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
f76859bc
|
2012-10-23T09:58:11
|
|
keymap: use plain array for keymap->group_names
Again it is not resized.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
867992cd
|
2012-10-23T17:17:18
|
|
state: fix typo in state component copying
Gladly no-one should have been fast enough to hit this.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
4b81c9f3
|
2012-10-22T21:00:57
|
|
Report which components of the state have changed
We add a return value to the xkb_state_update_key and
xkb_state_update_mask, which reports to the caller which of the state
components have changed as a result.
This restores the XKB functionality of the XkbStateNotify and
XkbIndicatorsStateNotify events. See:
http://www.x.org/releases/current/doc/kbproto/xkbproto.html#Events
It is quite useful in some situations. For example, it allows an
application to avoid doing some work if nothing of relevance in the
state has changed. Say, a keyboard layout applet. Also useful for
debugging.
The deltas themselves are not provided, because I can't see a use case.
If needed, it should be possible to add some API for that.
In xkbcommon, keymaps are immutable, so all of the other *Notify events
from XKB are irrelevant.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
550cb24d
|
2012-10-22T19:19:43
|
|
state: add struct state_components
This holds all of the state component fields in the state in one struct.
We will later want to keep the previous state components after updates,
so this will allow us to do it without duplicating the fields.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
6a94b122
|
2012-10-22T20:49:44
|
|
Split the mods, layout, leds parts of xkb_state_components
Note first:
This commits breaks the ABI somewhat. If an application is run against
this commit without recompiling against the updated header, these break:
- xkb_state_layout_*_is_active always retuns false.
- xkb_state_serialize_mods always returns 0.
So it might break layout switching in some applications. However,
xkbcommon-compat.h provides the necessary fixes, so recompiling should
work (though updating the application is even better).
Split the enum to its individual components, which enables us to refer
to them individually. We will use that later for reporting which
components of the state have changed after update.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
0779d9dc
|
2012-10-21T17:13:25
|
|
Silence a couple of warnings
These appear to come and go randomly.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
bb82759c
|
2012-10-18T23:08:10
|
|
Move _text() functions from keymap-dump to text.c
And make them use context_get_buffer() instead of using a static char
array.
This was the last non-thread-safe piece we had, as far as I can tell.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
e6946ae2
|
2012-10-18T22:55:17
|
|
Remove a couple more uses of static char buffers
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
714e95e1
|
2012-10-18T22:51:10
|
|
Contextualize GetBuffer()
Instead storing the buffer in a non-thread-safe static array, we move it
to the context.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
eb748ab6
|
2012-10-18T21:04:27
|
|
Clean up xkb_sym_interpret a bit
First we split the LEVEL_ONE_ONLY bit off of the 'match' field, which
allows us to turn enum xkb_match_operation to a simple enum and remove
the need for MATCH_OP_MASK.
Next we rename 'act' to 'action', because we've settled on that
everywhere else.
Finally, SIMatchText is changed to not handle illegal values - it
shouldn't get any. This removes one usage of the GetBuffer hack.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
5d9a5cb0
|
2012-10-17T19:52:47
|
|
Commit and distribute ks_tables.h
The ks_tables.h file is generated by makekeys.py from
xkbcommon-keysyms.h, which in turn is generated initially by 'make
update-keysyms'. The xkbcommon-keysyms.h file is commited to git and
distributed in the tarball. Since ks_tables.h should only ever change
when xkbcommon-keysyms.h changes, it is more sensible to update them
together and treat them the same, instead of generating ks_tables.h
every time for every builder with 'make', as we do now.
This means we don't need python as a build dependency (only the one
running update-keysyms, i.e. no one, needs this), and we can be
sure exactly the same file is used by everyone. We also don't need to
run makekeys.py on every build.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
17985511
|
2012-10-16T21:09:33
|
|
utils: add and use ARRAY_SIZE macro
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7b3bd11f
|
2012-10-16T16:05:34
|
|
Add xkb_keysym_from_name() flags argument for case-insensitive search
This adds a flags argument to xkb_keysym_from_name() so we can perform a
case-insensitive search. This should really be supported as many keysyms
have really weird capitalization-rules.
However, as this may produce conflicts, users must be warned to only use
this for fallback paths or error-recovery. This is also the reason why the
internal XKB parsers still use the case-sensitive search.
This also adds some test-cases so the expected results are really
produced. The binary-size does _not_ change with this patch. However,
case-sensitive search may be slightly slower with this patch. But this is
barely measurable.
[ran: use bool instead of int for icase, add a recommendation to the
doc, and test a couple "thorny" cases.]
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
5fff637e
|
2012-10-16T16:05:33
|
|
makekeys: replace helper with python script and binary search
This removes the complicated and undocumented hash-table creation-helper
and replaces it with an autogenerated sorted array. The search uses simple
bsearch() now.
We also tried using gperf but it turned out to generate way to big
hashtables and when reducing the size it isn't really faster than
bsearch() anymore.
There are no users complaining about the speed of keysym lookups and we
have no benchmarks that tell that we are horribly slow. Hence, we can
safely use the simpler approach and drop all that old code.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
3477d9e4
|
2012-10-05T16:23:03
|
|
Finish first round of API documentation
There are a few @todo's, but nothing serious.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
f43b33c0
|
2012-10-13T13:13:55
|
|
state: make mod_index_is_consumed() return -1 on invalid input
Like all the other functions.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
523e46f4
|
2012-10-12T10:15:43
|
|
Change log env vars to XKB_LOG_LEVEL/VERBOSITY
A bit more consistent and descriptive.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
89523789
|
2012-10-11T21:50:21
|
|
ast: simplify AppendStmt
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
bbf388ec
|
2012-10-11T16:54:17
|
|
Make xkb_keymap_num_leds return the index range instead of active count
Currently xkb_keymap_num_leds() returns a count of valid (settable)
leds. Because the indexes might be non-consecutive, and some leds
might not be settable, it is incorrect to use this function for
iterating over the leds in the keymap. But this is the main use case of
this function, so instead of the current behavior we adapt the function
to the use case by making it return the needed range of iteration.
The caller needs to handle invalid intermittent indexes, though.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
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>
|
|
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>
|
|
fcceeeaf
|
2012-10-06T21:26:01
|
|
symbols: refactor AddModMapEntry
It really asks for it.
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>
|
|
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>
|