876 Commits

Author SHA1 Message Date
David Herrmann
d3a0358797 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>
2012-09-18 16:24:06 +02:00
David Herrmann
0cf2f8efbd 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>
2012-09-18 16:04:03 +02:00
David Herrmann
3e71989955 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>
2012-09-18 15:58:54 +02:00
David Herrmann
0ee83010ff 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>
2012-09-18 15:54:31 +02:00
David Herrmann
64635943d2 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>
2012-09-18 15:53:07 +02:00
David Herrmann
e638e6f039 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>
2012-09-18 15:01:45 +02:00
David Herrmann
613e7e7000 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>
2012-09-18 14:53:46 +02:00
David Herrmann
f919b3ad81 tsm: fix header comments
Remove "kmscon" from any TSM headers and replace it by "tsm".

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-18 14:50:02 +02:00
David Herrmann
efb210469d 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>
2012-09-18 14:49:20 +02:00
David Herrmann
32fec77420 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>
2012-09-18 14:12:28 +02:00
David Herrmann
c63330d9e9 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>
2012-09-18 13:47:19 +02:00
David Herrmann
f2c1dd77ff 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>
2012-09-18 13:46:44 +02:00
David Herrmann
57928f5df0 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>
2012-09-18 13:41:17 +02:00
David Herrmann
69259c8d64 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>
2012-09-18 12:29:06 +02:00
David Herrmann
c15604b6b7 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>
2012-09-18 12:17:41 +02:00
David Herrmann
0273802809 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>
2012-09-18 12:14:53 +02:00
David Herrmann
372948af53 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>
2012-09-18 12:03:17 +02:00
David Herrmann
da51fe1589 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>
2012-09-18 11:48:02 +02:00
David Herrmann
4af046d39d 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>
2012-09-18 11:39:08 +02:00
David Herrmann
d5a0c9644c 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>
2012-09-18 11:30:38 +02:00
David Herrmann
52d2eb09b1 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>
2012-09-18 11:04:50 +02:00
David Herrmann
cca90781c0 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>
2012-09-18 10:54:06 +02:00
David Herrmann
7f52a2d73e 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>
2012-09-18 10:49:06 +02:00
David Herrmann
de306cee23 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>
2012-09-18 10:36:37 +02:00
David Herrmann
a34ddc1888 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>
2012-09-18 09:54:08 +02:00
David Herrmann
7867c50025 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>
2012-09-18 09:53:12 +02:00
David Herrmann
3602b736ff 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>
2012-09-18 09:44:27 +02:00
David Herrmann
92a14e0964 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>
2012-09-18 09:20:31 +02:00
David Herrmann
d62b367210 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>
2012-09-18 09:18:50 +02:00
David Herrmann
8deb82f653 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>
2012-09-16 17:32:07 +02:00
David Herrmann
93c553c1bc 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>
2012-09-16 17:08:21 +02:00
David Herrmann
04e3bcc652 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>
2012-09-16 09:23:35 +02:00
David Herrmann
f3e3973d56 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>
2012-09-16 09:13:30 +02:00
David Herrmann
2b5b7d3736 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>
2012-09-16 09:10:36 +02:00
David Herrmann
aed1373bc6 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>
2012-09-15 20:11:00 +02:00
David Herrmann
715e247676 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>
2012-09-15 19:10:37 +02:00
David Herrmann
719ac16607 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>
2012-09-14 18:31:18 +02:00
David Herrmann
81a9a30040 unicode: remove KMSCON_UCS4_MAX
We have TSM_UCS4_MAX so use it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-14 18:29:07 +02:00
David Herrmann
61e0d9d098 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>
2012-09-14 18:26:43 +02:00
David Herrmann
fa31942c02 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>
2012-09-14 18:21:37 +02:00
David Herrmann
601592a866 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>
2012-09-14 18:19:15 +02:00
David Herrmann
e9f39be3e8 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>
2012-09-14 18:01:34 +02:00
David Herrmann
468e265138 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>
2012-09-14 18:00:59 +02:00
David Herrmann
c1075fba18 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>
2012-09-14 17:18:51 +02:00
David Herrmann
2df4fc0d31 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>
2012-09-12 15:23:15 +02:00
David Herrmann
87c9963438 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>
2012-09-12 15:00:28 +02:00
David Herrmann
38edd97143 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>
2012-09-12 13:40:19 +02:00
David Herrmann
2458b04fb3 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>
2012-09-11 20:18:29 +02:00
David Herrmann
c1fcb47654 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>
2012-09-11 19:37:35 +02:00
David Herrmann
085aef9e38 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>
2012-09-11 19:33:58 +02:00