remove old coarse pdus

This commit is contained in:
Wez Furlong committed 2019-06-20 21:38:08 -07:00
1 parent 760f9f25de
commit 938eb5e1cf
3 files changed
-77

No files matched your search

-5
View File
@@ -300,11 +300,6 @@ impl Client {
rpc!(ping, Ping = (), Pong);
rpc!(list_tabs, ListTabs = (), ListTabsResponse);
rpc!(
get_coarse_tab_renderable_data,
GetCoarseTabRenderableData,
GetCoarseTabRenderableDataResponse
);
rpc!(spawn, Spawn, SpawnResponse);
rpc!(write_to_tab, WriteToTab, UnitResponse);
rpc!(send_paste, SendPaste, UnitResponse);
-33
View File
@@ -19,10 +19,7 @@ use log::debug;
use portable_pty::{CommandBuilder, PtySize};
use serde_derive::*;
use std::io::Cursor;
use std::sync::Arc;
use term::selection::SelectionRange;
use term::{CursorPosition, Line};
use termwiz::hyperlink::Hyperlink;
use termwiz::surface::{Change, SequenceNo};
use varbincode;
@@ -221,8 +218,6 @@ pdu! {
Pong: 2,
ListTabs: 3,
ListTabsResponse: 4,
GetCoarseTabRenderableData: 5,
GetCoarseTabRenderableDataResponse: 6,
Spawn: 7,
SpawnResponse: 8,
WriteToTab: 9,
@@ -340,34 +335,6 @@ pub struct ListTabsResponse {
pub tabs: Vec<WindowAndTabEntry>,
}
/// This is a transitional request to get some basic
/// remoting working. The ideal is to produce Change
/// objects instead of the coarse response data in
/// GetCoarseTabRenderableDataResponse
#[derive(Deserialize, Serialize, PartialEq, Debug)]
pub struct GetCoarseTabRenderableData {
pub tab_id: TabId,
pub dirty_all: bool,
}
#[derive(Deserialize, Serialize, PartialEq, Debug)]
pub struct DirtyLine {
pub line_idx: usize,
pub line: Line,
pub selection_col_from: usize,
pub selection_col_to: usize,
}
#[derive(Deserialize, Serialize, PartialEq, Debug)]
pub struct GetCoarseTabRenderableDataResponse {
pub cursor_position: CursorPosition,
pub physical_rows: usize,
pub physical_cols: usize,
pub current_highlight: Option<Arc<Hyperlink>>,
pub dirty_lines: Vec<DirtyLine>,
pub title: String,
}
#[derive(Deserialize, Serialize, PartialEq, Debug)]
pub struct Spawn {
pub domain_id: DomainId,
-39
View File
@@ -649,44 +649,6 @@ impl<S: ReadAndWrite> ClientSession<S> {
Ok(Pdu::ListTabsResponse(ListTabsResponse { tabs }))
})
}
Pdu::GetCoarseTabRenderableData(GetCoarseTabRenderableData { tab_id, dirty_all }) => {
Future::with_executor(self.executor.clone_executor(), move || {
let mux = Mux::get().unwrap();
let tab = mux
.get_tab(tab_id)
.ok_or_else(|| format_err!("no such tab {}", tab_id))?;
let title = tab.get_title();
let mut renderable = tab.renderer();
if dirty_all {
renderable.make_all_lines_dirty();
}
let dirty_lines = renderable
.get_dirty_lines()
.iter()
.map(|(line_idx, line, sel)| DirtyLine {
line_idx: *line_idx,
line: (*line).clone(),
selection_col_from: sel.start,
selection_col_to: sel.end,
})
.collect();
renderable.clean_dirty_lines();
let (physical_rows, physical_cols) = renderable.physical_dimensions();
Ok(Pdu::GetCoarseTabRenderableDataResponse(
GetCoarseTabRenderableDataResponse {
dirty_lines,
current_highlight: renderable.current_highlight(),
cursor_position: renderable.get_cursor_position(),
physical_rows,
physical_cols,
title,
},
))
})
}
Pdu::WriteToTab(WriteToTab { tab_id, data }) => {
let surfaces = Arc::clone(&self.surfaces_by_tab);
@@ -801,7 +763,6 @@ impl<S: ReadAndWrite> ClientSession<S> {
Pdu::Pong { .. }
| Pdu::ListTabsResponse { .. }
| Pdu::SendMouseEventResponse { .. }
| Pdu::GetCoarseTabRenderableDataResponse { .. }
| Pdu::SetClipboard { .. }
| Pdu::SpawnResponse { .. }
| Pdu::GetTabRenderChangesResponse { .. }