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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
We changed the PPI value to 96 so the default font size looks abnormally
large now. Reset it to the previous value of 12 so it is more "normal".
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds a new option to force a global PPI for all fonts. This overrides
per monitor PPI values.
This is useful if monitors do not provide correct PPI values and we want
the same behavior as all other X11 apps (which is 96 PPI forced).
Internally we speak of "Pixels per Inch" as this is more correct. However,
to not confuse users we use the more common term "Dots per Inch".
This also changes the default PPI value from 72 to 96. 96 is the de-facto
default value on linux so we should use it, too.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
If Shift is hold while F4 to F20 is pressed, a second parameter is added
to the sent CSI sequence. Implement this according to all other major
terminal emulators. This is no official DEC feature, though.
Thanks to "Etam" for reporting this!
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
No DEC-VT-manual seems to describe this feature, however, nearly all
terminal emulators stop parsing OSC strings when receiving a BEL
character. So add this to the normal ST character to terminate OSC
strings.
Many thanks to Ran Benita for reporting and investigating into this.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We might argue whether llog should be kept separate, however, shl is a
loose pile of headers and sources so pushing llog into it seems
reasonable.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
XTerm's altSendsEscape resource controls whether an escape character is
prepended to any output that is generated by keyboard input. We enable it
by default now.
Keyboard handling becomes kind of ugly now in the VTE layer. We should
definitely change this into some kind of lookup table or a more
sophisticated switch() handler in vte_input.c or similar.
Thanks to Tobias Wolf, "Etam" and Ran Benita for reporting this to the
bug-tracker and figuring out how this is correctly handled.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This moves the timers to SHL and removes the old static_misc header and
source. They are no longer needed.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The ring implementation is only used in one place so move it into SHL to
avoid linking it into all other libraries and applications.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This moves the whole hashtable implementation into the SHL library. Now we
can link it only to the applications that really use it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Shl (Static helper library) is the new name of all static helpers in
kmscon that might be shared between different applications.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
There is really no need to use these helper functions. Just directly call
the pthread locks.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Update all the introduction and documentation comments. Also remove an old
TODO item regarding glib.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
A short comment on how the UTF8 state machine works and why it does not do
any sophisticated error recovery.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Four helpers that define maximum UCS4 values, invalid values and a
replacement character for unknown values.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
All terminal-emulation code is moved into a new library called "TSM -
Terminal State Machine". So we rename everything to have a separate
namespace.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of requiring to use uterm_screen objects we now add a
fake_blendv() request directly to the display object. We rename it to
"fake_blend" instead of just "blend" so we can later implement real
blending.
This reuses the existing infrastructure. But the fake_blendv is the way to
go so we rename the existing functions to "fake_*" either.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of requiring to use a uterm_screen object we now also add these
helpers to the display directly. This allows to use libuterm without any
screens, which is often useful if no virtual screen are needed.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The user should be notified what went wrong when DRM properties couldn't
been read. There are also pending patches on the dri-devel ML that fix
reading properties without DRM-master.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This call may fail with recent kernel versions as DRM_MASTER is required.
Therefore, print more information so we know what went wrong.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need a copy of xkbcommon-keysyms.h as long as xkbcommon is not included
in all major distributions. We _need_ this build-time dependency,
otherwise, we cannot build the other keyboard backends.
However, requiring xkbcommon as build-time dependency is not a solution as
no major distribution includes it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm_internal.h contains only input related content so we can rename it
and remove all the inclusions where it is not needed.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This splits off all video related helpers of the big internal
uterm_internal.h header into uterm_video.h.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The fakevt tool is no longer used. The same functionality was integrated
into kmscon with the fake-VT uterm_vt backend.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
There is no need to make genshader being generated by configure, anymore.
We used to use @srcdir@ but this was not embedded into Makefile.am. Hence,
we can avoid this and make it build normally.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
libkms doesn't link to libdrm so our current check for gbm_bo_get_stride()
fails. This has been fixed upstream but distributions still need to pick
it up. Therefore, we simply add the drm libs to our checks. They are
available at this point, anyway.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We intend to make libuterm independent of kmscon so it can be used by
other projects. Therefore, add a pkg-config file for easier integration
into other build systems.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
If libxkbcommon is not available on the current platform, we still want to
be able to use the keysyms. We currently do this by depending on xproto
but this is ugly and we want to avoid this.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The pkg-config file allows other users of libeloop to more easily
configure build-time options for eloop.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
pre-cbs are similar to post-cbs but they are called _before_ the actual
dispatching takes place. It can be used to perform any actions before
going to sleep.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
If the dispatch files or is skipped for whatever reason, we should
nevertheless call the post-cbs to avoid any integration errors.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>