Add initializer

This commit is contained in:
Drakulix 2017-04-15 22:34:28 +02:00
parent 8cbe96d1ac
commit 4c591a86bd
1 changed files with 16 additions and 0 deletions

View File

@ -22,6 +22,22 @@ pub struct LibinputInputBackend {
logger: ::slog::Logger, logger: ::slog::Logger,
} }
impl LibinputInputBackend {
pub fn new<L>(context: Libinput, logger: L) -> Self
where L: Into<Option<::slog::Logger>>
{
let log = ::slog_or_stdlog(logger).new(o!("smithay_module" => "backend_libinput"));
info!(log, "Initializing a libinput backend");
LibinputInputBackend {
context: context,
devices: Vec::new(),
seats: HashMap::new(),
handler: None,
logger: log,
}
}
}
impl InputBackend for LibinputInputBackend { impl InputBackend for LibinputInputBackend {
type InputConfig = [Device]; type InputConfig = [Device];
type EventError = IoError; type EventError = IoError;