shl: move kmscon_hook_* to shl

This is the last static helper that is moved so as a next step we should
get rid of the "static" library entirely.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: move all remaining static_* files to kmscon-core/uterm

There is absolutely no need to use kmscon-static anymore so move it into
kmscon-core/uterm as it is used by kmscon-core and libuterm exclusively.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: move unicode.[ch] to tsm_unicode.[ch]

All TSM related files will get the tsm_* prefix so move unicode headers
and sources.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: unicode: remove log_* calls

The logging-layer is not a dependency of TSM so we cannot use it. It is
also not needed anymore, as the unicode-layer is working pretty well.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: unicode: add symbol-table contexts

We should avoid any global state in shared libraries. As the TSM code is
becoming a shared library, we definitely need contexts for symbol tables.
However, we don't want to fix up all code now so we use a default table
NULL instead.

This can be fixed later but is ok for now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: unicode: export tsm_ucs4_to_utf8()

This helper function may be useful to other external code and allows us to
always return UCS4 strings. Other code can then use this helper to convert
it into UTF8.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: unicode: merge tsm_symbol_get() into table__get()

We do not do locking in tsm anymore so we can remove the table__get()
helper.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: unicode: add symbol-table helpers

Add three helpers to create and manage symbol-tables. Also fix internal
default-table to use them.

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

This adds a helper that removes entries from a hashtable. This hasn't been
needed, yet, so we never provided it. However, the new unicode-helpers
will need it for proper error recovery.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: unicode: fix error-path in tsm_symbol_append()

We never checked the memory helpers for errors because they used to be
from glib. However, with our own helpers we need to check for errors to be
sure.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: make xkbcommon built-time dependency

We really need xkbcommon-keysyms.h for building kmscon/uterm/TSM/etc.
However, the recent fix was ugly and didn't really help. Instead we copy
the keysyms file into external/xkbcommon/ so we can just include the real
xkbcommon files from any source but have a fallback in external/.

Hence, you can still build kmscon without xkbcommon with this fallback,
but this will be removed the first day when xkbcommon sees a public
release.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: unicode: add helper for ucs4->u8 string conversions

This small helper allocates a string big enough to hold the whole u8
string. This should be used for short and temporary strings only! It
allocates way to much memory for bigger or long-living strings.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
text: pass symbol-data directly into text layer

Instead of converting symbols into UCS4 string in each backend, we now
pass the whole data from the console layer into the renderers.

This makes all renderers indepedent of any recently introduced
symbol-tables and they can be implemented inside of TSM without exporting
them. However, we still need to pass the IDs to the text layer. The text
layer must not use them for anything but identification. Moreover, it must
never assume that they are valid tsm_symbol_t values.
We do this so the backends can still have fast hashtable lookups rather
than allocating big keys containing the UCS4 string+length and using these
for lookups.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
terminal: don't include tsm_unicode.h

This is not needed. And we want to avoid any dependencies to this layer
wherever possible.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: unicode: remove tsm_symbol_get_u8()

This is no longer used. You should first retrieve the UCS4 string and then
use the UCS4 to U8 conversion helpers instead.

All users have already been converted so we can remove this helper safely.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
console: rename prefix to tsm_screen_*

This is part of the TSM library creation. We also rename "console" to
"screen" as this layer actually manages the screen.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: fix header comments

Remove "kmscon" from any TSM headers and replace it by "tsm".

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: screen: move filenames to tsm_screen.[ch]

All TSM files use the "tsm_*" prefix and the object is now named "screen"
so rename the files to resemble this.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: add tsm_log_t llog-compatible log object

We need to avoid logging to stderr directly in TSM so introduce the
tsm_log_t object similar to eloop.h.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: fix build without uterm-keysyms.h

uterm-keysyms.h is no longer available but the makefile still references
it. Remove all occurrences of it to fix build again.

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