610 Commits

Author SHA1 Message Date
David Herrmann
f59e6f5e12 misc: add dynamic-array implementation
This adds a new data-type: kmscon_array
It is used as a dynamicly growing array that can be freely accessed. We
currently use the glib type in unicode.c but can finally replace it with
our own implementation.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-15 14:45:10 +02:00
David Herrmann
2cd8cdbea4 console/font: draw bg only if needed
If the background color is identical to the background-color of the glyph
to be drawn, then we can skip drawing the background. This increases
performance a _lot_.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-15 12:55:50 +02:00
David Herrmann
a6bca387da vte: fix reset_state() resetting only saved-states
reset_state() is used to reset the saved state and not to reset the actual
state. We currently get invalid character-maps as we never initialize them
correctly. This fixes all these vte_map() related bugs.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-15 12:54:19 +02:00
David Herrmann
2551efdbac vte: implement RIS hard reset
RIS is used to "hard"-reset the terminal. We simply clear every state
known and reset to initial state.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-15 12:06:57 +02:00
David Herrmann
2222e316cb vte: send primary-DA on 7bit DECID
Also send the primary-DA when receiving 7bit variant of DECID.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-15 12:02:18 +02:00
David Herrmann
9cd05223a5 vte: send primary DA on DECID
The DECID escape should be followed by a primary-DA answer. To avoid
copying the same primary-DA sources, we put the primary-DA into a static
helper function.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-15 11:59:21 +02:00
David Herrmann
aa31b1297e vte: implement device status reports (DSR)
DSRs are used to query the terminal for data. This includes general status
reports but also cursor positions. We currently only implement VT220
features. DEC later introduced further modes to query more advanced
interfaces.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-15 11:55:51 +02:00
David Herrmann
10d72851bb vte: stop advertising UDK support
We do not support user-defined-keys (UDK) so do not advertise it in
primary-DA lines.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-15 11:36:35 +02:00
David Herrmann
1641241e5d vte: implement CHT, CBT and tabulators
CHT and CBT are used to move multiple tab-stops with a single call. The \t
char moves only one tab-stop forward. All are conformant to the vt510
specs.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-15 11:30:51 +02:00
David Herrmann
a7f39f23fe console: implement tab movement
Implement left and right tab movement in console backend. This is used by
the VTE layer to interpret different VT escape sequences and the tabulator
character.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-15 11:26:11 +02:00
David Herrmann
785137264b vte/console: implement protected erase
Protected erase means erasing parts of the screen but preventing protected
characters from being erase. Protecting a character is done by setting
character attributes similarly to colors and backgrounds. Both are reset
on hard erase, soft-reset or screen clearance.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 23:51:56 +02:00
David Herrmann
01527f9f55 vte: support ECH CSI
The ECH CSI is used to erase partial lines.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 20:24:10 +02:00
David Herrmann
bdf032898e console: fix invalid cursor state after resize
Set cursor state to next valid position on resize to avoid invalid cursor
states.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 20:00:06 +02:00
David Herrmann
59e82152d3 console: allow erasing partial lines
Later VTs allow erasing only partial lines so add support for that in the
console backend.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 19:58:38 +02:00
David Herrmann
60527b2d64 vte: extend SGR/color handling
This adds full xterm 256color support and improves SGR handling in
general.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 19:49:55 +02:00
David Herrmann
ba59f62a26 vte: fix application cursor keys
This is probably a copy/paste bug but we sent the wrong application cursor
key sequences. This is only visible in xterm-mode so nobody noticed until
now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 19:34:04 +02:00
David Herrmann
f4375dcc76 console: hide cursor if requested
When the HIDE_CURSOR flag is set, we must not draw the cursor.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 19:31:37 +02:00
David Herrmann
7fb5c5c454 vte: tune SGR handling
We definitely do not need to check the unset parameters so shorten the
loop so unparsed parameters are not checked.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 17:38:32 +02:00
David Herrmann
492ac8f72c console/vte: implement ICH DCH
ICH is used to insert characters into the current line. DCH is used to
delete characters from the current line. They act as described in vt220
manual.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 17:33:28 +02:00
David Herrmann
60b180a369 console: support "protect" character attribute
VT220 allows protecting attributes. That is, they are not erased by
special new erase-commands. The normal erase-commands still erase all
characters.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 16:49:35 +02:00
David Herrmann
8c42b38cd3 vte: implement TBC
Implement TBC CSI which clears the current or all tab-stops. This is
according to VT220 rules.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 16:24:08 +02:00
David Herrmann
6177d4fa69 vte: allow setting tab-stops
Allow applications to set new tab-stops according to vt220 rules.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 16:18:42 +02:00
David Herrmann
1d87be8c98 console: add tab-stop helpers
Add three helpers to set and reset tab-stops. They will be used by the VTE
layer to add and remove tab-stops when requested by the application.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 14:21:43 +02:00
David Herrmann
abb4deb4b8 console: fix tab ruler to be horizontal
Whoops, current tab ruler turned out to be vertical. That's definitely not
what we want. Therefore, turn it around to be horizontal so we can
correctly move forward/backward in the console.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 14:20:39 +02:00
David Herrmann
10c90c6c5d console: implement console soft-reset
On soft-reset we reset the console to the initial state but keep current
line-state. That is, scrollback and cursor position are kept but the
non-visible state is reset.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 14:12:51 +02:00
David Herrmann
2ca0c915a7 Add optional dbus support
As we might need dbus for inter-process-communication later, this adds a
very rudimentary dbus client integration for epoll-based loops.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 14:00:23 +02:00
David Herrmann
e1095b5ef2 console: add tab-ruler support
The tab-ruler is used to set console tab-stops. We use an array with one
cell per column that is set to true if it is a tab-stop and false if it is
not.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 13:53:52 +02:00
David Herrmann
2543f13630 vte: reset margins on soft-reset
Instruct console code to reset the console margins to default values (that
is, destroy the margins) on console soft-reset.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 13:43:02 +02:00
David Herrmann
0c8cb12a91 vte: implement DECSC DECRC
DECSC is used to save the current console state. DECRC can restore the
console to a previously saved state.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 13:39:43 +02:00
David Herrmann
2a648c54dd console: allow retrieving cursor state
This adds two functions to retrieve x/y positions of the cursor. This can
be used to save and restore cursor positions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 13:36:46 +02:00
David Herrmann
93ccbdc699 ui: reopen terminal on HUP
We now automatically reopen the pty when the child process died. This will
most-often simply restart the shell or login program.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 12:15:20 +02:00
David Herrmann
2af9952a72 terminal: close pty before opening it
There is no explicit call to reopen the underlying pty so we simply
force-close it before (re)-opening it. This will allow the UI to reopen a
pty when the child died.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-14 12:14:25 +02:00
Ran Benita
fd85a7b2ce xkb: fix null dereference
Just an obvious silly mistake.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-07 13:47:19 +02:00
David Herrmann
8256ef6686 tests: fix tests to compile again
Whoops, I totally forgot about them. Fix the headers to be compatible with
eloop again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-07 13:45:29 +02:00
David Herrmann
6d0831c52f Release kmscon-2
This is the second release of kmscon. It's again a development release but
should now be good enough so it can run on any linux system.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
kmscon-2
2012-07-01 20:29:12 +02:00
David Herrmann
895eaaa218 Update README
Fix the dependency information and add several TODO notes.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 20:26:30 +02:00
David Herrmann
485b6b352c unicode: replace glib types with native types
There is really no need to use these glib types here. They are relicts
from the time when we used the glib hashtable so we can safely replace
them now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 19:35:16 +02:00
David Herrmann
25b81425ef misc: change hashtable compare function to return bool
It really doesn't make sense to expect an integer here as memcmp() and
friends use an integer, too, but in reversed logic. So use bool to avoid
confusion.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 19:29:33 +02:00
David Herrmann
3a1926b081 misc: remove glib dependency
This adds a new drop-in replacement for the glib hashtable implementation.
The hash table can be found at github: github.com/rustyrussel/ccan

