platform/upstream/kmscon.git
12 years agowlt: add some --font-* options
David Herrmann [Thu, 27 Sep 2012 10:36:10 +0000 (12:36 +0200)]
wlt: add some --font-* options

Copy the options from kmscon which are font-* engine, size, dpi and name.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: screen: fix cleaning buffers on resize
David Herrmann [Thu, 27 Sep 2012 10:26:30 +0000 (12:26 +0200)]
tsm: screen: fix cleaning buffers on resize

There is some nasty bug where we do not correctly clean buffers when
resizing. So we now clear the whole offscreen region on resize to go sure
everything is clean.

Note that cells can pretty much move everywhere during their
offscreen-life so this is a quite sophisticated task to keep track which
cells are clean and which not. Therefore, simply clean all of them when
taking them on-screen.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: unicode: fix accessing symbol-array out of bounds
David Herrmann [Thu, 27 Sep 2012 10:13:18 +0000 (12:13 +0200)]
tsm: unicode: fix accessing symbol-array out of bounds

The array type used to be from glib which did that check automatically. We
now have to check explicitely that we do not access it out-of-bounds.

This fixes a nasty resizing-bug of TSM.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: unicode: fix not recreating the default-table all the time
David Herrmann [Thu, 27 Sep 2012 10:11:52 +0000 (12:11 +0200)]
tsm: unicode: fix not recreating the default-table all the time

We actually created a new table all the time which led to huge memory
leaks. We now actually use the default table if it is available.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agowlt: toolkit: fix use after free of dp_fd
David Herrmann [Thu, 27 Sep 2012 09:34:15 +0000 (11:34 +0200)]
wlt: toolkit: fix use after free of dp_fd

We need to keep dp_fd alive for all calls to wl_display_*(). Otherwise,
the callback will use it and access invalid memory.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agowlt: toolkit: fix sending two surface.attach() reqs in one frame
David Herrmann [Thu, 27 Sep 2012 08:45:20 +0000 (10:45 +0200)]
wlt: toolkit: fix sending two surface.attach() reqs in one frame

The need_frame and idle_frame logic was slightly wrong. We ended up not
correctly requesting the frame-cb after a _real_ frame-cb. Hence, the
idle-cb did simply send the next attach() request.

This fixes this small race and adds a comment how all this is supposed to
work.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agowlt: main: increase default window size to 600x400
David Herrmann [Wed, 26 Sep 2012 22:45:32 +0000 (00:45 +0200)]
wlt: main: increase default window size to 600x400

Current default size is pretty small and there are still some resizing
bugs so increase it to have a working terminal.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agowlt: terminal: handle keyboard events
David Herrmann [Wed, 26 Sep 2012 22:45:05 +0000 (00:45 +0200)]
wlt: terminal: handle keyboard events

Pass keyboard events straight through to the TSM handler.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agowlt: toolkit: add keyboard events
David Herrmann [Wed, 26 Sep 2012 22:43:23 +0000 (00:43 +0200)]
wlt: toolkit: add keyboard events

This implements the wl_keyboard client-side of the wayland protocol and
takes care of pushing keyboard events to the correct window.

A new callback is added to all widgets which is called when keyboard input
is sent to the specific window.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agowlt: terminal: draw terminal to buffers during redraw-cb
David Herrmann [Wed, 26 Sep 2012 21:48:35 +0000 (23:48 +0200)]
wlt: terminal: draw terminal to buffers during redraw-cb

Use the font subsystem to blit the console glyphs to the wlterm window
during redraw-callbacks.

This is mostly copied from src/terminal.c and the blitting functions from
uterm-fbdev.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agowlt: load font modules during startup
David Herrmann [Wed, 26 Sep 2012 21:47:12 +0000 (23:47 +0200)]
wlt: load font modules during startup

We need the text-font modules to render fonts in wlterm. Therefore, load
all the font modules during startup before initializing the application.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agowlterm: add hard-dependency to xkbcommon
David Herrmann [Wed, 26 Sep 2012 21:45:02 +0000 (23:45 +0200)]
wlterm: add hard-dependency to xkbcommon

wlterm needs xkbcommon as the wayland protocol depends on XKB states.
Hence, we add a hard-dependency for wlterm.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agopty: remove useless debug message
David Herrmann [Wed, 26 Sep 2012 20:45:38 +0000 (22:45 +0200)]
pty: remove useless debug message

