We still have dead dependencies on libfont.la but don't build it anymore.
Remove the dependency as it is directly linked now.
Reported-by: Vladimir Kravets
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We removed this service unit earlier this week but the EXTRA_DIST variable
still mentions it. Remove it so kmscon builds cleanly again.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We no longer need these helpers so remove them. We require each backend to
register itself as part of module-loading so no need to keep these
helpers.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Similar to the font backends we now require one backend to be always
available as safe fallback. The bblit backend is the most basic backend so
make it mandatory and link it unconditionally.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
When text-ops are registered via modules, we need an owner field so
they're correctly tracked. Hence, add this field to all text-ops and
correctly keep module references.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The freetype2 backend is no longer recommended. You should always prefer
the pango backend. Pango provides a lot more advanced font options and
internationalization.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
All font definitions have been moved to font.h so remove the old
definitions and include font.h instead.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The owner fields specifies the module that provides the code for the given
backend. The font-core is responsible of ref/unref'ing the module so its
code is always available as long as the module exists.
We cannot push this into the modules as modules _must_ never call
kmscon_module_unref(KMSCON_THIS_MODULE)! Because this might drop the last
reference and hence the function might disallocate the module. However,
this means that it cannot return because the caller is _part_ of the
module and so no longer valid.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Several parts of kmscon have huge external dependencies. However, we allow
them to be disabled during build-time. But this is not enough as it
requires distributions to choose which options to use. Therefore, we now
allow dynamicly loadable modules that can optionally be installed and
kmscon automatically picks them up.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlterm hasn't been updated for long and it will take some more time to get
it to work with recent Wayland protocol. Hence, disable it so it doesn't
matter if it breaks for now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Each font-backend now also gets a .finalize callback that is called when
the last font-user drops its font. This will allow modules to destroy
themself when the last reference is dropped.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The new destroy callback is called whenever an entries last reference is
dropped. This will allow modules to keep reference of its code users.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
With modules we no longer need to conditionally load backends. Instead
each module will register the backend with the main application on load.
This will temporarily break pango, freetype2 and unifont backends as they
are not registered until we introduce full module support.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We want to modularize the text-font library, so we need each backend as a
different library. This step links each of them into a different static
library so we can now link them either into the binary or into modules.
This step also makes 8x16 always compiled into the text-font backend so we
always have a working implementation even though no modules might be
loaded.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The man_fixup_aliases thingy was a horrible hack. Replace it with a
temporary .man_fixup file that saves compilation timestamps so we have
post-recipies for man-fixups.
Also fix some minor out-of-tree build problems.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need the git-revision for module-version checks so provide the
infrastructure now and print it in log_init().
Note that the git-describe string is distributed with the tarballs so
end-users will not have to generate it themself. But when building from
git, the revision will be automatically updated whenever something
changes.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We didn't set the dependencies correctly for uterm libraries as a
backslash was missing. Fix this typo.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need to mark it as PHONY target as it has no corresponding source file.
It's unlikely that it causes problems, but lets be safe.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
"struct dirent" has always been a mess. As its size may differ between
systems, we need to dynamically allocate it. This helper does that for us.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of implementing our own thread-safe backend-storage, we now use
the generic shl-registry object.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of implementing a thread-safe backend-system we can now use the
new shl-registry storage module.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The shl-register module is used to create registries of named-objects. The
main purpose for it will be for module-systems were we have different
backends implementing an interface. The registry can then be used to find
a specific module (or the default module).
No sophisticated filter/search mechanism is used as this cannot be done
efficiently in a generic way.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The standard OpenGL surfaces are y-inverted (which we didn't implement
correctly previously when using our own gbm-surfaces). Therefore, we need
to flip the y-coordinates now as we use correct GL surfaces with the new
drm-uterm backend.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Until now we always created our buffers via gbm_bo_create() and used
surfaceless EGL contexts so we can schedule buffer-flips manually.
However, recent gbm and EGL mesa releases include gbm-surfaces that allow
us to ignore all this an let EGL manage the buffers.
This introduces some problems as we are no longer under control of the
buffers so we cannot know which buffer is active. That means, applications
that use the uterm-drm devices must redraw the screen on each frame.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We used font-size=15 in the past but changed it long ago. However, the
documentation still used 15 so fix this now.
Reported-by: James Buren <ryu0@ymail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This new template can be used as replacement for getty@.service. It has
the same semantics and can be used as drop-in replacement. It even uses
getty@.service as fallback if kmscon fails.
See the comments in the files for more information.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We now set COLORTERM to "kmscon" so applications can identify their
controlling terminal. Note that COLORTERM is not used for terminfo/termcap
detection (unlike TERM).
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We must pass "-p" to make "login" preserve the environment. We make sure
the environment is correctly reset before calling it so it is safe.
Furthermore, this allows us to pass additional environment variables to
the child without having /bin/login reset it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This property controls whether the environment should be reset before
spawning the child process. Defaults to "no" and affects whether "-p" is
passed as default argument to /bin/login.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The colorterm property is used (if set) as COLORTERM environment variable.
Note that this variable (despite the name) is not used with
terminfo/termcap. Instead, it's solely used to identify the running
terminal.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need udev_device_has_tag() which was introduced in version 172.
Document that in README file.
Reported-by: Manuel Rüger <mrueg@rueg.eu>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The wcwidth() POSIX helper returns the number of cells that a character
occupies. This is normally 1, however, if it is 0 we simply discard this
input (this should never happen as all characters that wcwidth() returns 0
for should already be handled by the VTE layer).
But if it is >1, we write the character in the first cell, set the width
correctly and mark all following characters as width=0.
Everything else is left unchanged, that means, the running application has
to be aware of wcwidth() and correctly send two backspaces to clear a
width=2 character and so on.
This behavior almost exactly matches the xterm behavior. There are some
corner cases like erasing only one part of a multi-cell character etc.
that might differ. However, these are non-standard cases that no
application should never rely on.
Anyway, if we spot any of these differences between xterm and kmscon, we
should fix kmscon to behave like xterm does.
Thanks to Shixin for looking this up in other emulators.
Reported-by: Shixin Zeng
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Multi-cell glyphs are glyphs that span across multiple horizontal cells.
The font renderers already support this. This patch fixes the console
renderers to take advantage of this.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of clipping every character to a one-cell boundary, we now render
multi-cell characters correctly into multiple cells.
This does not adjust the console-renderers but only the font renderers to
provide the correct glyphs.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wcwidth() is a POSIX function that returns the number of cells that a
wide-character occupies. The glibc function cannot be used as it depends
on the locale and we need _always_ UTF8 no matter what the locale is.
This implementation is provided by Markus Kuhn and is equivalent to
xterm's behavior.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>