mirror of
https://github.com/wez/wezterm.git
synced 2024-12-25 22:33:52 +03:00
glium TerminalWindow -> GliumTerminalWindow
This commit is contained in:
parent
46cc2cdf99
commit
46c0c7753f
@ -133,7 +133,7 @@ impl<'a> term::TerminalHost for TabHost<'a> {
|
|||||||
self.host.event_loop.spawn_fn(move || {
|
self.host.event_loop.spawn_fn(move || {
|
||||||
let (terminal, master, child, fonts) = spawn_window_impl(None, &config, &fonts)?;
|
let (terminal, master, child, fonts) = spawn_window_impl(None, &config, &fonts)?;
|
||||||
let window =
|
let window =
|
||||||
TerminalWindow::new(&event_loop, terminal, master, child, &fonts, &config)?;
|
GliumTerminalWindow::new(&event_loop, terminal, master, child, &fonts, &config)?;
|
||||||
|
|
||||||
event_loop.add_window(window)
|
event_loop.add_window(window)
|
||||||
});
|
});
|
||||||
@ -194,7 +194,7 @@ impl<'a> term::TerminalHost for TabHost<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TerminalWindow {
|
pub struct GliumTerminalWindow {
|
||||||
host: Host,
|
host: Host,
|
||||||
event_loop: Rc<GuiEventLoop>,
|
event_loop: Rc<GuiEventLoop>,
|
||||||
config: Rc<Config>,
|
config: Rc<Config>,
|
||||||
@ -210,7 +210,7 @@ pub struct TerminalWindow {
|
|||||||
tabs: Tabs,
|
tabs: Tabs,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TerminalWindow {
|
impl GliumTerminalWindow {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
event_loop: &Rc<GuiEventLoop>,
|
event_loop: &Rc<GuiEventLoop>,
|
||||||
terminal: Terminal,
|
terminal: Terminal,
|
||||||
@ -218,7 +218,7 @@ impl TerminalWindow {
|
|||||||
process: Child,
|
process: Child,
|
||||||
fonts: &Rc<FontConfiguration>,
|
fonts: &Rc<FontConfiguration>,
|
||||||
config: &Rc<Config>,
|
config: &Rc<Config>,
|
||||||
) -> Result<TerminalWindow, Error> {
|
) -> Result<GliumTerminalWindow, Error> {
|
||||||
let palette = config
|
let palette = config
|
||||||
.colors
|
.colors
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@ -267,7 +267,7 @@ impl TerminalWindow {
|
|||||||
|
|
||||||
let tab = Tab::new(terminal, process, pty);
|
let tab = Tab::new(terminal, process, pty);
|
||||||
|
|
||||||
Ok(TerminalWindow {
|
Ok(GliumTerminalWindow {
|
||||||
host,
|
host,
|
||||||
event_loop: Rc::clone(event_loop),
|
event_loop: Rc::clone(event_loop),
|
||||||
config: Rc::clone(config),
|
config: Rc::clone(config),
|
||||||
@ -849,7 +849,7 @@ impl TerminalWindow {
|
|||||||
let dpi_scale = self.host.display.gl_window().get_hidpi_factor();
|
let dpi_scale = self.host.display.gl_window().get_hidpi_factor();
|
||||||
let font_scale = font_scale.unwrap_or_else(|| self.fonts.get_font_scale());
|
let font_scale = font_scale.unwrap_or_else(|| self.fonts.get_font_scale());
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"TerminalWindow::scaling_changed dpi_scale={} font_scale={}",
|
"GliumTerminalWindow::scaling_changed dpi_scale={} font_scale={}",
|
||||||
dpi_scale, font_scale
|
dpi_scale, font_scale
|
||||||
);
|
);
|
||||||
self.tabs
|
self.tabs
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use super::GuiSystem;
|
use super::GuiSystem;
|
||||||
use crate::futurecore;
|
use crate::futurecore;
|
||||||
use crate::gliumwindows;
|
use crate::gliumwindows;
|
||||||
pub use crate::gliumwindows::TerminalWindow;
|
pub use crate::gliumwindows::GliumTerminalWindow;
|
||||||
use crate::guiloop::SessionTerminated;
|
use crate::guiloop::SessionTerminated;
|
||||||
use crate::{Child, MasterPty};
|
use crate::{Child, MasterPty};
|
||||||
use failure::Error;
|
use failure::Error;
|
||||||
@ -68,10 +68,10 @@ pub enum IOEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// This struct holds references to Windows.
|
/// This struct holds references to Windows.
|
||||||
/// The primary mapping is from `WindowId` -> `TerminalWindow`.
|
/// The primary mapping is from `WindowId` -> `GliumTerminalWindow`.
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
struct Windows {
|
struct Windows {
|
||||||
by_id: HashMap<WindowId, gliumwindows::TerminalWindow>,
|
by_id: HashMap<WindowId, gliumwindows::GliumTerminalWindow>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The `GuiEventLoop` represents the combined gui event processor,
|
/// The `GuiEventLoop` represents the combined gui event processor,
|
||||||
@ -144,7 +144,7 @@ impl GuiSystem for GlutinGuiSystem {
|
|||||||
config: &Rc<crate::config::Config>,
|
config: &Rc<crate::config::Config>,
|
||||||
fontconfig: &Rc<crate::font::FontConfiguration>,
|
fontconfig: &Rc<crate::font::FontConfiguration>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let window = TerminalWindow::new(
|
let window = GliumTerminalWindow::new(
|
||||||
&self.event_loop,
|
&self.event_loop,
|
||||||
terminal,
|
terminal,
|
||||||
master,
|
master,
|
||||||
@ -187,7 +187,7 @@ impl GuiEventLoop {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_window<F: 'static + Fn(&mut TerminalWindow) -> Result<(), Error>>(
|
pub fn with_window<F: 'static + Fn(&mut GliumTerminalWindow) -> Result<(), Error>>(
|
||||||
events: &Rc<Self>,
|
events: &Rc<Self>,
|
||||||
window_id: WindowId,
|
window_id: WindowId,
|
||||||
func: F,
|
func: F,
|
||||||
@ -256,7 +256,7 @@ impl GuiEventLoop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Add a window to the event loop and run it.
|
/// Add a window to the event loop and run it.
|
||||||
pub fn add_window(&self, window: gliumwindows::TerminalWindow) -> Result<(), Error> {
|
pub fn add_window(&self, window: gliumwindows::GliumTerminalWindow) -> Result<(), Error> {
|
||||||
let window_id = window.window_id();
|
let window_id = window.window_id();
|
||||||
let pty = window.clone_current_pty()?;
|
let pty = window.clone_current_pty()?;
|
||||||
self.schedule_read_pty(pty, window_id, window.get_tab_id_by_idx(0))?;
|
self.schedule_read_pty(pty, window_id, window.get_tab_id_by_idx(0))?;
|
||||||
|
Loading…
Reference in New Issue
Block a user