aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/input
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2021-03-18 22:37:25 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2021-05-04 20:47:51 +0530
commit0d814ebcde98659babeaaa71a3ad5ee720021fc4 (patch)
tree28b136c7ebde8f00375712c3fcec38992e81a60e /src/common/input
parentwip: remove the commands that are called only on the client (diff)
downloadsl0ppij-0d814ebcde98659babeaaa71a3ad5ee720021fc4.tar.gz
sl0ppij-0d814ebcde98659babeaaa71a3ad5ee720021fc4.tar.xz
sl0ppij-0d814ebcde98659babeaaa71a3ad5ee720021fc4.zip
Divide OsApi into ClientOsApi and ServerOsApi and move calls to os thread
Diffstat (limited to 'src/common/input')
-rw-r--r--src/common/input/handler.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/common/input/handler.rs b/src/common/input/handler.rs
index f8f07f53..b74e2929 100644
--- a/src/common/input/handler.rs
+++ b/src/common/input/handler.rs
@@ -5,7 +5,7 @@ use super::keybinds::Keybinds;
use crate::common::input::config::Config;
use crate::common::{AppInstruction, SenderWithContext, OPENCALLS};
use crate::errors::ContextType;
-use crate::os_input_output::OsApi;
+use crate::os_input_output::ClientOsApi;
use crate::pty_bus::PtyInstruction;
use crate::screen::ScreenInstruction;
use crate::wasm_vm::PluginInstruction;
@@ -19,8 +19,7 @@ use zellij_tile::data::{Event, InputMode, Key, ModeInfo, Palette};
struct InputHandler {
/// The current input mode
mode: InputMode,
- os_input: Box<dyn OsApi>,
- config: Config,
+ os_input: Box<dyn ClientOsApi>,
command_is_executing: CommandIsExecuting,
send_screen_instructions: SenderWithContext<ScreenInstruction>,
send_plugin_instructions: SenderWithContext<PluginInstruction>,
@@ -31,7 +30,7 @@ struct InputHandler {
impl InputHandler {
/// Returns a new [`InputHandler`] with the attributes specified as arguments.
fn new(
- os_input: Box<dyn OsApi>,
+ os_input: Box<dyn ClientOsApi>,
command_is_executing: CommandIsExecuting,
config: Config,
send_screen_instructions: SenderWithContext<ScreenInstruction>,
@@ -336,8 +335,7 @@ pub fn get_mode_info(mode: InputMode, palette: Palette) -> ModeInfo {
/// Entry point to the module. Instantiates an [`InputHandler`] and starts
/// its [`InputHandler::handle_input()`] loop.
pub fn input_loop(
- os_input: Box<dyn OsApi>,
- config: Config,
+ os_input: Box<dyn ClientOsApi>,
command_is_executing: CommandIsExecuting,
send_screen_instructions: SenderWithContext<ScreenInstruction>,
send_plugin_instructions: SenderWithContext<PluginInstruction>,