1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00

add stub renderable for muxed tab

This commit is contained in:
Wez Furlong 2019-06-09 12:44:22 -07:00
parent e55233aa3d
commit 661daa4f77

View File

@ -4,15 +4,20 @@ use crate::mux::tab::{alloc_tab_id, Tab, TabId};
use crate::server::domain::ClientInner;
use failure::{bail, Fallible};
use portable_pty::PtySize;
use std::cell::RefCell;
use std::cell::RefMut;
use std::ops::Range;
use std::sync::Arc;
use term::color::ColorPalette;
use term::{CursorPosition, Line};
use term::{KeyCode, KeyModifiers, MouseEvent, TerminalHost};
use termwiz::hyperlink::Hyperlink;
pub struct ClientTab {
client: Arc<ClientInner>,
local_tab_id: TabId,
remote_tab_id: TabId,
renderable: RefCell<RenderableState>,
}
impl ClientTab {
@ -22,6 +27,7 @@ impl ClientTab {
client: Arc::clone(client),
remote_tab_id,
local_tab_id,
renderable: RefCell::new(RenderableState { dirty: true }),
}
}
}
@ -31,7 +37,7 @@ impl Tab for ClientTab {
self.local_tab_id
}
fn renderer(&self) -> RefMut<dyn Renderable> {
panic!("ClientTab::renderer not impl");
self.renderable.borrow_mut()
}
fn get_title(&self) -> String {
@ -78,3 +84,37 @@ impl Tab for ClientTab {
self.client.local_domain_id
}
}
struct RenderableState {
dirty: bool,
}
impl Renderable for RenderableState {
fn get_cursor_position(&self) -> CursorPosition {
CursorPosition::default()
}
fn get_dirty_lines(&self) -> Vec<(usize, &Line, Range<usize>)> {
vec![]
}
fn has_dirty_lines(&self) -> bool {
self.dirty
}
fn make_all_lines_dirty(&mut self) {
self.dirty = true;
}
fn clean_dirty_lines(&mut self) {
self.dirty = false;
}
fn current_highlight(&self) -> Option<Arc<Hyperlink>> {
None
}
fn physical_dimensions(&self) -> (usize, usize) {
(24, 80)
}
}