Merge branch 'main' into terminal-element

This commit is contained in:
Mikayla
2023-12-06 15:20:04 -08:00
103 changed files with 10646 additions and 3579 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ impl TestDisplay {
id: DisplayId(1),
uuid: uuid::Uuid::new_v4(),
bounds: Bounds::from_corners(
Point::zero(),
Point::default(),
Point::new(GlobalPixels(1920.), GlobalPixels(1080.)),
),
}
+25 -10
View File
@@ -1,6 +1,6 @@
use crate::{
AnyWindowHandle, BackgroundExecutor, ClipboardItem, CursorStyle, DisplayId, ForegroundExecutor,
Platform, PlatformDisplay, PlatformTextSystem, TestDisplay, TestWindow, WindowOptions,
Keymap, Platform, PlatformDisplay, PlatformTextSystem, TestDisplay, TestWindow, WindowOptions,
};
use anyhow::{anyhow, Result};
use collections::VecDeque;
@@ -127,7 +127,7 @@ impl Platform for TestPlatform {
self.displays().iter().find(|d| d.id() == id).cloned()
}
fn main_window(&self) -> Option<crate::AnyWindowHandle> {
fn active_window(&self) -> Option<crate::AnyWindowHandle> {
unimplemented!()
}
@@ -147,18 +147,25 @@ impl Platform for TestPlatform {
fn set_display_link_output_callback(
&self,
_display_id: DisplayId,
_callback: Box<dyn FnMut(&crate::VideoTimestamp, &crate::VideoTimestamp) + Send>,
mut callback: Box<dyn FnMut(&crate::VideoTimestamp, &crate::VideoTimestamp) + Send>,
) {
unimplemented!()
let timestamp = crate::VideoTimestamp {
version: 0,
video_time_scale: 0,
video_time: 0,
host_time: 0,
rate_scalar: 0.0,
video_refresh_period: 0,
smpte_time: crate::SmtpeTime::default(),
flags: 0,
reserved: 0,
};
callback(&timestamp, &timestamp)
}
fn start_display_link(&self, _display_id: DisplayId) {
unimplemented!()
}
fn start_display_link(&self, _display_id: DisplayId) {}
fn stop_display_link(&self, _display_id: DisplayId) {
unimplemented!()
}
fn stop_display_link(&self, _display_id: DisplayId) {}
fn open_url(&self, _url: &str) {
unimplemented!()
@@ -205,6 +212,14 @@ impl Platform for TestPlatform {
unimplemented!()
}
fn set_menus(&self, _menus: Vec<crate::Menu>, _keymap: &Keymap) {}
fn on_app_menu_action(&self, _callback: Box<dyn FnMut(&dyn crate::Action)>) {}
fn on_will_open_app_menu(&self, _callback: Box<dyn FnMut()>) {}
fn on_validate_app_menu_command(&self, _callback: Box<dyn FnMut(&dyn crate::Action) -> bool>) {}
fn os_name(&self) -> &'static str {
"test"
}
+2 -2
View File
@@ -78,7 +78,7 @@ impl PlatformWindow for TestWindow {
}
fn mouse_position(&self) -> Point<Pixels> {
Point::zero()
Point::default()
}
fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
@@ -223,7 +223,7 @@ impl PlatformAtlas for TestAtlas {
},
tile_id: TileId(tile_id),
bounds: crate::Bounds {
origin: Point::zero(),
origin: Point::default(),
size,
},
},