Remote pty debug message about resizing.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: add helpers to (un)load all modules at once
David Herrmann [Wed, 26 Sep 2012 20:00:01 +0000 (22:00 +0200)]
text: add helpers to (un)load all modules at once

Instead of doing all this in main() we now use the two helpers. This makes
the code much more readable and avoids too many stuff in main().

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agobuild: build text_font subsystem as separate static library
David Herrmann [Wed, 26 Sep 2012 19:54:37 +0000 (21:54 +0200)]
build: build text_font subsystem as separate static library

We want to use the font-rendering layer in wlterm so we need to split this
out. Gladly, the layer has only a build-time dependency on uterm and not
other hard-coded stuff. That is, we have no cleanup to do.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agowlt: terminal: add TSM and PTY objects
David Herrmann [Wed, 26 Sep 2012 19:39:15 +0000 (21:39 +0200)]
wlt: terminal: add TSM and PTY objects

Create TSM screens and VTE objects plus a PTY and connect everything so we
have a working terminal. Keyboard input still needs to be hooked up and
the drawing functions aren't implemented, yet.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agowlt: toolkit: add wlt_window_get_eloop() helper
David Herrmann [Wed, 26 Sep 2012 19:38:00 +0000 (21:38 +0200)]
wlt: toolkit: add wlt_window_get_eloop() helper

This helper allows widgets to retrieve the eloop that is used by the
window. Otherwise, we couldn't dispatch events there.
No refcounting is needed as all widgets are destroyed before the window is
destroyed. Other users need to perform ref-counting by themself.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agopty: set argv via helper function
David Herrmann [Wed, 26 Sep 2012 19:24:34 +0000 (21:24 +0200)]
pty: set argv via helper function

This makes the pty layer independent of kmscon global state. This allows
us to use it in other applications bundled with kmscon. There is still
some work to do to make it fully independent so we can integrate it into
TSM. But that's not really needed, yet.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agopty: set "TERM" via helper function instead of kmscon_conf
David Herrmann [Wed, 26 Sep 2012 17:25:35 +0000 (19:25 +0200)]
pty: set "TERM" via helper function instead of kmscon_conf

Instead of accessing global state, we now set the TERM value via a helper
function. This is needed to make the pty layer independent of kmscon.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agowlt: theme: fix calculating window size regarding buttons
David Herrmann [Wed, 26 Sep 2012 17:12:16 +0000 (19:12 +0200)]
wlt: theme: fix calculating window size regarding buttons

We need to avoid reducing window size beyond our minimal width used to
draw buttons.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agobuild: update autotools logic and add "wlterm" application
David Herrmann [Wed, 26 Sep 2012 16:56:41 +0000 (18:56 +0200)]
build: update autotools logic and add "wlterm" application

Sorry for the big commit, but I was working on the wlterm application and
then thought I can rework the whole configure-logic again. This mainly
renames all build-defines to BUILD_DEFINE_* and BUILD_HAVE_* and allows
specifying which applications to build via --enable-kmscon/--enable-wlterm
and similar.

wlterm is a new application which is a native wayland client with no
external dependencies. It serves several purposes:
  * It uses TSM (not yet implemented, but will come soon) to create a
    console independent from kmscon. This shows how TSM can easily be used
    to create independent terminal emulators.
  * It is a native wayland application (probably the first independent
    wayland app so far?) and is used to test how well the wayland API
    works. As wayland is still under heavy development, we need more
    application-writers who report back whether the wayland-API makes
    sense to them and whether it works correctly.
  * A proper terminal-emulator for wayland! There is currently no proper
    emulator so we really need something that we can work with.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoconf: remove uterm depedency
David Herrmann [Mon, 24 Sep 2012 19:57:23 +0000 (21:57 +0200)]
conf: remove uterm depedency

We move the GRAB type into kmscon-main.c to avoid any uterm dependency in
the conf subsystem. It is still open how we can better handle the
key-parser without a valid uterm_input object, but when there will be a
xkbcommon release, we can hopefully add a hard depedency to it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agomain: pick up non-FBDEV_DRM devices without --fbdev
David Herrmann [Fri, 21 Sep 2012 12:31:27 +0000 (14:31 +0200)]
main: pick up non-FBDEV_DRM devices without --fbdev

Now that we can differentiate between fbdev-DRM and normal fbdev devices,
we can just pick up the normal fbdev devices by default.

