1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 13:52:55 +03:00

window: macos: remove dead code

This commit is contained in:
Wez Furlong 2020-12-29 13:29:59 -08:00
parent cf6914c5d8
commit 4f80fd9bcd

View File

@ -4,9 +4,9 @@
use super::{nsstring, nsstring_to_str}; use super::{nsstring, nsstring_to_str};
use crate::connection::ConnectionOps; use crate::connection::ConnectionOps;
use crate::{ use crate::{
config, BitmapImage, Clipboard, Color, Connection, Dimensions, KeyCode, KeyEvent, Modifiers, config, Clipboard, Connection, Dimensions, KeyCode, KeyEvent, Modifiers, MouseButtons,
MouseButtons, MouseCursor, MouseEvent, MouseEventKind, MousePress, Operator, PaintContext, MouseCursor, MouseEvent, MouseEventKind, MousePress, Point, Rect, ScreenPoint, Size,
Point, Rect, ScreenPoint, Size, WindowCallbacks, WindowOps, WindowOpsMut, WindowCallbacks, WindowOps, WindowOpsMut,
}; };
use anyhow::{anyhow, bail, ensure}; use anyhow::{anyhow, bail, ensure};
use cocoa::appkit::{ use cocoa::appkit::{
@ -856,45 +856,6 @@ pub fn superclass(this: &Object) -> &'static Class {
} }
} }
struct MacGraphicsContext<'a> {
buffer: &'a mut dyn BitmapImage,
dpi: usize,
}
impl<'a> PaintContext for MacGraphicsContext<'a> {
fn clear_rect(&mut self, rect: Rect, color: Color) {
self.buffer.clear_rect(rect, color)
}
fn clear(&mut self, color: Color) {
self.buffer.clear(color);
}
fn get_dimensions(&self) -> Dimensions {
let (pixel_width, pixel_height) = self.buffer.image_dimensions();
Dimensions {
pixel_width,
pixel_height,
dpi: self.dpi,
}
}
fn draw_image(
&mut self,
dest_top_left: Point,
src_rect: Option<Rect>,
im: &dyn BitmapImage,
operator: Operator,
) {
self.buffer
.draw_image(dest_top_left, src_rect, im, operator)
}
fn draw_line(&mut self, start: Point, end: Point, color: Color, operator: Operator) {
self.buffer.draw_line(start, end, color, operator);
}
}
#[allow(clippy::identity_op)] #[allow(clippy::identity_op)]
fn decode_mouse_buttons(mask: u64) -> MouseButtons { fn decode_mouse_buttons(mask: u64) -> MouseButtons {
let mut buttons = MouseButtons::NONE; let mut buttons = MouseButtons::NONE;