seat: directory structure

This commit is contained in:
Victor Berger 2017-09-21 19:42:19 +02:00
parent 2850def0f4
commit 5241b8f79e
3 changed files with 12 additions and 21 deletions

View File

@ -44,7 +44,7 @@ extern crate error_chain;
pub mod backend; pub mod backend;
pub mod compositor; pub mod compositor;
pub mod shm; pub mod shm;
pub mod keyboard; pub mod seat;
pub mod shell; pub mod shell;
fn slog_or_stdlog<L>(logger: L) -> ::slog::Logger fn slog_or_stdlog<L>(logger: L) -> ::slog::Logger

View File

@ -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 backend::input::KeyState;
use std::io::{Error as IoError, Write}; use std::io::{Error as IoError, Write};
use std::os::unix::io::AsRawFd; 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 /// It can be cloned and all clones manipulate the same internal state. Clones
/// can also be sent across threads. /// 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)] #[derive(Clone)]
pub struct KbdHandle { pub struct KbdHandle {
arc: Arc<KbdArc>, arc: Arc<KbdArc>,

3
src/seat/mod.rs Normal file
View File

@ -0,0 +1,3 @@
mod keyboard;
pub use self::keyboard::{KbdHandle, Error as KbdError, create_keyboard_handler};