From 5241b8f79e13ac770732e475879bbdc8f80ab943 Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Thu, 21 Sep 2017 19:42:19 +0200 Subject: [PATCH] seat: directory structure --- src/lib.rs | 2 +- src/{keyboard/mod.rs => seat/keyboard.rs} | 28 +++++++---------------- src/seat/mod.rs | 3 +++ 3 files changed, 12 insertions(+), 21 deletions(-) rename src/{keyboard/mod.rs => seat/keyboard.rs} (92%) create mode 100644 src/seat/mod.rs diff --git a/src/lib.rs b/src/lib.rs index 2598c77..0ab2e73 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,7 +44,7 @@ extern crate error_chain; pub mod backend; pub mod compositor; pub mod shm; -pub mod keyboard; +pub mod seat; pub mod shell; fn slog_or_stdlog(logger: L) -> ::slog::Logger diff --git a/src/keyboard/mod.rs b/src/seat/keyboard.rs similarity index 92% rename from src/keyboard/mod.rs rename to src/seat/keyboard.rs index 12ca3d1..113f130 100644 --- a/src/keyboard/mod.rs +++ b/src/seat/keyboard.rs @@ -1,22 +1,3 @@ -//! Utilities for keyboard handling -//! -//! This module provides utilities for keyboardand keymap handling: keymap interpretation -//! and forwarding keystrokes to clients using xkbcommon. -//! -//! You can first create a `KbdHandle` using the `create_keyboard_handler` function in this module. -//! The handle you obtained can be cloned to access this keyboard state from different places. It is -//! expected that such a context is created for each keyboard the compositor has access to. -//! -//! This handle gives you 3 main ways to interact with the keymap handling: -//! -//! - send the keymap information to a client using the `KbdHandle::send_keymap` method. -//! - set the current focus for this keyboard: designing the client that will receive the key inputs -//! using the `KbdHandle::set_focus` method. -//! - process key inputs from the input backend, allowing them to be catched at the compositor-level -//! or forwarded to the client. See the documentation of the `KbdHandle::input` method for -//! details. - - use backend::input::KeyState; use std::io::{Error as IoError, Write}; use std::os::unix::io::AsRawFd; @@ -228,7 +209,14 @@ struct KbdArc { /// It can be cloned and all clones manipulate the same internal state. Clones /// can also be sent across threads. /// -/// See module-level documentation for details of its use. +/// This handle gives you 3 main ways to interact with the keymap handling: +/// +/// - register new `wl_keyboard` instances to it with the `new_kbd` method. +/// - set the current focus for this keyboard: designing the surface that will receive the key inputs +/// using the `KbdHandle::set_focus` method. +/// - process key inputs from the input backend, allowing them to be catched at the compositor-level +/// or forwarded to the client. See the documentation of the `KbdHandle::input` method for +/// details. #[derive(Clone)] pub struct KbdHandle { arc: Arc, diff --git a/src/seat/mod.rs b/src/seat/mod.rs new file mode 100644 index 0000000..ab1e419 --- /dev/null +++ b/src/seat/mod.rs @@ -0,0 +1,3 @@ +mod keyboard; + +pub use self::keyboard::{KbdHandle, Error as KbdError, create_keyboard_handler}; \ No newline at end of file