It's licensed under the terms of the LGPL and perfect for our
implementation. Please see COPYING for license information.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 19:13:16 +02:00
David Herrmann
6901c1df1b uterm: monitor: make systemd optional
If systemd is not used for multi-seat support, we simply fake-add seat
"seat0" and avoid looking for the "seat" tag. However, if devices still
use ID_SEAT, we still parse it but all other devices are taken for seat0
by default.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 16:43:09 +02:00
David Herrmann
bca8d9d6d7 Add NEWS file
Whenever we do a release, this file will contain all the major changes as
a short list.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 16:31:54 +02:00
David Herrmann
9c74f6d423 build: remove TODO from DIST_EXTRA
The TODO list was moved to github long ago so remove this dead reference.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 16:18:23 +02:00
David Herrmann
b9ce96941b eloop: fix signal creation
The previous fix incorrectly registered new signals always to the last
found signal which is definitely incorrect. Therefore, we now correctly
traverse the list and register new signals as new signals.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 16:17:04 +02:00
David Herrmann
0467a8fce5 uterm: vt: correctly initialize ret to 0
We need to return "true", not "false" if a mode is unknown. Otherwise, we
will block the VT subsystem.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 16:11:10 +02:00
David Herrmann
6d4fd00d3d build: correctly clear GBM/EGL flags
When building without DRM we should correctly clear the GBM and EGL flags.
Otherwise, we will be linking them either way.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 16:09:24 +02:00
David Herrmann
93b0d3e80c eloop: silence gcc warning
Gcc warns about an uninitialized variable (which technically is correct).
However, there is really no way this can really happen. But to make gcc
happy (and to enhance code readability) we now depend on !sig whether the
list-search was successful.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 15:49:36 +02:00
David Herrmann
3b795bbe6a llog: make debug statements produce real code
Instead of defining them to nothing we now produce real code which
evaluates to "void", though. This allows us to use the macros whereever an
rvalue can be used.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 15:47:11 +02:00
David Herrmann
9e5013f51b uterm: vt: silence gcc warning
We initialize the variable to "true" to silence gcc warnings that we might
get an uninitialized variable (which we really cannot get here).

Anyway, in the future, if the number of types may increase, the correct
way to deal with unknown types is returning "true" so do this by default
now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 15:45:54 +02:00
David Herrmann
6356dae1da vte/console: implement CSI 'M' (DL: delete line)
The 'M' CSI mode is used to delete lines. This implements this mode
similar to the "INSERT LINES" CSI.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 15:35:28 +02:00
David Herrmann
ff91998ad8 vte/console: implement CSI mode L (insert line: IL)
The IL CSI ('L') is used to insert a given number of lines at the current
cursor position. All lines below are moved down.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 15:30:23 +02:00