--fbdev now makes kmscon use the FBDEV_DRM devices instead of pure DRM.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: monitor: mark DRM-fbdev devices as such
David Herrmann [Fri, 21 Sep 2012 12:25:10 +0000 (14:25 +0200)]
uterm: monitor: mark DRM-fbdev devices as such

Most DRM drivers also provide a legacy fbdev device so fbcon can pick it
up (and more importantly, we get kernel panics on it). However, as an
application developer, I don't want to use two devices which drive the
same physical hardware.

This marks all such DRM fbdev devices as FBDEV_DRM so kmscon doesn't pick
them up automatically.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: video: ignore NULL buffers in vector requests
David Herrmann [Fri, 21 Sep 2012 11:20:21 +0000 (13:20 +0200)]
uterm: video: ignore NULL buffers in vector requests

When multiple requests are pushed into the video backends at once, we
should ignore NULL buffers. Otherwise, users might have to re-order
buffers just so we don't segfault. Instead, we now ignore them and the
application can set requests to NULL to signal us that it is unused.

This fixes some bugs with multi-monitor setups and kmscon.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: video: fbdev: disable double buffering
David Herrmann [Fri, 21 Sep 2012 11:17:43 +0000 (13:17 +0200)]
uterm: video: fbdev: disable double buffering

Kernel fbdev drivers are really broken in respect to virtual framebuffer
sizes. They all report success when allocating and even mmap()'ing them
but memory access will result in SIGBUS or even SIGSEGV.

Therefore, we disable it by default now. We might consider re-enabling it,
but there is really no need to work too much on fbdev backends.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotest_key: add small helper for client-side key-input
David Herrmann [Thu, 20 Sep 2012 11:16:32 +0000 (13:16 +0200)]
test_key: add small helper for client-side key-input

We sometimes need to test what keys a client receives when specific keys
are pressed. This small helper simply runs in a terminal and receives raw
keyboard input and prints it to stdout with debugging information.

This can definitely be improved with the help of the TSM state-machine to
print more useful information and directly parse the input. However, this
is better than nothing.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agopty: set VERASE character to backspace during setup
David Herrmann [Wed, 19 Sep 2012 19:13:48 +0000 (21:13 +0200)]
pty: set VERASE character to backspace during setup

Some crazy guy decided to set VERASE to DEL by default in the kernel. So
when starting an application which does not initialize the terminal on
startup, they may not notice that we actually send BACKSPACE as
erase-character (like /bin/login). Therefore, initialize VERASE to 010 so
everyone is happy.

Thanks to Etam for reporting this!

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: vte: send original VT220 escape codes for Shift+F1 to F12
David Herrmann [Wed, 19 Sep 2012 18:27:48 +0000 (20:27 +0200)]
tsm: vte: send original VT220 escape codes for Shift+F1 to F12

Nearly all terminals behave differently regarding Shift+FX keys. We now
mimic the behavior of the classic VT220 instead of the new-style function
keys. Nearly all applications expect the old codes.

This might be changed in the future, though. It does make much more sense
to send the new codes as they provide more information to the application.
And remappings should be done via XKB instead of inside of kmscon.
However, as long as xkbcommon does not have a config-file, we will be
stuck with this little hack.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agodocs: add systemd kmscon unit
David Herrmann [Tue, 18 Sep 2012 18:41:55 +0000 (20:41 +0200)]
docs: add systemd kmscon unit

This is a very basic unit that can start kmscon with a login shell. We may
have to improve it to replace agetty/etc fully, but it is a good start.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agopty: remove public eloop dependency
David Herrmann [Tue, 18 Sep 2012 17:22:09 +0000 (19:22 +0200)]
pty: remove public eloop dependency

We now create an eloop object internally to avoid requiring public eloop
headers. Functionality is still the same but now hidden in the library.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: vte: convert to use llog
David Herrmann [Tue, 18 Sep 2012 17:21:28 +0000 (19:21 +0200)]
tsm: vte: convert to use llog

Instead of using kmscon log_* functions, we now use the independent llog
subsystem.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agobuild: make libtsm build separately
David Herrmann [Tue, 18 Sep 2012 15:58:35 +0000 (17:58 +0200)]
build: make libtsm build separately

This builds libtsm as separate library so we can use it in other projects,
too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: vte: introduce own modifiers
David Herrmann [Tue, 18 Sep 2012 15:36:29 +0000 (17:36 +0200)]
tsm: vte: introduce own modifiers

We do not want to depend on uterm just for the modifiers so introduce new
modifier-names which are in-sync with the UTERM names.

