This still uses the old VT API which now fails as we added a new
parameter. As a side-effect, this test will not work if used on a VT-less
system or on a seat without VTs. But we actually don't care, yet, as any
other VT-replacement isn't really production-ready, yet.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
When opengl rendering is not available on the target device, we now fall
back to software rendering. Instead of drawing a nice gradient we now draw
a white screen to the target device to avoid heavy calculations.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Since we moved to a runtime backend system for the input subsystem, we
cannot access the internal keysym_to_string() helpers anymore. Hence, use
the recently introduced uterm-input forwarding helper.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Print keysym even if we have a UCS4 representation. This makes debugging
keyboard issues much easier. Also increase buffer size to 32 as there are
many symbols longer than 16 characters.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Both dumb and xkb don't actually need the kbd_dev for that. The dumb
backend already omits the "dev".
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We now support multiple GL contexts in uterm so we need to explicitely
enable them before using them.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Use new uterm_video constructor. This requires hard-coding the DRM card
but this is needed until we use the uterm_monitor interface.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This test doesn't compile and is no longer needed. We can now use the
kmscon program or test_terminal for the same functionality.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of accepting a list of outputs we now enable all outputs when
testing the video subsystem.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The new eloop implementation allows to run the eloop for a fixed amount of
time. Use this instead of sleeping for 5s which would prevent us from
catching signals as the eloop blocks them in favor of signalfd.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The test_include.h header now provides the basic initialization that will
later be used in all other tests. This allows us to use the same
program-parameters that kmscon uses and makes sure everything is
initialized properly before we run the tests.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
A symbol table should never be created twice therefore we can make it
static and global. We add locks so it is totally thread-safe, too.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
config.h is meant to be around in all files, as it contains stuff like
_GNU_SOURCE, NDEBUG and HAVE_*.
Make these definitions available without needing to #include config.h
every single time.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This function is no longer needed as we now have proper scrolling
functions. This also adjusts the buffer tests to be more appropriate.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We do no rotation so rename the function to the more appropriate name
kmscon_console_newline.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Make the vte subsystem handle the keyboard input instead of doing this
inside of test_terminal.
The handling is just a stub function. No actual keys are parsed yet.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
There is no reason to pass the eloop reference late at terminal/pty
open. If we pass it early on object creation we will always have a valid
reference and can remove several code paths.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
log_warn is much shorter and we already use log_err instead of log_error
so this is more consistent now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Unfortunately, there is no clean way I see to hook this up from the pty
object. We can (and will) have more than one pty object opened at a
time, but the semantics of signalfd make it impossible to deliver each
SIGCHLD to its rightful owner without complicating things.
[ From what I tested:
- If you have two signalfd's listening to the same signal, they will be
dispatched in some round-robin manner.
- Also, if more than one child exits before we read signalfd (possibly
beloging to different terminals), they will be compressed to one
event. ]
We therefore need to do the reaping from a central location, and need to
remember to copy this snippet over to main.c in the future.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Add a new terminal_open/terminal_close methods to correspond to the pty
ones, and notify when the terminal is closed.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We now properly draw fonts with OpenGL. We now use FreeType2 instead of
pango to avoid big dependencies.
We also add a DejaVu font so we currently don't have to deal with font
selection.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
To avoid cairo dependencies we now take a compositor reference in the
font backend so fonts can be drawn with GL textures instead of cairo.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of drawing with fixed-function GL pipeline we now use our own
shader for texture drawing. This also fixes test_console to no longer
depend on GL.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
To switch to the new drawing subsystem we need a reference to a valid
compositor object so we can retrieve the GL context.
This also applies to the terminal object.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This converts the output test function to use the new kmscon_context for
drawing operations so we no longer depend directly on GL.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Here's how it goes:
1. stdin reaches EOF, kmscon_eloop_rm_fd is called on stdin_fd.
2. The fd object is freed, the memory is reused in the meantime.
3. rm_fd is called again in destroy_eloop.
4. con->stdin_fd points to garbage and we get a segmentation fault.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We use a new font factory which is used to create a new font. It will later also
be used to cache fonts and select proper system fonts.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Add input subsystem to terminal test app. This currently allows to actually
"write" to the console. There is still much to do to convert the input to proper
data but basic alphanumeric characters work for now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Just a direct mapping to X modifiers for now (= Shift, Control,
Lock, Mod1-5).
This gives us more flexibility to adapt it to our needs in the future.
Also we don't have to include libxkbcommon headers just for the modifier
definitions.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>