aboutsummaryrefslogtreecommitdiffstats
path: root/src/widgets/widget.rs
blob: 4745713c9fc3fccbc9c2669ec52eff990d1029de (plain) (blame)
1
2
3
4
5
6
7
8
9
10
use crate::config::ZellijState;

pub trait Widget {
    fn process(&self, name: &str, state: &ZellijState) -> String;
    /// `is_double_click` is true when this is the second click of a
    /// double-click at the same position. Detected centrally in
    /// ModuleConfig::handle_mouse_action, because widgets are held behind &self
    /// and cannot keep click state of their own.
    fn process_click(&self, name: &str, state: &ZellijState, pos: usize, is_double_click: bool);
}