Make xkbcommon mandatory

We really need xkbcommon. There is so much stuff (including parsing of
keyboard shortcuts in conf.c) that depends on it. Therefore, we make it
mandatory now which allows us to use xkbcommon functions all over the
place.

Note that xkbcommon itself has no runtime dependencies so it is a small
self-contained library. The only reason I didn't do this ealier is that
xkbcommon has not seen a public release, yet. However, that should be done
in the near future.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Move grab-parsing into conf.c

We really need to clean this up and allow parsing of grabs in conf.c
again. xkbcommon is now mandatory so we can fix all the input layers to
use it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
shl: misc: add SHL_HAS_BITS() helper

This helper checks whether a bitmask has all the given bits set.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: input: plain: remove unused array

We do not parse num-lock anymore, so remove the unused array. GCC didn't
warn about it, which is weird, but it's definitely not needed, anymore.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: add shl_misc to all its users

Even though it's just a header, we want to be safe so add it to all users.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: add scrollback-buffer grabs

This copies the grabs from kmscon over to wlterm. It is now possible to
scroll up and down in the scrollback-buffer if you manually increase the
buffer size.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: add --term, --login, --palette and --sb-size

These terminal options are simply copied from kmscon and behave the same
way.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: screen: fix out-of-bounds access when drawing sb

When drawing scroll-back buffer, we cannot guarantee that the lines are as
long as the current screen. Therefore, check that we aren't accessing out
of bounds and draw empty glyphs instead.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: vt: make real_activate() behave like real_deactivate()

real_activate() has alsmost the same semantics as real_deactivate() so we
should also return -EINPROGRESS when we scheduled the VT switch. This
isn't used by kmscon currently, but may be used by other uterm users.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: vt: return error in real_deactivate() if VT is dead

We used to return 0 if we don't know the VT id in real_deactivate().
However, the VT id is nowadays always known so we must return an error
instead.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: vt: add fake_activate() and fake_deactivate() hooks

This makes uterm_vt_(de)activate() forward the request to fake-VTs, too.
The fake-VTs directly forward it to the callbacks.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: vt: do not automatically activate fake-VTs

We used to activate fake-VTs directly after they were allocated. This is
not needed anymore as we can control them directly now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: vt: fix skipping real_activate() when being inactive

This is probably a copy&paste error from real_deactivate(). We should skip
real_activate() if we are _active_, not if we are _inactive_.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: vt: add helpers to (de)activate all VTs at once

Two new helpers to activate or deactivate all VTs at once. They return the
total count of VT switches that are pending or an error code.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
kmscon: make --switchvt work again

The new uterm-vt helpers allow us to activate or deactivate all VTs during
startup and shutdown. Use them to make --switchvt work again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>