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>
GL_BGRA_EXT as internal format is not supported with full OpenGL so we
must use GL_RGBA as internal format.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
These dispatch debug messages are currently no longer needed and just
fill the log needlessly.
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>
This commit adds a new pty object.
The pty object takes care of all pseudo terminal handling, reading and
writing. It can be opened and closed, and notify through callbacks when
input arrives or the child process exits/dies. It can also receive input
and pass it along to the child process.
There is not yet any real VTE processing, so we display raw escape
codes and so on. However, this should provide immediate feedback for
any further vte development, as we start to act like a real terminal
emulator.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit ports the XKB handling to the new kbd interface, and makes
the input subsystem use it without any direct knowledge of XKB.
Some code is moved around but there are no functional changes.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This defines the API the keyboard backends will need to implement. It is
based on what's in input_xkb.h but cleaned up and simplified.
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>
OpenGL pulls in lot of X dependencies on linux. To avoid this we also
support OpenGLES2 now. This will also allow to run kmscon on
embedded/mobile platforms.
We still get X dependencies through EGL which we cannot avoid as EGL is
compiled with multiple backends on most systems. However, switching to
GLES2 reduces memory footprint by 30MB which is pretty good.
This also enables GLES2 as default in autogen.sh. However, default
behaviour of configure will still be GL.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We should first create a GL context before we try to find GL functions
to avoid errors on some platforms.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We should use the context of the compositor instead of directly calling
the GL functions to avoid direct dependencies.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We have no use for Control_L or Alt_R by themselves, the information is
in the "mods" field.
Signed-off-by: Ran Benita <ran234@gmail.com>
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>
We use a 4x4 matrix so we should use the correct uniform handler.
Otherwise we might get errors on some GL implementations.
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>
Besides the texture shader this also adds a second shader (def/default)
which is used to draw arbitrary colored vertices to the screen.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Allow other subsystems to retrieve the context of a compositor. The
context has no reference count as it is tied to the compositor.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
To avoid the fixed function pipeline we should use shaders instead of
old glBegin/glEnd. This patch adds two basic shaders and functions that
load and initialize them.
To avoid loading the shaders at runtime we generate a source file which
contains them as strings so they are embedded in the binary.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This splits off all EGL/GL calls into output_context.c. This way we can
replace the backend of the drawing functions very easily.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
There is no need to retrieve the fd of the compositor as we now have an
eloop subsystem which takes care of event handling.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
These are the only open() calls missing the flag.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This makes things easier in the common case of
<some error> -> <log error> -> <goto error handler> - <do something with
errno>
Signed-off-by: Ran Benita <ran234@gmail.com>
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>
Move all documentation into EXTRA_DIST, otherwise it gets installed systemwide.
And probably no one is interested in having the README installed in the system.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>