David Herrmann [Sun, 1 Jul 2012 13:27:10 +0000 (15:27 +0200)]
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>
David Herrmann [Sun, 1 Jul 2012 12:59:43 +0000 (14:59 +0200)]
build: make opengl optional
This removes the mode where we compiled uterm with OpenGL instead of
OpenGLES2 (it was broken anyway) and makes it fully optional now.
gl_shader.h is no longer compiled if OpenGL is not available and provides
dummy helpers instead.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jul 2012 12:39:30 +0000 (14:39 +0200)]
gl: add wrappers for glClear and glClearColor
This helps us moving opengl dependencies into a single source file so we
can easily disable it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jul 2012 12:31:50 +0000 (14:31 +0200)]
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>
David Herrmann [Sun, 1 Jul 2012 12:28:26 +0000 (14:28 +0200)]
uterm: add dumb-drm backend
Nearly all drm drivers provide a GEM/TTM buffer backend called "dumb
buffers". These buffers can simply be mmap'ped like fbdev device so 2D
acceleration is available. This patch adds a backend to uterm-video that
uses these buffers. It is quite similar to the drm backend but removes all
the egl/gl/gles2 dependencies.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 30 Jun 2012 17:52:20 +0000 (19:52 +0200)]
build: rewrite configure.ac
Remove all obsolete code and make it more readable. Nearly all features
can now be configured. However, the code doesn't work correctly if udev or
systemd is removed. That will be fixed soon, though.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 30 Jun 2012 10:53:23 +0000 (12:53 +0200)]
uterm: monitor: refactor systemd code
Move all systemd dependencies into local helper functions so we can easily
make them optional.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 29 Jun 2012 11:00:00 +0000 (13:00 +0200)]
build: move systemd dependencies to libuterm
We use the sd-login library in uterm exclusively so move the dependecy to
libuterm.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 29 Jun 2012 10:59:25 +0000 (12:59 +0200)]
build: move vt.[hc] to libuterm
The kmscon VT layer is used in libuterm exclusively so build it as part of
it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 29 Jun 2012 10:49:37 +0000 (12:49 +0200)]
uterm: remove libudev.h includes if not needed
All udev-dependencies are now moved into uterm-monitor. This allows us to
easily make udev optional for hotplug-less systems or emergency setups.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 29 Jun 2012 10:47:54 +0000 (12:47 +0200)]
build: move uterm into shared library
The uterm code was created to allow other applications to easily build new
user-space terminals for linux machines. Therefore, put it into a separate
library and install the header files correctly.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 29 Jun 2012 10:37:02 +0000 (12:37 +0200)]
build: move eloop into shared library
We use the eloop code in several other projects so move it into a shared
library to allow code-sharing.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Wed, 27 Jun 2012 10:23:38 +0000 (13:23 +0300)]
xkb: first get keysyms, then update state
This is the correct order, as specified in xkb_state_update_key header
comment.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Wed, 27 Jun 2012 10:11:23 +0000 (13:11 +0300)]
xkb: only repeat keys when they're supposed to repeat
Support for this was added upstream, we can use it now. This mostly
means that modifiers won't repeat anymore.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Wed, 27 Jun 2012 10:08:41 +0000 (13:08 +0300)]
xkb: use unicode conversion from xkbcommon
Support for this was added upstream, so we should avoid keeping the
entire conversion table twice in (readonly) memory. The old files are
still used by the dumb backend.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 19:15:08 +0000 (21:15 +0200)]
build: move external sources into libkmscon-static
Move all external sources into this library so we can use them everyone
but also be sure that we can link them statically. We will need this
guarantee later when adding LGPL stuff to libkmscon-static.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 19:11:57 +0000 (21:11 +0200)]
doc: fix header of gtk-doc makefile
It still used the old name. So convert it to use the more general name as
we are building all documentation into one global document.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 19:11:19 +0000 (21:11 +0200)]
build: add comments to Makefile.am
Add more comments to Makefile.am to make it more readable.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 18:43:34 +0000 (20:43 +0200)]
build: put static_* files into separate library
We now build all small helpers into a separate small library that can be
linked statically into all our others. That is, we don't need to keep
backwards compatibility or anything inside this library.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 18:35:22 +0000 (20:35 +0200)]
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>
David Herrmann [Sun, 24 Jun 2012 16:53:46 +0000 (18:53 +0200)]
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>
David Herrmann [Sun, 24 Jun 2012 16:16:12 +0000 (18:16 +0200)]
llop: add default helpers
We often need to return the same message over and over again with the same
return value. Use default log-messages now instead of ignoring the log.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 16:15:14 +0000 (18:15 +0200)]
llog: add direct log helpers
Sometimes, the parent object might not be available so we need to pass in
the log-object directly. Use "d" as prefix for those functions and add
variants for the most oftenly used functions.
If you need more direct variants, add them when you introduce the first
user.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 15:57:38 +0000 (17:57 +0200)]
eloop: require llog function in eloop-creation
When creating a new eloop object, we now require an lloop function so we
can perform conditional logging.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 15:55:59 +0000 (17:55 +0200)]
build: set LLOG_ENABLE_DEBUG
Set LLOG_ENABLE_DEBUG if debug mode is used.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 15:55:26 +0000 (17:55 +0200)]
log: add link to llog
Add helper function that can be used as llog backend.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 15:28:31 +0000 (17:28 +0200)]
llog: add library log helpers
Libraries must never log unconditionally. Otherwise, applications are
unable to disable logging and can get confused. This header contains
helpers to implement conditional logging on context objects inside of
libraries.
It is compatible to the log interface in kmscon apart from the runtime
configuration.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 15:21:56 +0000 (17:21 +0200)]
log: change severities to be identical to kernel sevs
The kernel defines 8 severities. Lets be compatible to these numbers so
our API will not have to be changes in the future.
This also causes LOG_ALERT to be added. It is not used, yet, but may be in
the future.
We also change the parameter type of severities to "unsigned int". Enum
variables can change types if new enums are added. We don't want that so
use a fixed type.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 10:20:18 +0000 (12:20 +0200)]
vte: set AUTO_WRAP mode on reset for console object
We reset all modes but forget to set them on the console object, too. The
AUTO_WRAP mode is the only mode that matters here, so we can ignore the
other modes.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 09:09:21 +0000 (11:09 +0200)]
uterm: video_drm: set EGL_DISPLAY correctly
We force EGL_DISPLAY to drm now. Otherwise, we might cause segfaults if
the EGL library tries to use the X11 egl-backend.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 09:01:25 +0000 (11:01 +0200)]
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>
David Herrmann [Sun, 24 Jun 2012 08:53:04 +0000 (10:53 +0200)]
terminal: redraw on wake-up
The drm video backend does automatically blit the framebuffer on wake-up,
however, the fbdev backend does not. Hence, we automatically redraw on
wake-up in the terminal backend now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 08:52:05 +0000 (10:52 +0200)]
terminal: avoid adding displays multiple times
We now enumerate displays on wake-up so we might end up adding a display
twice. This causes the display to be redrawn twice which is nasty so we
avoid it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 08:50:16 +0000 (10:50 +0200)]
ui: do not modify callback parameters
Other registered callbacks might get confused if we change the parameters.
Hence, we use a static copy for further actions.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 08:32:42 +0000 (10:32 +0200)]
font: support 2D blitting
If OpenGL is not supported, we now allow 2D blitting into the video
framebuffer as alternative to shaders.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 08:31:34 +0000 (10:31 +0200)]
video: return -EOPNOTSUPP in video_use without OpenGL
If OpenGL is not supported, we should _not_ return 0. Otherwise, there is
not convenient way to detect this scenario.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 08:30:28 +0000 (10:30 +0200)]
ui: enumerate displays on wakeup
We might have missed a display when our handler was not registered, yet.
So enumerate these displays on wakeup so we can be sure that we have all
displays registered with the terminal subsystem.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 08:28:40 +0000 (10:28 +0200)]
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>
David Herrmann [Sun, 24 Jun 2012 08:27:46 +0000 (10:27 +0200)]
terminal: create shader only when OpenGL is available
If the video backend does not provide an OpenGL context, there is no need
to create the gl shaders. We then use the 2D blitting functions instead.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 24 Jun 2012 08:27:07 +0000 (10:27 +0200)]
terminal: add debug message when removing display
This can help a lot when debugging displays that are registered multiple
times with a terminal object.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 23:09:40 +0000 (01:09 +0200)]
uterm: video_fbdev: fix debug statements
Remove blitting debug statements as it is working fine now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 23:07:01 +0000 (01:07 +0200)]
uterm: add internal header for blitting support
Whoops, forgot to add it in the fbdev commit. Pushing it now so it works
again.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 23:06:16 +0000 (01:06 +0200)]
uterm: video_drm: set .blit to NULL
We do not support blitting via drm (yet) so set it to NULL explicitely.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 23:04:50 +0000 (01:04 +0200)]
uterm: video_fbdev: make double-buffering optional
This makes double-buffering optional as not all drivers provide this. In
fact, only very few drivers implement this. Furthermore, this also adds a
fake display-mode that is used instead of NULL. Otherwise, the screen
object might not work as expected.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 23:03:56 +0000 (01:03 +0200)]
uterm: video: add blitting support
All backends that do not provide OpenGL contexts can not implement buffer
blitting so we can at least draw rectangular areas to the framebuffer.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 23:01:47 +0000 (01:01 +0200)]
uterm: add WAKEUP and SLEEP signals
Notify all listeners when going to sleep or waking up. This allows saving
energy in the listeners by not redrawing the screen while being asleep.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 20:54:52 +0000 (22:54 +0200)]
uterm: video_fbdev: save stride on open
Copy stride into the fbdev structure so we can use it throughout the code.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 20:52:24 +0000 (22:52 +0200)]
uterm: video_fbdev: test whether bpp is power of 8
I have never seen something different but lets be sure here and test for
modulo-8.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 20:46:42 +0000 (22:46 +0200)]
uterm: video_fbdev: remove double check
There is no need to check this twice so move it beyond the last vinfo
modification.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 20:39:48 +0000 (22:39 +0200)]
uterm: video_fbdev: discard non-xrgb32 devices
We discard all non-xrgb32 devices for simplicity reasons for now. We
definitely need to support other devices in future but that makes the
backend unnecessarily complex at the beginning so avoid it.
This also moves the resolution-change to the beginning and duplicates the
tests so we can be totally sure that everything is right after setting the
correct values.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 20:04:06 +0000 (22:04 +0200)]
uterm: video: return -EOPNOTSUPP when opengl is not supported
When the backend does not implement display_use() then we return an error
instead of success to notify the application that it should use blitting
instead.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 19:56:43 +0000 (21:56 +0200)]
uterm: video_fbdev: remove display_use()
fbdev does not support OpenGL contexts so there is no need to implement
this function. Instead, we will provide blitting support later.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 18:09:19 +0000 (20:09 +0200)]
build: add gtk-doc
This adds gtk-doc documentation builds to kmscon. All documentation is
build in a central place due to gtk-doc restrictions.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 18:06:44 +0000 (20:06 +0200)]
eloop: turn comment into non-gtkdoc comment
This comment does not use gtk-doc syntax so remove the extra *.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 23 Jun 2012 16:24:44 +0000 (18:24 +0200)]
uterm: add fbdev video backend
This adds a fully working fbdev backend to the uterm library. This allows
us to create our rendering pipeline on any linux machine.
The fbdev backend is not yet hooked up into kmscon. There are still some
remaining issues as we do not have OpenGL on fbdev if EGL is not compiled
with fbdev backend (which is usually not).
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 17 Jun 2012 13:53:33 +0000 (15:53 +0200)]
console: rewrite console layer
This is a rewrite of the whole console layer so we can remove the
kmscon_buffer object to speed up the console.
This removes the split between the scroll region and the two margins so we
can resize margins in O(1). This also correctly merges the remaining
console modes so vte does not have to track them.
Btw. vim runs smoothly on kmscon with this console layer now (finally!).
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 16 Jun 2012 22:29:04 +0000 (00:29 +0200)]
fblog: add kernel patches for fblog driver
The fblog drivers provides a replacement for fbcon and prints all kernel
log messages to all available framebuffer devices.
As long as the driver is not upstream, I will keep it here for reference.
See linux-serial@vger.kernel.org for discussion.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 30 May 2012 18:49:39 +0000 (20:49 +0200)]
vte: allow setting margins
Support changing margin size of the terminal.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 30 May 2012 18:48:22 +0000 (20:48 +0200)]
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>
David Herrmann [Wed, 30 May 2012 18:47:40 +0000 (20:47 +0200)]
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>
David Herrmann [Wed, 30 May 2012 18:37:33 +0000 (20:37 +0200)]
vte: add DA support
Send Device attributes as VT220.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 30 May 2012 18:29:29 +0000 (20:29 +0200)]
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>
David Herrmann [Wed, 30 May 2012 17:42:11 +0000 (19:42 +0200)]
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>
David Herrmann [Wed, 30 May 2012 17:03:34 +0000 (19:03 +0200)]
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>
David Herrmann [Wed, 30 May 2012 17:02:17 +0000 (19:02 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:58:52 +0000 (18:58 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:53:43 +0000 (18:53 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:52:20 +0000 (18:52 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:48:59 +0000 (18:48 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:19:49 +0000 (18:19 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:19:03 +0000 (18:19 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:00:06 +0000 (18:00 +0200)]
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>
David Herrmann [Wed, 30 May 2012 15:54:31 +0000 (17:54 +0200)]
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>
David Herrmann [Wed, 30 May 2012 15:44:12 +0000 (17:44 +0200)]
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>
David Herrmann [Wed, 30 May 2012 15:43:36 +0000 (17:43 +0200)]
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>
David Herrmann [Wed, 30 May 2012 15:24:49 +0000 (17:24 +0200)]
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>
David Herrmann [Tue, 29 May 2012 15:16:18 +0000 (17:16 +0200)]
vte: fix up comments
Fix up trivial comments. Remove already realized TODO items and add some
additional TODOs.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 15:07:53 +0000 (17:07 +0200)]
vte: add auto-wrap support
VT510 manual says auto-wrap is disabled by default but most applications
(including bash) expect it to be on, therefore we enable it by default.
The console layer already supported it but the vte layer wasn't hooked up.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 14:57:04 +0000 (16:57 +0200)]
console: support INSERT mode
When INSERT mode is enabled, we move all following characters to the right
and drop all characters that are moved beyond the margin.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 14:20:22 +0000 (16:20 +0200)]
vte: set default flags on soft-reset
Instead of clearing all flags we set the default flags now. They are
defined by the VT220 to be set this way on soft-reset.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 14:06:03 +0000 (16:06 +0200)]
vte: fix indentation of do_csi()
Use correct indentation for switch/case blocks.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 13:27:50 +0000 (15:27 +0200)]
vte: fix up SM/RM modes
The ANSI and DEC modes overlap so fix up parsing of flags.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 13:17:17 +0000 (15:17 +0200)]
vte: declare all available modes
This adds dummy modes for all available DEC/ANSI modes. This does not
actually implement them but adds support for SM/RM CSI sequences.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 12:39:05 +0000 (14:39 +0200)]
vte: implement DECKPAM and DECKPNM
Both either set or reset the keypad application mode.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 12:35:49 +0000 (14:35 +0200)]
vte: implement SM/RM
SM/RM - SetMode/ResetMode are used to explicitely set terminal modes. DEC
private modes and ANSI modes are separated as defined by VT220.
We currently only parse modes that we actually support. Further modes may
follow.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 12:19:52 +0000 (14:19 +0200)]
vte: implement S7C1T and S8C1T
Both escape sequences are used to change the C1 escape character mode from
using 8bit or 7bit escape codes/sequences.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 12:14:38 +0000 (14:14 +0200)]
vte: set FLAG_USE_C1 when C1-8bit mode is requested
We currently do not support sending C1 controls as 8bit characters because
this doesn't make any sense with UTF-8. However, in 7bit/8bit
compatibility mode the client can request this. As nearly all clients are
backwards compatible to VT100 they also support C1 controls as 7bit
sequences, though, so there is really no time pressure to implement
FLAG_USE_C1.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 12:08:28 +0000 (14:08 +0200)]
vte: implement charset shift in/out
This allows changing GL and GR to the values set in G0-G3. GL can also be
set temporarily, GR currently does not have such a mode.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 11:59:19 +0000 (13:59 +0200)]
vte: trivial: fix switch indentation
We use kernel-style switch-case indentation.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 11:52:23 +0000 (13:52 +0200)]
vte: support designating charsets
With ESC {int} {final} you can designate G0-G3. If no {int} is given, we
fall back to the default escape sequences that replace the C1 set.
However, the user might designate other sets manually so we ignore all
escape sequences that have intermediates set.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 11:31:33 +0000 (13:31 +0200)]
vte: collect csi flags +, ( and )
All three flags are most often used with basic escape sequences and not
with CSI sequences, however, we treat them generic here to avoid more
complexity.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 11:23:22 +0000 (13:23 +0200)]
vte: support temporary charsets and g0-g3
Temporary charsets are only used for the next graphics character that is
displayed. After that, the VTE returns to the previous charset. On
soft-reset we also reset these temporary slots.
This also adds the g0-g3 backend slots that can be set by the client and
allow mapping of arbitrary other charsets into gl/gr/glr/grt.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 11:18:14 +0000 (13:18 +0200)]
vte: always perform soft reset on DECSCL
All DECSCL modes automatically perform a soft reset.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 11:09:38 +0000 (13:09 +0200)]
vte: add support for GL/GR mappings
This allows mapping different charsets into GL/GR.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 11:06:56 +0000 (13:06 +0200)]
vte: perform soft reset on initialization
Instead of copying all that initialization stuff around, we simply perform
a soft reset on initialization.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 10:46:09 +0000 (12:46 +0200)]
vte: handle XK_Find and XK_Select
Even though modern keyboard often do not include such keys, we should
handle them correctly, anyway. For the sake of backwards-compatibility.
This also comes in handy if you define these keys separately. The
functions that are implemented by many applications with these keys are
handy, indeed.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 10:43:58 +0000 (12:43 +0200)]
vte: move long csi-handlers into separate function
Avoid making do_csi() too big. So put long csi-handlers into separate
functions.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 10:40:01 +0000 (12:40 +0200)]
vte: implement DECSTR / soft-reset
On soft-reset, all internal state is reset but the screen data is kept
alive.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 10:37:18 +0000 (12:37 +0200)]
vte: corectly implement DECSCL
We now select the 8bit/7bit modes if the client sends an DECSCL requesting
a conformance level.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 10:30:17 +0000 (12:30 +0200)]
vte: select CSI flags
Correctly select CSI flags like ?, !, > or $ and more. We actually don't
care about the position of these flags as other CSI parameters are just
digits.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>