We set the font size to the absolute size we have per cell instead of using a
fixed font-size.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This sets the console resolution to 800x600 on startup. We no longer have a
console with an invalid resolution after startup so we now can start calculating
font sizes properly.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Correctly set locale on startup and sleep for one second after each redraw to
reduce CPU consumption.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We must use SOURCE operator to reset the surface. Otherwise, we end up doing
nothing here because our alpha value is 0.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need to refresh the GL texture data when redrawing the console. Otherwise, we
always end up with the first frame mapped onto the GL quad object.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
When resizing a kmscon_console object we automatically create a new font because
all cached objects get invalid now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
A kmscon_font object is used to store the current font information. It allows to
draw any kind of UTF-8 string to the screen. Internally, it uses kmscon_glyph to
store glyph information for every character that has been drawn so redrawing it
is much faster.
Currently, we only support GLYPH_LAYOUT as caching method which is quite slow.
However, it supports any kind of input and always works. Better and faster
caching algorithms like cairo_scaled_font_t will be added later.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
A console has a fixed line and column count. Each entry is represented by a
kmscon_cell object. The console can be resized on the fly.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This test application prints a console on all connected outputs. It does not
emulate any terminal but instead just prints the test-console.
It can be used to test the console subsystem in connection with the DRM/KMS
output subsystem.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
A console may be displayed on multiple outputs. We allow different screen
resolutions on these outputs so we need a way to map the console image onto
different outputs.
We simply render the console image into a cairo surface with a user-given
resolution. This should be set to the highest resultion of the used outputs. The
application can now map this image onto the different framebuffers. This will
scale the image if the target framebuffer is smaller than the cairo surface.
We also do not clear the framebuffer. This should be done by the user. This
allows us to draw with alpha values and blend the console on top of the current
framebuffer. We do not have to care for background images and the application
has full control of where the console is shown.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The name of the unref function was wrong. Fix this from kmscon_con_unref to
kmscon_console_unref.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Waking up the compositor automatically refreshed the output list. Therefore,
avoid refreshing it manually again.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Every cell of the console contains one single printable character. We want to be
Unicode compatible so we must support combined characters. Hence, each cell
consists of a UTF-8 string that can be drawn by pango as a single glyph.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Add dummy files for the console subsystem. This subsystem will be used to draw a
console to a framebuffer. It uses pango and cairo for text-rendering and will
provide all required modification functions that the terminal emulation will
require.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This makefile can be used to build kmscon and the test suite. It is quite rough
and will later or sooner be replaced by a proper build-tool like autotools.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The test_output application is an example how to use the output subsystem. It
lists all connected monitors/DRM-outputs and draws with OpenGL on the selected
framebuffers.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The output subsystem manages the connected monitors, provides framebuffers and
OpenGL contexts and handles all DRM/DRI/KMS related functionality.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The kmscon application is a terminal emulator which runs on a native linux DRI
device. It uses linux KMS and DRI to get a working OpenGL context without the
need of an X-Server, Wayland or similar.
It is an attempt to replace the in-kernel VT emulator with a full userspace
console.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>