1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 05:12:40 +03:00

move codec into is own crate

This commit is contained in:
Wez Furlong 2020-10-02 22:39:15 -07:00
parent 2af699fe79
commit a07004302a
13 changed files with 52 additions and 17 deletions

23
Cargo.lock generated
View File

@ -646,6 +646,25 @@ dependencies = [
"objc",
]
[[package]]
name = "codec"
version = "0.1.0"
dependencies = [
"anyhow",
"config",
"leb128",
"log",
"metrics",
"mux",
"portable-pty",
"rangeset",
"serde",
"termwiz",
"varbincode",
"wezterm-term",
"zstd",
]
[[package]]
name = "color_quant"
version = "1.0.1"
@ -4097,6 +4116,7 @@ dependencies = [
"bstr 0.2.13",
"cc",
"cocoa",
"codec",
"config",
"core-foundation 0.7.0",
"core-graphics 0.19.2",
@ -4120,7 +4140,6 @@ dependencies = [
"http_req",
"image",
"lazy_static",
"leb128",
"libc",
"log",
"lru",
@ -4159,13 +4178,11 @@ dependencies = [
"unicode-segmentation",
"unicode-width",
"url",
"varbincode",
"walkdir",
"wezterm-term",
"winapi 0.3.9",
"window",
"winrt-notification",
"zstd",
]
[[package]]

View File

@ -28,6 +28,7 @@ base91 = { path = "base91" }
rangeset = { path = "rangeset" }
bitflags = "1.0"
bstr = "0.2"
codec = { path = "codec" }
config = { path = "config" }
crossbeam = "0.7"
dirs = "2.0"
@ -41,7 +42,6 @@ image = "0.23"
harfbuzz = { path = "deps/harfbuzz" }
hostname = "0.3"
lazy_static = "1.4"
leb128 = "0.2"
libc = "0.2"
log = "0.4"
lru = "0.5"
@ -76,10 +76,8 @@ unicode-normalization = "0.1"
unicode-segmentation = "1.6"
unicode-width = "0.1"
url = "2"
varbincode = "0.1"
walkdir = "2"
window = { path = "window", features=["opengl", "wayland"]}
zstd = "0.4"
[target.'cfg(unix)'.dependencies]
daemonize = { git = "https://github.com/wez/daemonize" }

22
codec/Cargo.toml Normal file
View File

@ -0,0 +1,22 @@
[package]
name = "codec"
version = "0.1.0"
authors = ["Wez Furlong <wez@wezfurlong.org>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0"
config = { path = "../config" }
leb128 = "0.2"
log = "0.4"
metrics = { version="0.12", features=["std"]}
mux = { path = "../mux" }
portable-pty = { path = "../pty", features = ["serde_support"]}
rangeset = { path = "../rangeset" }
serde = {version="1.0", features = ["rc", "derive"]}
termwiz = { path = "../termwiz" }
varbincode = "0.1"
wezterm-term = { path = "../term", features=["use_serde"] }
zstd = "0.4"

View File

@ -920,7 +920,7 @@ fn run() -> anyhow::Result<()> {
.parse()?,
};
let spawned = block_on(client.split_pane(crate::server::codec::SplitPane {
let spawned = block_on(client.split_pane(codec::SplitPane {
pane_id,
direction: if horizontal {
SplitDirection::Horizontal
@ -975,8 +975,7 @@ fn run() -> anyhow::Result<()> {
}
CliSubCommand::TlsCreds => {
let creds = block_on(client.get_tls_creds())?;
crate::server::codec::Pdu::GetTlsCredsResponse(creds)
.encode(std::io::stdout().lock(), 0)?;
codec::Pdu::GetTlsCredsResponse(creds).encode(std::io::stdout().lock(), 0)?;
}
}
Ok(())

View File

@ -1,11 +1,11 @@
use crate::connui::ConnectionUI;
use crate::server::codec::*;
use crate::server::domain::{ClientDomain, ClientDomainConfig};
use crate::server::pollable::*;
use crate::server::tab::ClientPane;
use crate::server::UnixStream;
use crate::ssh::ssh_connect_with_ui;
use anyhow::{anyhow, bail, Context, Error};
use codec::*;
use config::{configuration, SshDomain, TlsDomainClient, UnixDomain};
use crossbeam::channel::TryRecvError;
use filedescriptor::{poll, pollfd, AsRawSocketDescriptor};

View File

@ -1,9 +1,9 @@
use crate::connui::ConnectionUI;
use crate::server::client::Client;
use crate::server::codec::{ListPanesResponse, Spawn, SplitPane};
use crate::server::tab::ClientPane;
use anyhow::{anyhow, bail};
use async_trait::async_trait;
use codec::{ListPanesResponse, Spawn, SplitPane};
use config::keyassignment::SpawnTabDomain;
use config::{SshDomain, TlsDomainClient, UnixDomain};
use mux::domain::{alloc_domain_id, Domain, DomainId, DomainState};

View File

@ -1,7 +1,7 @@
use crate::server::codec::*;
use crate::server::listener::sessionhandler::SessionHandler;
use crate::server::pollable::*;
use anyhow::{bail, Context, Error};
use codec::*;
use crossbeam::channel::TryRecvError;
use filedescriptor::poll;
use log::error;

View File

@ -1,7 +1,7 @@
use crate::server::codec::*;
use crate::server::listener::PKI;
use crate::server::pollable::*;
use anyhow::anyhow;
use codec::*;
use config::keyassignment::SpawnTabDomain;
use mux::pane::{Pane, PaneId};
use mux::renderable::{RenderableDimensions, StableCursorPosition};

View File

@ -4,7 +4,6 @@ use std::os::unix::net::{UnixListener, UnixStream};
use uds_windows::{UnixListener, UnixStream};
pub mod client;
pub mod codec;
pub mod domain;
pub mod listener;
pub mod pollable;

View File

@ -1,9 +1,9 @@
use crate::server::codec::*;
use crate::server::domain::ClientInner;
use crate::server::tab::mousestate::MouseState;
use crate::server::tab::renderable::{RenderableInner, RenderableState};
use anyhow::bail;
use async_trait::async_trait;
use codec::*;
use config::configuration;
use filedescriptor::Pipe;
use log::info;

View File

@ -1,5 +1,5 @@
use crate::server::client::Client;
use crate::server::codec::*;
use codec::*;
use mux::tab::TabId;
use std::cell::RefCell;
use std::collections::VecDeque;

View File

@ -1,7 +1,7 @@
use crate::server::codec::*;
use crate::server::domain::ClientInner;
use crate::server::tab::clienttab::ClientPane;
use anyhow::anyhow;
use codec::*;
use config::{configuration, ConfigHandle};
use lru::LruCache;
use mux::renderable::{Renderable, RenderableDimensions, StableCursorPosition};