Inside of kmscon we still use the UTERM names everywhere, but inside of
TSM we now rely on the new names.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: vte: remove unused keyboard-action enum
David Herrmann [Tue, 18 Sep 2012 15:34:55 +0000 (17:34 +0200)]
tsm: vte: remove unused keyboard-action enum

This enum is no longer used to remove it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: add *_set_palette() helper
David Herrmann [Tue, 18 Sep 2012 15:25:34 +0000 (17:25 +0200)]
tsm: add *_set_palette() helper

Instead of accessing kmscon-state we now add a helper to select the
palette and make the terminal-subsystem use it on initialization.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: vte: rename kmscon_vte object to tsm_vte
David Herrmann [Tue, 18 Sep 2012 14:59:39 +0000 (16:59 +0200)]
tsm: vte: rename kmscon_vte object to tsm_vte

Perform final rename of the remaining vte objects.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: rename files
David Herrmann [Tue, 18 Sep 2012 14:54:25 +0000 (16:54 +0200)]
tsm: rename files

Rename all TSM files to have a tsm_* prefix.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: vte: move vte layer to tsm_vte_*
David Herrmann [Tue, 18 Sep 2012 14:37:17 +0000 (16:37 +0200)]
tsm: vte: move vte layer to tsm_vte_*

This pushes the whole VTE layer into TSM and performs the huge rename
which turned out to be quite easy to accomplish.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoterminal: drain timer after wakeup
David Herrmann [Tue, 18 Sep 2012 14:24:48 +0000 (16:24 +0200)]
terminal: drain timer after wakeup

Use the new timer_drain() helper to reset the timer after waking up.
Otherwise, we get spurious warnings that the CPU is too slow.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoeloop: add ev_timer_drain() helper
David Herrmann [Tue, 18 Sep 2012 14:24:06 +0000 (16:24 +0200)]
eloop: add ev_timer_drain() helper

This helper reads the current expiration-count from a timer. This can be
used when waking up from an idle-period or similar to reset the timer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: screen: switch to llog
David Herrmann [Tue, 18 Sep 2012 14:04:03 +0000 (16:04 +0200)]
tsm: screen: switch to llog

We already have an llog context so use it instead of relying on kmscon-log
subsystem. TSM-screen is now fully independent. Next step is TSM-vte.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: screen: introduce TSM_SCREEN_OPT_RENDER_TIMING
David Herrmann [Tue, 18 Sep 2012 13:58:54 +0000 (15:58 +0200)]
tsm: screen: introduce TSM_SCREEN_OPT_RENDER_TIMING

Instead of accessing kmscon state from TSM, we now introduce options to
control the behavior of TSM-screens. Apart from logging, TSM is now
independent of any kmscon state/code.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: screen: add screen-options helpers
David Herrmann [Tue, 18 Sep 2012 13:54:31 +0000 (15:54 +0200)]
tsm: screen: add screen-options helpers

Allow setting global options for screen objects. These are different from
flags as the latter affects the state-machine but options affect global
operation modes.

Options should be set by the application while flags are set by the VTE
handler. The latter might change often, while options should be set on
startup and then remain mainly constant.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agobuild: fix build without uterm-keysyms.h
David Herrmann [Tue, 18 Sep 2012 13:53:07 +0000 (15:53 +0200)]
build: fix build without uterm-keysyms.h

uterm-keysyms.h is no longer available but the makefile still references
it. Remove all occurrences of it to fix build again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: add tsm_log_t llog-compatible log object
David Herrmann [Tue, 18 Sep 2012 13:01:45 +0000 (15:01 +0200)]
tsm: add tsm_log_t llog-compatible log object

We need to avoid logging to stderr directly in TSM so introduce the
tsm_log_t object similar to eloop.h.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: screen: move filenames to tsm_screen.[ch]
David Herrmann [Tue, 18 Sep 2012 12:53:46 +0000 (14:53 +0200)]
tsm: screen: move filenames to tsm_screen.[ch]

All TSM files use the "tsm_*" prefix and the object is now named "screen"
so rename the files to resemble this.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: fix header comments
David Herrmann [Tue, 18 Sep 2012 12:50:02 +0000 (14:50 +0200)]
tsm: fix header comments

Remove "kmscon" from any TSM headers and replace it by "tsm".

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoconsole: rename prefix to tsm_screen_*
David Herrmann [Tue, 18 Sep 2012 12:12:38 +0000 (14:12 +0200)]
console: rename prefix to tsm_screen_*

