David Herrmann [Sat, 28 Jan 2012 12:43:09 +0000 (13:43 +0100)]
pty: fix style issue
Fix small indentation style issue.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 28 Jan 2012 12:22:44 +0000 (13:22 +0100)]
pty: merge fork_pty and pty_spawn
pty_spawn was just a short wrapper so we can merge both into one
function.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Mon, 23 Jan 2012 16:16:09 +0000 (18:16 +0200)]
pty: unblock all signals before exec'ing the child
When we register signals in the eloop we also block them in our signal
mask. The signal mask is inherited by the child. Therefore, if the child
does not reset its mask (e.g. bash and most normal processes), it will
not receive any of the signals that we handle. So for example C-c
(SIGINT) does nothing in the child process.
We now unblock all signals before we exec the child.
It's also worth noting that if we _ignore_ a signal -
sigaction(SIG_IGN) - this is also inherited and we must reset it to
default. However, we do not ignore signals so this is unneeded.
Here is some more discussion on signalfd and this problem:
https://lwn.net/Articles/415684/
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 28 Jan 2012 11:38:11 +0000 (12:38 +0100)]
kbd-dumb: fix log_warning -> log_warn
We recently moved log_warning to log_warn and I forgot to fix it when
merging the kbd-dumb backend. Fix this now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 27 Jan 2012 10:04:51 +0000 (12:04 +0200)]
build: fix out-of-tree build and distcheck
The paths can be off when building out of tree, so have make put them in
for us instead. This requires turning the straight genshader.c file to a
template.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 17 Jan 2012 22:09:16 +0000 (00:09 +0200)]
kbd: add a new "dumb" keyboard backend
This commit adds a very simple keyboard backend which does basic keycode
interpretation. It is used as a fallback when xkbcommon is unavailable
or is not required.
See the file header for what is supported.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 17 Jan 2012 22:03:16 +0000 (00:03 +0200)]
build: depend on xproto explicitly
Currently it's required by xkbcommon. However, we will need it for other
backends as well, even with xkbcommon support disabled.
xproto consisted only of static header files. We use the XK_ keysym
definitions. It is therefore only required during compilation and we
shouldn't needlessly duplicate it ourselves.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 28 Jan 2012 11:14:48 +0000 (12:14 +0100)]
xkb: fix merge failure
Merging the big xkb cleanup reversed the previous modifier state change.
Fix this now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 24 Jan 2012 14:29:55 +0000 (15:29 +0100)]
log: move log_warning to log_warn
log_warn is much shorter and we already use log_err instead of log_error
so this is more consistent now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 24 Jan 2012 14:14:15 +0000 (15:14 +0100)]
context: use GL_RGBA when full OpenGL is used
GL_BGRA_EXT as internal format is not supported with full OpenGL so we
must use GL_RGBA as internal format.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 24 Jan 2012 14:10:16 +0000 (15:10 +0100)]
eloop: remove verbose debug messages
These dispatch debug messages are currently no longer needed and just
fill the log needlessly.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 10 Jan 2012 00:52:42 +0000 (02:52 +0200)]
test_terminal: wait on children to avoid zombies
Unfortunately, there is no clean way I see to hook this up from the pty
object. We can (and will) have more than one pty object opened at a
time, but the semantics of signalfd make it impossible to deliver each
SIGCHLD to its rightful owner without complicating things.
[ From what I tested:
- If you have two signalfd's listening to the same signal, they will be
dispatched in some round-robin manner.
- Also, if more than one child exits before we read signalfd (possibly
beloging to different terminals), they will be compressed to one
event. ]
We therefore need to do the reaping from a central location, and need to
remember to copy this snippet over to main.c in the future.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 13 Jan 2012 10:53:46 +0000 (12:53 +0200)]
terminal: use new pty object
Add a new terminal_open/terminal_close methods to correspond to the pty
ones, and notify when the terminal is closed.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 13 Jan 2012 10:42:13 +0000 (12:42 +0200)]
Add pseudo terminal support
This commit adds a new pty object.
The pty object takes care of all pseudo terminal handling, reading and
writing. It can be opened and closed, and notify through callbacks when
input arrives or the child process exits/dies. It can also receive input
and pass it along to the child process.
There is not yet any real VTE processing, so we display raw escape
codes and so on. However, this should provide immediate feedback for
any further vte development, as we start to act like a real terminal
emulator.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 17 Jan 2012 22:14:16 +0000 (00:14 +0200)]
test_input: simplify and drop xkbcommon dependency
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 17 Jan 2012 21:57:11 +0000 (23:57 +0200)]
input, xkb: port to new kbd object
This commit ports the XKB handling to the new kbd interface, and makes
the input subsystem use it without any direct knowledge of XKB.
Some code is moved around but there are no functional changes.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 17 Jan 2012 21:12:44 +0000 (23:12 +0200)]
Add skeleton for multiple keyboard handling backends
This defines the API the keyboard backends will need to implement. It is
based on what's in input_xkb.h but cleaned up and simplified.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 22 Jan 2012 21:49:33 +0000 (22:49 +0100)]
font: add debug messages
Add debug messages to freetype font backend.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 22 Jan 2012 21:44:12 +0000 (22:44 +0100)]
font: rewrite font backend
We now properly draw fonts with OpenGL. We now use FreeType2 instead of
pango to avoid big dependencies.
We also add a DejaVu font so we currently don't have to deal with font
selection.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 22 Jan 2012 21:42:53 +0000 (22:42 +0100)]
math: new helper backend for linear algebra
We use this to perform proper matrix transformations.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 22 Jan 2012 12:51:23 +0000 (13:51 +0100)]
font: require compositor reference
To avoid cairo dependencies we now take a compositor reference in the
font backend so fonts can be drawn with GL textures instead of cairo.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 22 Jan 2012 12:47:55 +0000 (13:47 +0100)]
font: fix memleak in freetype backend
We didn't unref the symbol table correctly. Fix it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 20 Jan 2012 17:11:03 +0000 (18:11 +0100)]
context: add GLES2 support
OpenGL pulls in lot of X dependencies on linux. To avoid this we also
support OpenGLES2 now. This will also allow to run kmscon on
embedded/mobile platforms.
We still get X dependencies through EGL which we cannot avoid as EGL is
compiled with multiple backends on most systems. However, switching to
GLES2 reduces memory footprint by 30MB which is pretty good.
This also enables GLES2 as default in autogen.sh. However, default
behaviour of configure will still be GL.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 20 Jan 2012 17:07:52 +0000 (18:07 +0100)]
context: use BGRA_EXT texture internally
Some GLES2 implementations do not support RGBA so use BGRA internally,
too.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 20 Jan 2012 16:15:18 +0000 (17:15 +0100)]
context: warn on shader creation error
If we cannot allocate a shader object we should write a message to the
log.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 20 Jan 2012 15:52:58 +0000 (16:52 +0100)]
context: first initialize EGL then find functions
We should first create a GL context before we try to find GL functions
to avoid errors on some platforms.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 20 Jan 2012 15:11:30 +0000 (16:11 +0100)]
context: use GL_TRIANGLES instead of GL_QUADS
GL_QUADS may actually be not supported on some embedded platforms so we
use GL_TRIANGLES.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 20 Jan 2012 15:01:30 +0000 (16:01 +0100)]
context: use GL_BGRA_EXT to avoid undeclared exts
GL_BGRA is not declared on older systems so we use the extension
constant.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 20 Jan 2012 14:58:50 +0000 (15:58 +0100)]
context: fix wrong GL func declaration
I copied the wrong declaration. This fixes this.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 20 Jan 2012 14:52:54 +0000 (15:52 +0100)]
terminal: replace GL functions with new context subs
We should use the context of the compositor instead of directly calling
the GL functions to avoid direct dependencies.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Wed, 18 Jan 2012 16:54:48 +0000 (18:54 +0200)]
xkb: don't fill events purely for modifiers
We have no use for Control_L or Alt_R by themselves, the information is
in the "mods" field.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 10 Jan 2012 22:43:01 +0000 (00:43 +0200)]
terminal: also unref the idle object
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 20 Jan 2012 14:45:58 +0000 (15:45 +0100)]
console: use new drawing pipeline
Instead of drawing with fixed-function GL pipeline we now use our own
shader for texture drawing. This also fixes test_console to no longer
depend on GL.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 20 Jan 2012 14:35:32 +0000 (15:35 +0100)]
console: avoid code duplication in cairo destruction code
We can use our destruction function to avoid code duplication.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 20 Jan 2012 14:34:21 +0000 (15:34 +0100)]
context: enable blend by default
Enable blending by default.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 18 Jan 2012 18:11:14 +0000 (19:11 +0100)]
output: use UniformMatrix4fv instead of ~2fv
We use a 4x4 matrix so we should use the correct uniform handler.
Otherwise we might get errors on some GL implementations.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 18 Jan 2012 17:09:08 +0000 (18:09 +0100)]
console: take reference of compositor
To switch to the new drawing subsystem we need a reference to a valid
compositor object so we can retrieve the GL context.
This also applies to the terminal object.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 18 Jan 2012 14:54:59 +0000 (15:54 +0100)]
test_output: use new drawing pipeline
This converts the output test function to use the new kmscon_context for
drawing operations so we no longer depend directly on GL.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 18 Jan 2012 14:54:26 +0000 (15:54 +0100)]
output: add function to draw colored vertices
The new function kmscon_context_draw_def() can draw colored quads to the
screen.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 18 Jan 2012 14:52:45 +0000 (15:52 +0100)]
output: add default shader
Besides the texture shader this also adds a second shader (def/default)
which is used to draw arbitrary colored vertices to the screen.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 18 Jan 2012 13:01:42 +0000 (14:01 +0100)]
output: add function to retrieve context
Allow other subsystems to retrieve the context of a compositor. The
context has no reference count as it is tied to the compositor.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 17 Jan 2012 14:19:43 +0000 (15:19 +0100)]
output: add shader support
To avoid the fixed function pipeline we should use shaders instead of
old glBegin/glEnd. This patch adds two basic shaders and functions that
load and initialize them.
To avoid loading the shaders at runtime we generate a source file which
contains them as strings so they are embedded in the binary.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 16 Jan 2012 16:37:42 +0000 (17:37 +0100)]
output: move EGL/GL calls into separate header
This splits off all EGL/GL calls into output_context.c. This way we can
replace the backend of the drawing functions very easily.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 11 Jan 2012 14:28:06 +0000 (15:28 +0100)]
output: remove *_get_fd
There is no need to retrieve the fd of the compositor as we now have an
eloop subsystem which takes care of event handling.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 11 Jan 2012 14:25:20 +0000 (15:25 +0100)]
output: add header protection
output.h was missing an include-protection.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 11 Jan 2012 14:22:05 +0000 (15:22 +0100)]
output: replace "DRI" with "DRM" in comments
We work with DRM not DRI so fix the comments.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 8 Jan 2012 23:28:36 +0000 (01:28 +0200)]
vt: add a few CLOEXEC's
These are the only open() calls missing the flag.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 8 Jan 2012 22:57:15 +0000 (00:57 +0200)]
input: make "us" default layout, override by env vars
The other layouts can be confusing.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 8 Jan 2012 22:48:39 +0000 (00:48 +0200)]
log: make sure not to override errno
This makes things easier in the common case of
<some error> -> <log error> -> <goto error handler> - <do something with
errno>
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 8 Jan 2012 22:47:25 +0000 (00:47 +0200)]
eloop: allow reporting error conditions
Add KMSCON_ERR, the equivalent of EPOLLERR.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sat, 31 Dec 2011 10:39:09 +0000 (12:39 +0200)]
Fix compiler sign-mismatch warnings
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sat, 31 Dec 2011 10:31:53 +0000 (12:31 +0200)]
test_console: fix use-after-free
Here's how it goes:
1. stdin reaches EOF, kmscon_eloop_rm_fd is called on stdin_fd.
2. The fd object is freed, the memory is reused in the meantime.
3. rm_fd is called again in destroy_eloop.
4. con->stdin_fd points to garbage and we get a segmentation fault.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 8 Jan 2012 23:14:11 +0000 (01:14 +0200)]
font_pango: fix uninitialized variable
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 8 Jan 2012 23:08:58 +0000 (01:08 +0200)]
a few cosmetic changes
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 22:39:23 +0000 (23:39 +0100)]
Update README to include new dependencies
Rework dependency list and also add new configure flags.
We also update the subsystem list.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 22:27:13 +0000 (23:27 +0100)]
Add configure to autogen.sh
Use ./autogen.sh --<options> to run autogen with configure in one call.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 22:26:10 +0000 (23:26 +0100)]
Avoid installing doc files with "make install"
Move all documentation into EXTRA_DIST, otherwise it gets installed systemwide.
And probably no one is interested in having the README installed in the system.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 22:19:40 +0000 (23:19 +0100)]
configure: fix debug option NDEBUG definition
We currently define NDEBUG only if --<set>-debug is not specified at all. That
is, --disable-debug currently has almost no effect.
This fixes this bug and also corrects a wrong parenthesis.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 22:11:48 +0000 (23:11 +0100)]
font: add unfinished freetype backend
This is a first attempt of a freetype2 backend for the font drawing functions.
This avoids the heavy pango/cairo dependencies, although, we might lose
important font handling that pango does for us like correctly drawing combined
characters.
This is still a stub implementation. The drawing operations are not supported,
yet. Use --enable-pango during configure to enable the still working pango
backend.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 22:04:13 +0000 (23:04 +0100)]
Update TODO
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 17:27:09 +0000 (18:27 +0100)]
font: move font handling into new subsystem
We use a new font factory which is used to create a new font. It will later also
be used to cache fonts and select proper system fonts.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 16:45:57 +0000 (17:45 +0100)]
Remove kmscon_char implementation
It was superceded by kmscon_symbol_t and is no longer used.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 16:43:57 +0000 (17:43 +0100)]
Adjust all code to use new kmscon_symbol_t
This is a big performance boost and reduces the code size quite a bit.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 16:42:57 +0000 (17:42 +0100)]
unicode: provide utf8 converter
Allow converting a ucs4 string into a utf8 string. Also export the default
symbol so other subsystems may use it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 15:52:30 +0000 (16:52 +0100)]
test_buffer: add kmscon_symbol_t test
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 15:47:06 +0000 (16:47 +0100)]
Add faster kmscon_char replacement
Instead of allocating big buffers with kmscon_char's for every character we now
reduce a single character to an integer. This integer is either the Unicode
codepoint or an ID to an internally allocated string.
The so called kmscon_symbol_t integer can now be used as if it were a classic
"char" value without bothering with combining marks etc.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 16:38:46 +0000 (17:38 +0100)]
test_terminal: add experimental input support
Add input subsystem to terminal test app. This currently allows to actually
"write" to the console. There is still much to do to convert the input to proper
data but basic alphanumeric characters work for now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 16:38:17 +0000 (17:38 +0100)]
console: add UCS4 to UTF8 conversion
Allow to create new kmscon_char objects with UCS4 input.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 30 Dec 2011 21:08:42 +0000 (23:08 +0200)]
Update TODO regarding input subsystem
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 30 Dec 2011 20:48:46 +0000 (22:48 +0200)]
input: define our own modifiers
Just a direct mapping to X modifiers for now (= Shift, Control,
Lock, Mod1-5).
This gives us more flexibility to adapt it to our needs in the future.
Also we don't have to include libxkbcommon headers just for the modifier
definitions.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 30 Dec 2011 20:00:07 +0000 (22:00 +0200)]
input: don't use 0 to signal lack of unicode value
0 is actually a valid unicode value, so instead we use
KMSCON_INPUT_INVALID which is not legal unicode.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 30 Dec 2011 16:46:20 +0000 (18:46 +0200)]
input: shuffle headers and includes
Just some renames/moving/prefixing to conform to the style of the
other files.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 30 Dec 2011 16:06:32 +0000 (18:06 +0200)]
Correctly set Xlib copyright headers
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Thu, 29 Dec 2011 19:46:56 +0000 (21:46 +0200)]
xkb: fix group wrapping
- Use the number of groups we actually have instead of the maximum
number of groups, when wrapping according to group_wrap control.
- Be careful with negative relative group actions. The group fields of
xkb_state are all unsigned (and have a weird FIXME..), so don't use
them directly.
- Add the grp:ctrl_shift_toggle option to the rmlvo set to also test
locking the previous group (i.e. a negative relative group action).
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Wed, 28 Dec 2011 20:05:47 +0000 (22:05 +0200)]
xkb: refactor keysym compat_init into a separate function
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Wed, 28 Dec 2011 19:43:55 +0000 (21:43 +0200)]
input: fix formatting
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 15:24:14 +0000 (16:24 +0100)]
input: fix open() call parameters
Third argument of open() is for file creation flags and nor for file open flags.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Wed, 28 Dec 2011 09:55:50 +0000 (11:55 +0200)]
xkb: latches were not always released correctly
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Wed, 28 Dec 2011 09:55:11 +0000 (11:55 +0200)]
xkb: filter unwanted repeats
We can disable repeats globally or per-key. Also any modifier
keys should not repeat.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 27 Dec 2011 21:07:26 +0000 (23:07 +0200)]
xkb: comment out LevelOneOnly handling
Stuff like grp:ctrl_shift_toggle didn't work because of it.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 27 Dec 2011 15:28:16 +0000 (17:28 +0200)]
input: use libxkbcommon to convert input events
This commit introduces a new kmscon_input_event structure which is
delivered to the input consumer. The information provided is
- The evdev scancode (=physical keyboard key).
- The X keysym (a symbol representing what the typist really intended).
- The active modifiers (e.g. Shift, Control..)
- The unicode (UCS-4) value, when it makes sense.
To achieve this we add two dependencies:
- libxkbcommon (this entails xproto and kbproto, but shouldn't bring any of
big X dependencies)
- A function to translate keysyms to unicode values (taken from xlib,
copied in-tree).
libxkbcommon is not an all-around solution, and requires various degrees
of supporting code, depending on how much we wish to support. This
commit implements the common, basic uses:
- Choosing layouts, variants and options
- Switching groups
- Switching shift-levels
- Setting modifiers
Though some stuff is missing. Further information in the comments.
test_input.c is updated to use the new input event interface. You can
change the layouts in input.c:init_input() and see what works and what
doesn't.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 11:46:15 +0000 (12:46 +0100)]
Add Ran Benita to authors list
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 11:44:10 +0000 (12:44 +0100)]
input: do not take reference of parent input object
This is currently broken, anyway as we do not unref the object. However, if we
take a reference, then kmscon_input_unref() would never destroy the object as
there are still references. The caller would have to call kmscon_input_sleep()
first to have the desired effect.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 11:39:42 +0000 (12:39 +0100)]
input: silently ignore devices without device-node
We either need to adjust our filters to only receive inputX/eventY events or we
simply ignore all other events silently to avoid useless warnings.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 13 Dec 2011 12:10:01 +0000 (14:10 +0200)]
tests: add test for the input subsystem
It should:
- Capture your keypresses
- Announce when a device is added or removed (with --enable-debug)
- stop/start capturing on SIGQUIT (Ctrl-\)
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 11:04:17 +0000 (12:04 +0100)]
input: rearrange code to avoid forward declarations
The diff may look a bit wild but this mostly fixes coding style issues:
- sort includes alphabetically
- add missing includes
- rearrange structures/functions to avoid forward declarations
- adding "data" user-defineable field to input structure (for callbacks)
- correctly handle errors in device_data_arrived
- remove device_added/device_removed
- merge input_init into constructor
- add some log messages for debugging
- remove devices when wake-up fails
- set cb/data fields on eloop connection, not on initialization
- remove all devices when disconnecting eloop so the eloop is guaranteed to be
not used by the input subsystem after disconnection.
- some error handling fixes
- remove some TODOs which are correctly implemented
- Add O_NONBLOCK when opening the device node (I don't know how it actually
worked without it in the data_arrived callback)
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 13 Dec 2011 12:00:44 +0000 (14:00 +0200)]
input: add infrastructure for an input subsystem
This does all the boring stuff for an input subsystem:
- Input device discovery using udev
- Input device hotplug (add/remove)
- Reading the evdev data from the devices
- Publishing input events to a callback through the eloop
- Suspending and resuming the input capture
Currently the delivered input events are basically just evdev's
"struct input_event" (type, code, value). More work is required to
have it pass out useful data.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 17:01:00 +0000 (18:01 +0100)]
terminal: add dummy terminal implementation
vte: This adds a dummy VTE subsystem. It will be used to emulate a vt100
terminal based on our console subsystem.
terminal: This ties together several subsystems including the output-, the
console- and the vte-subsystem.
The test_terminal test application can be used to test the terminal. It is
supposed to provide a full vt100 implementation which is displayed on all
available screens.
Most of the functionality here is not implemented yet and only a dummy function.
These will be added in later commits.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 16:13:15 +0000 (17:13 +0100)]
output: add debug and error messages
Print useful debug and error messages to the global log file.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 16:08:01 +0000 (17:08 +0100)]
console: fix debug messages for buffer objects
It doesn't make sense to print the size of new buffer objects as the resize
function does the same. We also currently access uninitialized memory here so it
is useless anyway.
Also move the message of the unref function to be consistent with other objects.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 15:48:20 +0000 (16:48 +0100)]
test_console: fix call to kmscon_comp*_use
We should activate the GL context on initialization to allow other subsystems to
create GL objects.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 15:44:28 +0000 (16:44 +0100)]
test_output: handle kmscon_comp*_use failure
Move the call before the wakeup and also check its return code.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 15:40:49 +0000 (16:40 +0100)]
output: allow kmscon_compositor_use to be called when asleep
There is no reason to prohibit a compositor from activating its GL context while
being asleep. It is even recommended to activate the GL context when being
asleep as there is no other way to initialize other subsystems without an GL
context.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 15:36:48 +0000 (16:36 +0100)]
output: fix dropping master priviledges on wakeup
If wakeup fails we should drop master priviledges again, otherwise we might
break other applications.
Also remove the SetMaster call on compositor initialization. It is redundant and
not needed by us.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 12:47:36 +0000 (13:47 +0100)]
vt: fix race-condition in signal handling
Currently, we set up our VT with SIGUSR1/2 signals and after that the user may
connect the signal handlers to the eloop. However, if we receive a signal in
between, the signal gets lost.
Therefore, this simply merges the kmscon_vt_connect_eloop function into
kmscon_vt_open as there is no obvious reason to split them.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 20:30:37 +0000 (21:30 +0100)]
output: add helper to check whether output is awake
If we have only an output but not the related compositor we currently cannot
figure out whether this output is awake. This adds such a helper function.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 13:46:22 +0000 (14:46 +0100)]
test_console: fix console deinitialization bug
We must not destroy the compositor object if there is still a console using the
GL context. Otherwise we get a SEGFAULT when calling any gl* function.
In future we may need propoper dependencies here. We use reference counts so
this should be easy to implement.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 13:27:03 +0000 (14:27 +0100)]
test_console: copy stdin to console output
Add new fd to eloop that copies stdin to console output.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 13:24:31 +0000 (14:24 +0100)]
console: add newline function
kmscon_console_newline() can be used to produce a newline. Writing \n doesn't
work as this would write \n as character into the cell and not produce a
newline.
The console does not perform any parsing so we provide a separate function.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 12:59:50 +0000 (13:59 +0100)]
Update TODO
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>