27 Commits

Author SHA1 Message Date
David Herrmann
1657bb9a3a text: add render-support for multi-cell glyphs
Multi-cell glyphs are glyphs that span across multiple horizontal cells.
The font renderers already support this. This patch fixes the console
renderers to take advantage of this.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-12-10 16:00:08 +01:00
David Herrmann
52edafe08c conf: allow multiple grabs and keysyms per grab-option
We allow users to specify grabs on the command-line or in config-options.
We sometimes want multiple grabs to do the same. Therefore, this changes
the grab-parser and handlers to allow this.

Furthermore, this adds support for keysyms that are assembled of multiple
syms. This isn't needed by any keymap, yet, but might be used in the
future.

Last but not least, you can also specify modifiers only now. This might be
used by subsystems to use the default keysyms but let the user specify
what modifiers should be used.
However, be careful when specifying modifiers-only for normal grabs as
this means the grab is executed everytime the modifier is reported with
_any_ key.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 17:30:27 +02:00
David Herrmann
33ebc01441 tsm: vte: use ASCII keysyms for ctrl+<XY> shortcuts
If a user has multiple active XKB layouts but only one of them has ASCII
keysyms on the base level, then ctrl+<XY> might actually never work,
because these keys aren't available in the current layout. This patch
tries to find a layout of the user that actually _has_ ascii keysyms on
the base level and passes this information along with the normal keysym
information.

The TSM layer can now use this ascii keysym instead of the normal unicode
keysym to handle ctrl+<XY> shortcuts. This is the same way xterm et. al.
handle this, so it seems to be a good idea to do this in TSM, too.

Reported (and mainly written) by Ran Benita.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-09 12:30:40 +02:00
David Herrmann
7f1bff5cc6 wlt: terminal: implement copy/paste support
This implements copy/paste support for the terminal widgets via the
recently introduced helpers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-07 15:26:22 +02:00
David Herrmann
0996ed38a0 wlt: terminal: clear selection on short click
If the mouse is not moved during a mouse-click, then we clear the current
selection. This can be increased to allow a short range of few pixels of
mouse-movement if required.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-05 14:04:54 +02:00
David Herrmann
202fa3b766 wlt: terminal: implement mouse-selection
This hooks up the mouse-selection with the tsm-screen selection support.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-05 13:41:52 +02:00
David Herrmann
ed66487a4b wlt: add --grab-zoom-in/out command-line options
These options allow to modify the hard-coded shortcuts for font zooming.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-02 13:46:47 +02:00
David Herrmann
1072b8cb76 wlt: terminal: zoom font on ctrl+plus/minus
We now create the next bigger/smaller font on ctrl+plus/minus keyboard
input. This is currently done by integer-steps but may be changed to
smaller steps. You can currently use the DPI values to control the
step-size, even though this is an ugly hack.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-02 13:39:33 +02:00
David Herrmann
6a8ab57e48 wlt: terminal: do not snap to grid-size on fullscreen-mode
If we are in fullscreen mode, we should allocate all space that is
available (like in maximized mode) instead of snapping to the next
grid-size.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-01 17:21:27 +02:00
David Herrmann
c28ea5c974 wlt: toolkit: notify keyboard-cbs whether a key was handled
All keyboard-cbs have to return whether they handled a key now.
Furthermore, they get as parameter a flag that notifies them whether a
previous handled already handled the key.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-01 17:00:58 +02:00
David Herrmann
0cc83df84a wlt: terminal: reset scrollback-position on user-input
On user-input we now reset the scrollback-position so it is set to the
actualy screen again. This is normal behavior of most other terminals and
I see no reason not to do this.

If anybody requests it, we can make it easily optional via a command-line
setting.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-01 16:42:08 +02:00
David Herrmann
c7b458df3d wlt: terminal: draw background-margin when maximized
When maximized, we might have a small margin as we do not snap to
grid-sizes. Therefore, we need to correctly draw the background color for
these margins.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-01 15:02:54 +02:00
David Herrmann
bcb058134f wlt: terminal: use whole size when maximized
We shouldn't snap to console-grid sizes when maximized. This produces
weird artifacts that are not expected by the users.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-01 14:26:04 +02:00
David Herrmann
1b1ff11355 wlt: toolkit: pass flags to resize and redraw callbacks
If a window is maximized, fullscreen or should be drawn without
decorations, then the widgets must be notified about it. Hence, this adds
a flags argument to resize and redraw callbacks.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-01 14:14:28 +02:00
David Herrmann
038aac7fd5 wlt: add --term, --login, --palette and --sb-size
These terminal options are simply copied from kmscon and behave the same
way.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-01 12:41:06 +02:00
David Herrmann
e5e81a0b4c wlt: add scrollback-buffer grabs
This copies the grabs from kmscon over to wlterm. It is now possible to
scroll up and down in the scrollback-buffer if you manually increase the
buffer size.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-01 12:24:03 +02:00
David Herrmann
e827ef4d6a wlt: toolkit: implement proper minimal sizes
A widget may have different constraints regarding minimal sizes and the
size it occupies. Therefore, we need to pass a hint with the minimal size
together with the prepare-resize round.

The catch-all user can then decide to resize the catch-all field until it
is big enough to hold all minimal-sizes.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-01 00:16:57 +02:00
David Herrmann
9dc929b942 wlt: terminal: remove dead non-snap code
This code isn't needed at all. It doesn't make sense to disable snapping
so remove this dead code.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-30 23:51:34 +02:00
David Herrmann
2496caaffa wlt: terminal: do not clear terminal background
We snap to terminal borders now so there is no need to clear the
background as we paint it during redraw, anyway.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-30 23:50:12 +02:00
David Herrmann
f198f28d02 wlt: terminal: snap to console-size on resize
Instead of resizing linearly, we now always resize only to the next
possible console size.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-30 23:01:24 +02:00
David Herrmann
d69414297c wlt: toolkit: allow widgets to control new size
This changes the prepare-resize logic to allow widgets full control of the
new size. The initial size starts at 0 and each widget can increase it.
The last widget should be a catch-all that uses all size that is available
and computes a good new size based on the requirements that the previous
widgets provided.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-30 22:50:38 +02:00
David Herrmann
1a34c00796 wlt: terminal: forward HUP event to the caller
This forwards the PTY-HUP event to the caller so we can close the terminal
window when the client application exits.

Reported-by: Alexander Preisinger
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-27 19:08:41 +02:00
David Herrmann
3f4e8a498b 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>
2012-09-27 12:36:10 +02:00
David Herrmann
3ee5d58e4f wlt: terminal: handle keyboard events
Pass keyboard events straight through to the TSM handler.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-27 00:45:05 +02:00
David Herrmann
d56f811de7 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>
2012-09-26 23:48:35 +02:00
David Herrmann
6e5eb4f92f 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>
2012-09-26 21:39:15 +02:00
David Herrmann
f9de068a09 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>
2012-09-26 18:56:41 +02:00