This is part of the TSM library creation. We also rename "console" to
"screen" as this layer actually manages the screen.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: unicode: remove tsm_symbol_get_u8()
David Herrmann [Tue, 18 Sep 2012 11:49:11 +0000 (13:49 +0200)]
tsm: unicode: remove tsm_symbol_get_u8()

This is no longer used. You should first retrieve the UCS4 string and then
use the UCS4 to U8 conversion helpers instead.

All users have already been converted so we can remove this helper safely.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoterminal: don't include tsm_unicode.h
David Herrmann [Tue, 18 Sep 2012 11:47:19 +0000 (13:47 +0200)]
terminal: don't include tsm_unicode.h

This is not needed. And we want to avoid any dependencies to this layer
wherever possible.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: pass symbol-data directly into text layer
David Herrmann [Tue, 18 Sep 2012 11:42:22 +0000 (13:42 +0200)]
text: pass symbol-data directly into text layer

Instead of converting symbols into UCS4 string in each backend, we now
pass the whole data from the console layer into the renderers.

This makes all renderers indepedent of any recently introduced
symbol-tables and they can be implemented inside of TSM without exporting
them. However, we still need to pass the IDs to the text layer. The text
layer must not use them for anything but identification. Moreover, it must
never assume that they are valid tsm_symbol_t values.
We do this so the backends can still have fast hashtable lookups rather
than allocating big keys containing the UCS4 string+length and using these
for lookups.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: unicode: add helper for ucs4->u8 string conversions
David Herrmann [Tue, 18 Sep 2012 11:41:17 +0000 (13:41 +0200)]
tsm: unicode: add helper for ucs4->u8 string conversions

This small helper allocates a string big enough to hold the whole u8
string. This should be used for short and temporary strings only! It
allocates way to much memory for bigger or long-living strings.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agobuild: make xkbcommon built-time dependency
David Herrmann [Tue, 18 Sep 2012 10:25:12 +0000 (12:25 +0200)]
build: make xkbcommon built-time dependency

We really need xkbcommon-keysyms.h for building kmscon/uterm/TSM/etc.
However, the recent fix was ugly and didn't really help. Instead we copy
the keysyms file into external/xkbcommon/ so we can just include the real
xkbcommon files from any source but have a fallback in external/.

Hence, you can still build kmscon without xkbcommon with this fallback,
but this will be removed the first day when xkbcommon sees a public
release.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: unicode: fix error-path in tsm_symbol_append()
David Herrmann [Tue, 18 Sep 2012 10:17:41 +0000 (12:17 +0200)]
tsm: unicode: fix error-path in tsm_symbol_append()

We never checked the memory helpers for errors because they used to be
from glib. However, with our own helpers we need to check for errors to be
sure.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoshl: hashtable: add shl_hashtable_remove() helper
David Herrmann [Tue, 18 Sep 2012 10:14:53 +0000 (12:14 +0200)]
shl: hashtable: add shl_hashtable_remove() helper

This adds a helper that removes entries from a hashtable. This hasn't been
needed, yet, so we never provided it. However, the new unicode-helpers
will need it for proper error recovery.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: unicode: add symbol-table helpers
David Herrmann [Tue, 18 Sep 2012 10:03:17 +0000 (12:03 +0200)]
tsm: unicode: add symbol-table helpers

Add three helpers to create and manage symbol-tables. Also fix internal
default-table to use them.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: unicode: merge tsm_symbol_get() into table__get()
David Herrmann [Tue, 18 Sep 2012 09:48:02 +0000 (11:48 +0200)]
tsm: unicode: merge tsm_symbol_get() into table__get()

We do not do locking in tsm anymore so we can remove the table__get()
helper.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: unicode: export tsm_ucs4_to_utf8()
David Herrmann [Tue, 18 Sep 2012 09:37:59 +0000 (11:37 +0200)]
tsm: unicode: export tsm_ucs4_to_utf8()

This helper function may be useful to other external code and allows us to
always return UCS4 strings. Other code can then use this helper to convert
it into UTF8.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: unicode: add symbol-table contexts
David Herrmann [Tue, 18 Sep 2012 09:30:38 +0000 (11:30 +0200)]
tsm: unicode: add symbol-table contexts

We should avoid any global state in shared libraries. As the TSM code is
becoming a shared library, we definitely need contexts for symbol tables.
However, we don't want to fix up all code now so we use a default table
NULL instead.

