43 Commits

Author SHA1 Message Date
David Herrmann
dbb589c55b ui: add sleep/awake logic to UI
We need to forward all sleep/awake states to the lower subsystems to avoid
overdoing stuff like rendering an user-input. That is, while being asleep
we shouldn't render and/or do any other user-interaction.

This patch simply adds this logic to the UI subsystem, which, however,
does not to anything useful, yet.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-15 08:54:02 +02:00
David Herrmann
5a24d624ae terminal: add --sb-size to control scrollback buffer size
The new sb-size option specifies the size of the scrollback buffer. Use 0
to disable the scrollback-buffer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-14 17:08:55 +02:00
David Herrmann
4f7188337e main: add --dumb option to control uterm devices
The --dumb option disables hardware-accelerated rendering and instead uses
the dumb-DRM devices.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-14 16:34:28 +02:00
David Herrmann
4a034895c8 main: add font options
This adds two options --font-size and --font-name that can be used to
configure which font is used.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-14 16:29:55 +02:00
David Herrmann
227ada42a2 vte: add --palette=XY to choose color palette
This adds two more color-palettes and a mode to choose the used palette.
The "solarized" palettes are from an online project that tries to optimize
color palettes.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-14 16:08:30 +02:00
David Herrmann
1101a6b5c3 uterm: vt: move all vt.h/c code into uterm_vt.c
This merges both files so we can reduce the code overhead here. This is
still some very old code that was never correctly merged into new
uterm_vt.c subsystem. This should help doing it now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-12 09:11:35 +02:00
David Herrmann
31188d4c79 main: replace unused --seat argument with --seats
The old --seat argument was no implemented, so replace it with --seats
which accepts a list of seats where kmscon runs on. Each seat is separate
from the others but kmscon allows providing terminal services to multiple
users/seats in a single process sharing resources like fonts and
renderers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 23:42:16 +02:00
David Herrmann
f4b4bc2ee4 uterm: input: pass xkb parameters from outside
Instead of accessing the kmscon configuration from the uterm code, we
should pass it in on creation. Otherwise, uterm depends on main.c which
would be really ugly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 22:41:53 +02:00
David Herrmann
c9ccc70fcb main: move conf_global to kmscon_conf in new header main.h
The main configuration is now limited to kmscon and thus should not use
the conf_* prefix. Move all code to use the new name and introduce the new
main.h header mainly for kmscon.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 22:02:46 +02:00
David Herrmann
39be24697a conf: make config functions take conf-options as arguments
This replaces the global conf-options array with a parameter so we can use
the config parsers with different argument-lists.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 21:50:41 +02:00
David Herrmann
d51a40d090 main: add support for multiple video objects per seat
All other subsystems were updated to support multiple video objects. As
last step, the main-handler just has to forward all video objects and
correctly wake them up and put to sleep.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 14:59:16 +02:00
David Herrmann
66936a194c ui: convert API to support multiple video objects
Internally, the UI subsystem already supports multiple video objects.
However, the public API didn't expose that, yet. This changes the API to
allow adding and removing video objects from the UI.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 14:09:44 +02:00
David Herrmann
df84e9f217 text: gltex: add OpenGL text renderer
This adds an OpenGL text renderer. It uses textures to store glyph
information and renders the characters by assembling a vertex-list first.
To improve performance, we use texture-atlases.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-10 11:43:07 +02:00
David Herrmann
0fee19a8c0 text: font: Simplify font-system and add freetype2 renderer
The freetype2 renderer uses ft2 and fontconfig to provide a very
simplistic renderer. We also simplify the logic of the whole subsystem a
lot and guarantee that each glyph will have the same size now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-06 14:48:22 +02:00
David Herrmann
5517fa16bd Use new text renderer
This fixes the console and terminal layer to use the new text renderer
instead of the old one.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-01 15:41:22 +02:00
David Herrmann
741b8d33df Refactor input backend-system
This is a rewrite of the input system. The backends itself are not
modified. However, it is now possible to have multiple backends and change
them on runtime.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-21 19:06:50 +02:00
David Herrmann
dd68e97016 conf: add config-file parser
This again refactors the whole config subsystem but this should be the
last time. We now have generic parsers for booleans and strings and don't
leak any memory, anymore. Furthermore, this adds a config-file parser so
common options can now be placed into /etc/kmscon.conf or ~/.kmscon.conf.

The config files parse the same arguments as the command-line and the
command-line always has precedence even though it is parsed first.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-17 22:47:15 +02:00
David Herrmann
ffd543f41d main: use UTERM_VIDEO_DUMB as fallback when DRM is not available
If the uterm video object fails to initialize the DRM device, then we try
again with the dumb device. Only if both devices fail, we drop the device
and continue.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 14:31:50 +02:00
David Herrmann
f1326b2728 static: move statically linked subsystems to static_*
Small stuff that is not worth putting into a separate library is no moved
into the "static" library which is statically linked into all our
subsystems.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 20:35:22 +02:00
David Herrmann
0f19a8496d eloop: move to llog
Move every use of log_* to llog_* and make all objects aware of llog
objects.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 18:53:46 +02:00
David Herrmann
4fb2f85f67 main: use --fbdev options to switch between DRM/fbdev
The new --fbdev option allows runtime switching between the two backends.
That is, we only use fbdev devices when --fbdev is given. Otherwise, DRM
is used.

