use std::ffi::OsString;
use super::{
Chainable, Effects, Op, Operation, PaneSlot, PaneTarget, Part, Safety, Scope, SessionSlot,
SessionTarget, Slot, WindowSlot, WindowTarget,
};
const SESSION_FORMAT: &str = "#{session_id} #{window_id} #{pane_id}";
const WINDOW_FORMAT: &str = "#{window_id} #{pane_id}";
const PANE_FORMAT: &str = "#{pane_id}";
type Resolver<'a> = &'a dyn Fn(usize, Part) -> Option<OsString>;
macro_rules! operation {
(
$name:ident,
creates = $creates:ty,
effects = $effects:expr,
safety = $safety:expr,
chainable
) => {
operation!(
$name,
creates = $creates,
effects = $effects,
safety = $safety
);
impl Chainable for $name {}
};
(
$name:ident,
creates = $creates:ty,
effects = $effects:expr,
safety = $safety:expr
) => {
impl Operation for $name {
type Creates = $creates;
const EFFECTS: Effects = $effects;
const SAFETY: Safety = $safety;
}
impl From<$name> for Op {
fn from(operation: $name) -> Self {
Self::$name(operation)
}
}
};
}
mod options;
mod panes;
mod sessions;
mod windows;
pub use options::{SetEnvironment, SetOption};
pub use panes::{CapturePane, KillPane, SelectPane, SendKeys, SplitWindow};
pub use sessions::NewSession;
pub use windows::{KillWindow, NewWindow, RenameWindow, SelectLayout, SelectWindow};