This can be fixed later but is ok for now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: unicode: remove log_* calls
David Herrmann [Tue, 18 Sep 2012 09:04:50 +0000 (11:04 +0200)]
tsm: unicode: remove log_* calls

The logging-layer is not a dependency of TSM so we cannot use it. It is
also not needed anymore, as the unicode-layer is working pretty well.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotsm: move unicode.[ch] to tsm_unicode.[ch]
David Herrmann [Tue, 18 Sep 2012 08:54:06 +0000 (10:54 +0200)]
tsm: move unicode.[ch] to tsm_unicode.[ch]

All TSM related files will get the tsm_* prefix so move unicode headers
and sources.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agobuild: move all remaining static_* files to kmscon-core/uterm
David Herrmann [Tue, 18 Sep 2012 08:45:53 +0000 (10:45 +0200)]
build: move all remaining static_* files to kmscon-core/uterm

There is absolutely no need to use kmscon-static anymore so move it into
kmscon-core/uterm as it is used by kmscon-core and libuterm exclusively.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoshl: move kmscon_hook_* to shl
David Herrmann [Tue, 18 Sep 2012 08:36:37 +0000 (10:36 +0200)]
shl: move kmscon_hook_* to shl

This is the last static helper that is moved so as a next step we should
get rid of the "static" library entirely.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agomain: change default font size to 12
David Herrmann [Tue, 18 Sep 2012 07:54:08 +0000 (09:54 +0200)]
main: change default font size to 12

We changed the PPI value to 96 so the default font size looks abnormally
large now. Reset it to the previous value of 12 so it is more "normal".

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agomain: add --font-dpi option
David Herrmann [Tue, 18 Sep 2012 07:50:52 +0000 (09:50 +0200)]
main: add --font-dpi option

This adds a new option to force a global PPI for all fonts. This overrides
per monitor PPI values.
This is useful if monitors do not provide correct PPI values and we want
the same behavior as all other X11 apps (which is 96 PPI forced).

Internally we speak of "Pixels per Inch" as this is more correct. However,
to not confuse users we use the more common term "Dots per Inch".

This also changes the default PPI value from 72 to 96. 96 is the de-facto
default value on linux so we should use it, too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agovte: implement Shift+F4-F20
David Herrmann [Tue, 18 Sep 2012 07:44:27 +0000 (09:44 +0200)]
vte: implement Shift+F4-F20

If Shift is hold while F4 to F20 is pressed, a second parameter is added
to the sent CSI sequence. Implement this according to all other major
terminal emulators. This is no official DEC feature, though.

Thanks to "Etam" for reporting this!

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agovte: fix OSC parser to stop on BEL characters
David Herrmann [Tue, 18 Sep 2012 07:20:31 +0000 (09:20 +0200)]
vte: fix OSC parser to stop on BEL characters

No DEC-VT-manual seems to describe this feature, however, nearly all
terminal emulators stop parsing OSC strings when receiving a BEL
character. So add this to the normal ST character to terminate OSC
strings.

Many thanks to Ran Benita for reporting and investigating into this.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoshl: move llog to shl
David Herrmann [Tue, 18 Sep 2012 07:18:50 +0000 (09:18 +0200)]
shl: move llog to shl

We might argue whether llog should be kept separate, however, shl is a
loose pile of headers and sources so pushing llog into it seems
reasonable.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agovte: send escape sequence when ALT key is held
David Herrmann [Sun, 16 Sep 2012 15:30:03 +0000 (17:30 +0200)]
vte: send escape sequence when ALT key is held

XTerm's altSendsEscape resource controls whether an escape character is
prepended to any output that is generated by keyboard input. We enable it
by default now.

Keyboard handling becomes kind of ugly now in the VTE layer. We should
definitely change this into some kind of lookup table or a more
sophisticated switch() handler in vte_input.c or similar.

Thanks to Tobias Wolf, "Etam" and Ran Benita for reporting this to the
bug-tracker and figuring out how this is correctly handled.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoshl: move timer to shl_timer_*
David Herrmann [Sun, 16 Sep 2012 15:08:21 +0000 (17:08 +0200)]
shl: move timer to shl_timer_*

This moves the timers to SHL and removes the old static_misc header and
source. They are no longer needed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoshl: move kmscon_ring_* to shl
David Herrmann [Sun, 16 Sep 2012 07:23:35 +0000 (09:23 +0200)]
shl: move kmscon_ring_* to shl

