Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
It will be replaced by the event loop signal handler.
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>
|
|
Parse command line arguments so the input subsystem recognizes the XKB
values.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
We should use the enum type instead of plain "int" to be more verbose
here.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
This fixes all compositor/output/context/etc. uses and replaces them by
the new uterm API.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
Convert the test_output test to use the new subsystems.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
The long "kmscon_" prefix is horrible so move everything to "ev_" now.
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>
|
|
Modify the buffer test to add margin tests.
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>
|
|
Add trivial test to show how to use the utf8 state machine.
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>
|
|
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>
|
|
GL_QUADS may actually be not supported on some embedded platforms so we
use GL_TRIANGLES.
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>
|
|
This is a big performance boost and reduces the code size quite a bit.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
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>
|
|
0 is actually a valid unicode value, so instead we use
KMSCON_INPUT_INVALID which is not legal unicode.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
Just some renames/moving/prefixing to conform to the style of the
other files.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
This commit introduces a new kmscon_input_event structure which is
delivered to the input consumer. The information provided is
- The evdev scancode (=physical keyboard key).
- The X keysym (a symbol representing what the typist really intended).
- The active modifiers (e.g. Shift, Control..)
- The unicode (UCS-4) value, when it makes sense.
To achieve this we add two dependencies:
- libxkbcommon (this entails xproto and kbproto, but shouldn't bring any of
big X dependencies)
- A function to translate keysyms to unicode values (taken from xlib,
copied in-tree).
libxkbcommon is not an all-around solution, and requires various degrees
of supporting code, depending on how much we wish to support. This
commit implements the common, basic uses:
- Choosing layouts, variants and options
- Switching groups
- Switching shift-levels
- Setting modifiers
Though some stuff is missing. Further information in the comments.
test_input.c is updated to use the new input event interface. You can
change the layouts in input.c:init_input() and see what works and what
doesn't.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
It should:
- Capture your keypresses
- Announce when a device is added or removed (with --enable-debug)
- stop/start capturing on SIGQUIT (Ctrl-\)
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
vte: This adds a dummy VTE subsystem. It will be used to emulate a vt100
terminal based on our console subsystem.
terminal: This ties together several subsystems including the output-, the
console- and the vte-subsystem.
The test_terminal test application can be used to test the terminal. It is
supposed to provide a full vt100 implementation which is displayed on all
available screens.
Most of the functionality here is not implemented yet and only a dummy function.
These will be added in later commits.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
We should activate the GL context on initialization to allow other subsystems to
create GL objects.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
Move the call before the wakeup and also check its return code.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
Currently, we set up our VT with SIGUSR1/2 signals and after that the user may
connect the signal handlers to the eloop. However, if we receive a signal in
between, the signal gets lost.
Therefore, this simply merges the kmscon_vt_connect_eloop function into
kmscon_vt_open as there is no obvious reason to split them.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
We must not destroy the compositor object if there is still a console using the
GL context. Otherwise we get a SEGFAULT when calling any gl* function.
In future we may need propoper dependencies here. We use reference counts so
this should be easy to implement.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
Add new fd to eloop that copies stdin to console output.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
Remove the *_set_res() function entirely. Instead, the *_resize() function now
accepts a height argument which is used as quality hint. Internally, we compute
the texture width by the selected font plus the given height. This simplifies
the API and the internal handling and improves output on non-standard
resolutions or with non-standard fonts.
Until now it was only optimized for my 16x9 output but 5x4 output was quite
garbled.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
Add kmscon_console_write() to write a character to the current position of the
cursor. The cursor is automatically moved to the next cell.
Also extend the test_console example to use this new function.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
When resizing lines we shouldn't drop all information. Instead we only
initialize new cells.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
This test app is used to stress test the buffer implementation and finding bugs
of the scrollback-buffer rotations etc.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
Add two functions to enter/leave our VT object. This allows to
implement to expected behavior of automatically switching to the kmscon
when it is running on a new tty, and switching back to the tty we came
from when the program finishes. Presumably this behavior will be
controlled by a config variable or command line argument later on (like
Xorg's -novtswitch).
There's a bit of a subtlety in this because of VT_PROCESS. We need
permission from ourselves to switch in/out of out VT; this is done when
processing SIGUSR[12] in the eloop. We therefore must dispatch the loop
at least once after switching out. The usual case is demonstrated in
test_vt.c.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
The test_console application now supports VT-switching and monitor-hotplug. New
monitors are detected when switching VTs. Full hotplug-support will be added
later.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|