conf: remove uterm depedency

We move the GRAB type into kmscon-main.c to avoid any uterm dependency in
the conf subsystem. It is still open how we can better handle the
key-parser without a valid uterm_input object, but when there will be a
xkbcommon release, we can hopefully add a hard depedency to it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: update autotools logic and add "wlterm" application

Sorry for the big commit, but I was working on the wlterm application and
then thought I can rework the whole configure-logic again. This mainly
renames all build-defines to BUILD_DEFINE_* and BUILD_HAVE_* and allows
specifying which applications to build via --enable-kmscon/--enable-wlterm
and similar.

wlterm is a new application which is a native wayland client with no
external dependencies. It serves several purposes:
  * It uses TSM (not yet implemented, but will come soon) to create a
    console independent from kmscon. This shows how TSM can easily be used
    to create independent terminal emulators.
  * It is a native wayland application (probably the first independent
    wayland app so far?) and is used to test how well the wayland API
    works. As wayland is still under heavy development, we need more
    application-writers who report back whether the wayland-API makes
    sense to them and whether it works correctly.
  * A proper terminal-emulator for wayland! There is currently no proper
    emulator so we really need something that we can work with.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: theme: fix calculating window size regarding buttons

We need to avoid reducing window size beyond our minimal width used to
draw buttons.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
pty: set "TERM" via helper function instead of kmscon_conf

Instead of accessing global state, we now set the TERM value via a helper
function. This is needed to make the pty layer independent of kmscon.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
pty: set argv via helper function

This makes the pty layer independent of kmscon global state. This allows
us to use it in other applications bundled with kmscon. There is still
some work to do to make it fully independent so we can integrate it into
TSM. But that's not really needed, yet.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: toolkit: add wlt_window_get_eloop() helper

This helper allows widgets to retrieve the eloop that is used by the
window. Otherwise, we couldn't dispatch events there.
No refcounting is needed as all widgets are destroyed before the window is
destroyed. Other users need to perform ref-counting by themself.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: terminal: add TSM and PTY objects

Create TSM screens and VTE objects plus a PTY and connect everything so we
have a working terminal. Keyboard input still needs to be hooked up and
the drawing functions aren't implemented, yet.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: build text_font subsystem as separate static library

We want to use the font-rendering layer in wlterm so we need to split this
out. Gladly, the layer has only a build-time dependency on uterm and not
other hard-coded stuff. That is, we have no cleanup to do.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
text: add helpers to (un)load all modules at once

Instead of doing all this in main() we now use the two helpers. This makes
the code much more readable and avoids too many stuff in main().

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
pty: remove useless debug message

Remote pty debug message about resizing.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlterm: add hard-dependency to xkbcommon

wlterm needs xkbcommon as the wayland protocol depends on XKB states.
Hence, we add a hard-dependency for wlterm.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: load font modules during startup

We need the text-font modules to render fonts in wlterm. Therefore, load
all the font modules during startup before initializing the application.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: terminal: draw terminal to buffers during redraw-cb

Use the font subsystem to blit the console glyphs to the wlterm window
during redraw-callbacks.

This is mostly copied from src/terminal.c and the blitting functions from
uterm-fbdev.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: toolkit: add keyboard events

This implements the wl_keyboard client-side of the wayland protocol and
takes care of pushing keyboard events to the correct window.

A new callback is added to all widgets which is called when keyboard input
is sent to the specific window.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: terminal: handle keyboard events

Pass keyboard events straight through to the TSM handler.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: main: increase default window size to 600x400

Current default size is pretty small and there are still some resizing
bugs so increase it to have a working terminal.

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