The ring implementation is only used in one place so move it into SHL to
avoid linking it into all other libraries and applications.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoshl: move kmscon_hashtable to shl
David Herrmann [Sun, 16 Sep 2012 07:13:30 +0000 (09:13 +0200)]
shl: move kmscon_hashtable to shl

This moves the whole hashtable implementation into the SHL library. Now we
can link it only to the applications that really use it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoshl: move kmscon_array_* to shl_array_*
David Herrmann [Sun, 16 Sep 2012 06:51:26 +0000 (08:51 +0200)]
shl: move kmscon_array_* to shl_array_*

This moves all array code into the SHL library and fixes all users.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoshl: move dlist to shl_dlist.h
David Herrmann [Sat, 15 Sep 2012 17:48:38 +0000 (19:48 +0200)]
shl: move dlist to shl_dlist.h

Instead of including dlist in the static library, we now move it to SHL.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoshl: move dlist implementation to shl_dlist_*
David Herrmann [Sat, 15 Sep 2012 17:10:37 +0000 (19:10 +0200)]
shl: move dlist implementation to shl_dlist_*

Shl (Static helper library) is the new name of all static helpers in
kmscon that might be shared between different applications.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agounicode: move KMSCON_UCS4_MAXLEN to TSM_UCS4_MAXLEN
David Herrmann [Fri, 14 Sep 2012 16:31:18 +0000 (18:31 +0200)]
unicode: move KMSCON_UCS4_MAXLEN to TSM_UCS4_MAXLEN

We want to get rid of all non-static kmscon dependencies in TSM so move
this constant.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agounicode: remove KMSCON_UCS4_MAX
David Herrmann [Fri, 14 Sep 2012 16:29:07 +0000 (18:29 +0200)]
unicode: remove KMSCON_UCS4_MAX

We have TSM_UCS4_MAX so use it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agounicode: move kmscon_symbol* to tsm_symbol*
David Herrmann [Fri, 14 Sep 2012 16:26:43 +0000 (18:26 +0200)]
unicode: move kmscon_symbol* to tsm_symbol*

All the unicode helpers are move to TSM so move the symbols, too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agounicode: inline locking helpers
David Herrmann [Fri, 14 Sep 2012 16:21:37 +0000 (18:21 +0200)]
unicode: inline locking helpers

There is really no need to use these helper functions. Just directly call
the pthread locks.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agounicode: update comments
David Herrmann [Fri, 14 Sep 2012 16:19:15 +0000 (18:19 +0200)]
unicode: update comments

Update all the introduction and documentation comments. Also remove an old
TODO item regarding glib.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agounicode: add description of UTF8-state-machine
David Herrmann [Fri, 14 Sep 2012 16:01:34 +0000 (18:01 +0200)]
unicode: add description of UTF8-state-machine

A short comment on how the UTF8 state machine works and why it does not do
any sophisticated error recovery.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agounicode: add UCS4 constants
David Herrmann [Fri, 14 Sep 2012 16:00:59 +0000 (18:00 +0200)]
unicode: add UCS4 constants

Four helpers that define maximum UCS4 values, invalid values and a
replacement character for unknown values.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agounicode: rename kmscon_utf8_* to tsm_utf8_*
David Herrmann [Fri, 14 Sep 2012 15:18:51 +0000 (17:18 +0200)]
unicode: rename kmscon_utf8_* to tsm_utf8_*

All terminal-emulation code is moved into a new library called "TSM -
Terminal State Machine". So we rename everything to have a separate
namespace.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: video: add *_display_fake_blend(v) requests
David Herrmann [Wed, 12 Sep 2012 13:23:15 +0000 (15:23 +0200)]
uterm: video: add *_display_fake_blend(v) requests

Instead of requiring to use uterm_screen objects we now add a
fake_blendv() request directly to the display object. We rename it to
"fake_blend" instead of just "blend" so we can later implement real
blending.

This reuses the existing infrastructure. But the fake_blendv is the way to
go so we rename the existing functions to "fake_*" either.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: add *_swap() and *_use() helpers for displays
David Herrmann [Wed, 12 Sep 2012 13:00:28 +0000 (15:00 +0200)]
uterm: add *_swap() and *_use() helpers for displays

