vte: ignore unset csi parameters in SM/RM

When reading Setmode/Resetmode parameters, we should ignore all unset
parameters instead of printing a warning.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: add ESC+c hard-reset TODO item

ESC+c is a hard-reset and now marked as TODO item.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: implement local echo mode

If SEND_RECEIVE_MODE is not set, we have to echo all data we send out.
That is, all escape sequences and all characters are directly interpreted
by us. To avoid recursion, we use a simply protection. However, some
escape sequences don't make sense in echo mode but we don't care here, as
this is a problem of the application/client, not us.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
console: allow setting/resetting flags

Instead of writing a function for each mode we now accept flags for the
console object. For now the flags are unused but other flags will be
added.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: implement origin mode

Convert the old relative-addressing mode of the console layer into origin
mode flag.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
console: allow retrieving console flags

This adds a new function that allows external subsystems to retrieve the
current flags of the console.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
terminal/vte/console: support inverse-screen-mode

In inverse screen mode we switch background and foreground colors. As our
console layer supports transparent backgrounds, we have to do this in the
terminal layer.

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

The pango backend now correctly draws colored or uncolored backgrounds.
This is needed to support drawing cursors.

We currently do not optimize this for performance. In fact, this reduces
performance a lot and we could avoid drawing backgrounds if we cleared the
background to the same color before. However, this also means we currently
could move drawing the background into the console backend again. The
transparency feature is awful, anyway and I don't see any reason
supporting it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
console: reset font color to white by default

Reset font color to white for new cells. This allows us to draw reversed
cells that are not occupied by any value. Otherwise, these cells would be
still black if reversed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: correctly reset console flags on soft reset

We didn't reset the console flags on soft reset, however, this is required
to correctly synchronize the flags between vte and console.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: set color to white on cell reset

For the same reason as we reset it to white on cell creation we need to
reset it to white on cell reset. Otherwise we have odd artifacts in
reverse video mode.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
console/vte: draw cursor

If HIDE_CURSOR mode is not set, we draw the cursor at the current
position.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: update TODO items

Both flags have been implemented recently so remove the TODO flag in the
comments.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: support cursor positioning CSI

Most of the CSIs for cursor movement are already implemented but HVP and
CUP are missing. This adds both CSI handlers to the VTE layer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
conf: set TERM by default to vt220

vt220 seems to be the best alternative to "xterm" and should work with
every application.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: add DA support

Send Device attributes as VT220.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: more verbose SM/RM debug messages

When we receive an unknown SM/RM message, be more verbose about what
exactly was received on the log output.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: fix HUP/HVP positioning bug

We mixed up X/Y coordinates. HUP and HVP send them reversed as often used
in terminals. Anyway, now it works correctly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: allow setting margins

Support changing margin size of the terminal.

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