Technically, it would also be possible to use both. However, almost every
DRM device does also register an fbdev device for backwards compatibility.
Therefore, we must avoid using both, the DRM and fbdev device of the same
display at the same time. As this would also mean dealing with failures in
one backend and then switching to the other, we avoid this for complexity
reasons. Who needs fbdev and drm simultaneously, anyway?

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 11:01:25 +02:00
David Herrmann
148655bb7d main: do not depend on OpenGL
We currently try activating the OpenGL context when adding a video device
to a seat. However, not all video backends provide OpenGL contexts so
remove this restriction. The terminal subsystem does all this by itself
now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 10:28:40 +02:00
David Herrmann
a1b2202ccf main: start ui on each seat
We now have a video device for each seat so we only need to launch the UI
when the video device is registered.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-27 12:08:49 +02:00
David Herrmann
4f0defca3f input: remove old input subsystem
We are no longer using the old subsystem, so remove it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 14:58:53 +02:00
David Herrmann
8af8f47143 main: remove old session code
We now run a session on each registered seat so we no longer need the old
session code.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 14:39:25 +02:00
David Herrmann
7107550fd4 main: allocate one VT per seat
Each session needs a virtual terminal where it operates. Therefore,
allocate one VT per seat so we can react on events on that seat.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 14:34:46 +02:00
David Herrmann
625ae94daa main: poll video devices on hotplug
When the monitor notifies us about an hoptplug event, then we need to poll
the current video device. Otherwise, we might miss hotplugged monitors.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 13:47:23 +02:00
David Herrmann
3ac89ed33f main: add input device to each seat
Each seat now collects all input devices that are associated to that seat.
When multi-session support is added, then we can even share them between
the sessions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 13:44:36 +02:00
David Herrmann
42de147268 main: collect one DRM device per seat
We need a single graphics card on a seat to run kmscon. Therefore, wait
for the first DRM device that appears and make it the current graphics
device for the seat. We do not support multiple graphics cards per seat
but this may be added in the future.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 13:38:23 +02:00
David Herrmann
589b5ce9e3 main: create vt master object
When running multiple sessions on multiple seats, we need to allocate
multiple VTs, too. Therefore, we now create a VT master connection in the
main application which we can later use to allocate new VTs for each
session.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 13:16:23 +02:00
David Herrmann
477542b2ba main: listen for new seats
Allocate new seat objects when a new seat occurs and remove them when a
seat goes away.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 13:14:20 +02:00
David Herrmann
4c85801975 main: use uterm_monitor objects
Create a global uterm_monitor object to monitor the system for new seats
and devices.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 13:02:05 +02:00
David Herrmann
d1be1d60fa uterm_video: remove hotplug awareness
To introduce the new uterm-monitor object we need to remove all the udev
handling from uterm_video. To not break "git bisect" we now remove all the
udev code from uterm_video and uterm_video_drm and make kmscon use the
static /dev/dri/card0 interface for now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 17:39:46 +02:00
David Herrmann
7e9a31aa4e uterm_video: allow explicitely activating GL ctx
We may have to use multiple GL contexts if we mix DRM and fbdev devices.
Therefore, we need explicit GL-ctx management.
We now allow to explicitely activate a specific GL context. This means,
the user needs to use the right GL context before he creates textures or
similar.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-25 17:35:03 +02:00
David Herrmann
9a2e025475 eloop: wait for all childs
Move child-waiting into the eloop subsystem so all childs are always
correctly freed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 19:02:23 +02:00
David Herrmann
f545d9641a main: use new shared signals
Use the shared signal-implementation instead of the generic signals.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 17:44:58 +02:00
David Herrmann
813e5655e0 main: wait for child processes
Add SIGCHLD handler and wait for exiting child processes to avoid zombies.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 16:44:33 +01:00
David Herrmann
ead3172d49 main: use ui subsystem
Use the new UI subsystem in the main application. The kmscon application
provides now the same functionality as the test_terminal application.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 15:44:36 +01:00
David Herrmann
e35ca87a95 conf: add --silent
Suppress debug, info, notice and warning messages if --silent is given.
This is overwritten by --debug and --verbose.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-23 18:38:24 +01:00
David Herrmann
929860217f main: print strerror() on failure
Print error-string if we cannot initialize kmscon.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-23 18:33:08 +01:00
David Herrmann
8e54ea1f65 main: add proper main application
This is not finished and only implements the basic VT handling +
application initialization.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-23 18:29:21 +01:00
David Herrmann
0d1acc526f Change license to MIT license
Further commits will need a Signed-off-by line, otherwise I cannot accept them.
MIT license is compatible with GPL so we still can switch to GPL in the future
if we want.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2011-12-02 13:23:22 +01:00
Ran Benita
6d451a2015 build: use gnu autotools
This commit adds basic autoconf + automake files to build the project.
It also adds a main.c stub in order to simulate the main binary.

The configure script uses pkg-config to find the libraries. The usual
stuff should work. The only additional option right now is:
        ./configure --enable-debug [To enable debugging symbols]
The Makefile should also support the standard stuff:
        make [To build the kmscon binary]
        make check [To build the test_* binaries]
        make dist [To create a tarball]
        make clean
        make install
        etc.

To start from a clean tree (e.g. git clean -dfx), do something like the
following:
        ./autogen.sh
        ./configure --enable-debug CFLAGS=-O0
        make

It all should work well enough for now.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2011-12-01 16:21:37 +01:00