Instead of requiring to use a uterm_screen object we now also add these
helpers to the display directly. This allows to use libuterm without any
screens, which is often useful if no virtual screen are needed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: video: be more verbose when reading DRM properties
David Herrmann [Wed, 12 Sep 2012 11:40:19 +0000 (13:40 +0200)]
uterm: video: be more verbose when reading DRM properties

The user should be notified what went wrong when DRM properties couldn't
been read. There are also pending patches on the dri-devel ML that fix
reading properties without DRM-master.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: video: dumb: be more verbose when destroying buffers
David Herrmann [Tue, 11 Sep 2012 18:18:29 +0000 (20:18 +0200)]
uterm: video: dumb: be more verbose when destroying buffers

This call may fail with recent kernel versions as DRM_MASTER is required.
Therefore, print more information so we know what went wrong.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agobuild: fix missing header includes
David Herrmann [Tue, 11 Sep 2012 17:37:35 +0000 (19:37 +0200)]
build: fix missing header includes

"make distcheck" fails as we aren't declaring the headers correctly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: move uterm_vt to the end
David Herrmann [Tue, 11 Sep 2012 17:33:58 +0000 (19:33 +0200)]
uterm: move uterm_vt to the end

Move uterm_vt to the end of the file to avoid forward declaration of
uterm_input.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: add uterm_keysyms.h
David Herrmann [Tue, 11 Sep 2012 17:30:26 +0000 (19:30 +0200)]
uterm: add uterm_keysyms.h

We need a copy of xkbcommon-keysyms.h as long as xkbcommon is not included
in all major distributions. We _need_ this build-time dependency,
otherwise, we cannot build the other keyboard backends.

However, requiring xkbcommon as build-time dependency is not a solution as
no major distribution includes it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: move uterm_internal.h to uterm_input.h
David Herrmann [Tue, 11 Sep 2012 17:16:54 +0000 (19:16 +0200)]
uterm: move uterm_internal.h to uterm_input.h

uterm_internal.h contains only input related content so we can rename it
and remove all the inclusions where it is not needed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: move internal video-helpers to uterm_video.h
David Herrmann [Tue, 11 Sep 2012 17:11:01 +0000 (19:11 +0200)]
uterm: move internal video-helpers to uterm_video.h

This splits off all video related helpers of the big internal
uterm_internal.h header into uterm_video.h.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agofakevt: remove unused tool
David Herrmann [Tue, 11 Sep 2012 17:03:29 +0000 (19:03 +0200)]
fakevt: remove unused tool

The fakevt tool is no longer used. The same functionality was integrated
into kmscon with the fake-VT uterm_vt backend.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agogenshader: avoid generating source file during configuration
David Herrmann [Tue, 11 Sep 2012 16:46:28 +0000 (18:46 +0200)]
genshader: avoid generating source file during configuration

There is no need to make genshader being generated by configure, anymore.
We used to use @srcdir@ but this was not embedded into Makefile.am. Hence,
we can avoid this and make it build normally.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agobuild: fix gbm_bo_get_stride() upstream bug
David Herrmann [Tue, 11 Sep 2012 16:41:30 +0000 (18:41 +0200)]
build: fix gbm_bo_get_stride() upstream bug

libkms doesn't link to libdrm so our current check for gbm_bo_get_stride()
fails. This has been fixed upstream but distributions still need to pick
it up. Therefore, we simply add the drm libs to our checks. They are
available at this point, anyway.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agobuild: add uterm pkg-config file
David Herrmann [Tue, 11 Sep 2012 16:01:32 +0000 (18:01 +0200)]
build: add uterm pkg-config file

We intend to make libuterm independent of kmscon so it can be used by
other projects. Therefore, add a pkg-config file for easier integration
into other build systems.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agobuild: reorder makefile
David Herrmann [Tue, 11 Sep 2012 15:59:45 +0000 (17:59 +0200)]
build: reorder makefile

This moves the independent libraries to the top as they can be built
without kmscon, too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoexternal: add xkbcommon-keysyms.h
David Herrmann [Tue, 11 Sep 2012 15:31:46 +0000 (17:31 +0200)]
external: add xkbcommon-keysyms.h

If libxkbcommon is not available on the current platform, we still want to
be able to use the keysyms. We currently do this by depending on xproto
but this is ugly and we want to avoid this.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoeloop: add pkg-config file
David Herrmann [Tue, 11 Sep 2012 14:54:49 +0000 (16:54 +0200)]
eloop: add pkg-config file

The pkg-config file allows other users of libeloop to more easily
configure build-time options for eloop.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>