From 4c591a86bdc43b1a2ddb00409262157b04ddaa31 Mon Sep 17 00:00:00 2001 From: Drakulix Date: Sat, 15 Apr 2017 22:34:28 +0200 Subject: [PATCH] Add initializer --- src/backend/libinput.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/backend/libinput.rs b/src/backend/libinput.rs index 5cfa336..1a5d3b2 100644 --- a/src/backend/libinput.rs +++ b/src/backend/libinput.rs @@ -22,6 +22,22 @@ pub struct LibinputInputBackend { logger: ::slog::Logger, } +impl LibinputInputBackend { + pub fn new(context: Libinput, logger: L) -> Self + where L: Into> + { + 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 { type InputConfig = [Device]; type EventError = IoError;