mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-30 08:03:59 +00:00
Adapter for connecting input and event servers
This is an intermediate helper component for the transition of input servers into event clients. It works analogously to the input_event_bridge but it connects servers instead of clients. In particular, it can act as glue between a traditional input driver that provides an input service and the event filter that provides an event service. Thanks to this component, each driver can be migrated to the event-client interface individually. Issue #3827
This commit is contained in:
parent
7932c76d85
commit
7bac1ec7e5
2
repos/os/recipes/src/input_event_client/content.mk
Normal file
2
repos/os/recipes/src/input_event_client/content.mk
Normal file
@ -0,0 +1,2 @@
|
||||
SRC_DIR = src/app/input_event_client
|
||||
include $(GENODE_DIR)/repos/base/recipes/src/content.inc
|
1
repos/os/recipes/src/input_event_client/hash
Normal file
1
repos/os/recipes/src/input_event_client/hash
Normal file
@ -0,0 +1 @@
|
||||
2020-07-16 e6f7f44533e117edd6eb6c79d271ccacef345bb1
|
4
repos/os/recipes/src/input_event_client/used_apis
Normal file
4
repos/os/recipes/src/input_event_client/used_apis
Normal file
@ -0,0 +1,4 @@
|
||||
base
|
||||
os
|
||||
event_session
|
||||
input_session
|
48
repos/os/src/app/input_event_client/main.cc
Normal file
48
repos/os/src/app/input_event_client/main.cc
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* \brief Application for connecting an input server with an event server
|
||||
* \author Norman Feske
|
||||
* \date 2020-07-16
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2020 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <event_session/connection.h>
|
||||
#include <input_session/connection.h>
|
||||
#include <base/component.h>
|
||||
|
||||
namespace Input_event_client {
|
||||
using namespace Genode;
|
||||
struct Main;
|
||||
}
|
||||
|
||||
|
||||
struct Input_event_client::Main
|
||||
{
|
||||
Env &_env;
|
||||
|
||||
Input::Connection _input { _env };
|
||||
Event::Connection _event { _env };
|
||||
|
||||
Signal_handler<Main> _input_handler { _env.ep(), *this, &Main::_handle_input };
|
||||
|
||||
void _handle_input()
|
||||
{
|
||||
_event.with_batch([&] (Event::Session_client::Batch &batch) {
|
||||
_input.for_each_event([&] (Input::Event const &event) {
|
||||
batch.submit(event); }); });
|
||||
}
|
||||
|
||||
Main(Env &env) : _env(env) { _input.sigh(_input_handler); }
|
||||
};
|
||||
|
||||
|
||||
void Component::construct(Genode::Env &env)
|
||||
{
|
||||
static Input_event_client::Main inst(env);
|
||||
}
|
3
repos/os/src/app/input_event_client/target.mk
Normal file
3
repos/os/src/app/input_event_client/target.mk
Normal file
@ -0,0 +1,3 @@
|
||||
TARGET = input_event_client
|
||||
SRC_CC = main.cc
|
||||
LIBS = base
|
Loading…
x
Reference in New Issue
Block a user