Mark TODOs and prep for merging main
This commit is contained in:
parent
e3ae7c4fe0
commit
3734a390b2
13 changed files with 77 additions and 15 deletions
|
@ -185,7 +185,7 @@ wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", rev = "v16.0.
|
||||||
split-debuginfo = "unpacked"
|
split-debuginfo = "unpacked"
|
||||||
debug = "limited"
|
debug = "limited"
|
||||||
|
|
||||||
# TODO - Remove this
|
# todo!(linux) - Remove this
|
||||||
[profile.dev.package.blade-graphics]
|
[profile.dev.package.blade-graphics]
|
||||||
split-debuginfo = "off"
|
split-debuginfo = "off"
|
||||||
debug = "full"
|
debug = "full"
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 9.3 KiB |
|
@ -75,11 +75,11 @@ impl BladeBelt {
|
||||||
chunk.into()
|
chunk.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Note: assuming T: bytemuck::Zeroable
|
//todo!(linux): enforce T: bytemuck::Zeroable
|
||||||
pub fn alloc_data<T>(&mut self, data: &[T], gpu: &gpu::Context) -> gpu::BufferPiece {
|
pub fn alloc_data<T>(&mut self, data: &[T], gpu: &gpu::Context) -> gpu::BufferPiece {
|
||||||
assert!(!data.is_empty());
|
assert!(!data.is_empty());
|
||||||
let type_alignment = mem::align_of::<T>() as u64;
|
let type_alignment = mem::align_of::<T>() as u64;
|
||||||
assert_eq!(
|
debug_assert_eq!(
|
||||||
self.desc.alignment % type_alignment,
|
self.desc.alignment % type_alignment,
|
||||||
0,
|
0,
|
||||||
"Type alignment {} is too big",
|
"Type alignment {} is too big",
|
||||||
|
|
|
@ -411,7 +411,7 @@ impl BladeRenderer {
|
||||||
}
|
}
|
||||||
PrimitiveBatch::Paths(paths) => {
|
PrimitiveBatch::Paths(paths) => {
|
||||||
let mut encoder = pass.with(&self.pipelines.paths);
|
let mut encoder = pass.with(&self.pipelines.paths);
|
||||||
//TODO: group by texture ID
|
//todo!(linux): group by texture ID
|
||||||
for path in paths {
|
for path in paths {
|
||||||
let tile = &self.path_tiles[&path.id];
|
let tile = &self.path_tiles[&path.id];
|
||||||
let tex_info = self.atlas.get_texture_info(tile.texture_id);
|
let tex_info = self.atlas.get_texture_info(tile.texture_id);
|
||||||
|
|
|
@ -90,7 +90,7 @@ impl PlatformDispatcher for LinuxDispatcher {
|
||||||
fn dispatch_on_main_thread(&self, runnable: Runnable) {
|
fn dispatch_on_main_thread(&self, runnable: Runnable) {
|
||||||
self.main_sender.send(runnable).unwrap();
|
self.main_sender.send(runnable).unwrap();
|
||||||
// Send a message to the invisible window, forcing
|
// Send a message to the invisible window, forcing
|
||||||
// tha main loop to wake up and dispatch the runnable.
|
// the main loop to wake up and dispatch the runnable.
|
||||||
self.xcb_connection.send_request(&x::SendEvent {
|
self.xcb_connection.send_request(&x::SendEvent {
|
||||||
propagate: false,
|
propagate: false,
|
||||||
destination: x::SendEventDest::Window(self.x_listener_window),
|
destination: x::SendEventDest::Window(self.x_listener_window),
|
||||||
|
|
|
@ -170,14 +170,19 @@ impl Platform for LinuxPlatform {
|
||||||
self.state.lock().quit_requested = true;
|
self.state.lock().quit_requested = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn restart(&self) {}
|
fn restart(&self) {}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn activate(&self, ignoring_other_apps: bool) {}
|
fn activate(&self, ignoring_other_apps: bool) {}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn hide(&self) {}
|
fn hide(&self) {}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn hide_other_apps(&self) {}
|
fn hide_other_apps(&self) {}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn unhide_other_apps(&self) {}
|
fn unhide_other_apps(&self) {}
|
||||||
|
|
||||||
fn displays(&self) -> Vec<Rc<dyn PlatformDisplay>> {
|
fn displays(&self) -> Vec<Rc<dyn PlatformDisplay>> {
|
||||||
|
@ -199,6 +204,7 @@ impl Platform for LinuxPlatform {
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn active_window(&self) -> Option<AnyWindowHandle> {
|
fn active_window(&self) -> Option<AnyWindowHandle> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
@ -324,6 +330,7 @@ impl Platform for LinuxPlatform {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn set_menus(&self, menus: Vec<Menu>, keymap: &Keymap) {}
|
fn set_menus(&self, menus: Vec<Menu>, keymap: &Keymap) {}
|
||||||
|
|
||||||
fn local_timezone(&self) -> UtcOffset {
|
fn local_timezone(&self) -> UtcOffset {
|
||||||
|
@ -334,14 +341,16 @@ impl Platform for LinuxPlatform {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn set_cursor_style(&self, style: CursorStyle) {}
|
fn set_cursor_style(&self, style: CursorStyle) {}
|
||||||
|
|
||||||
fn should_auto_hide_scrollbars(&self) -> bool {
|
//todo!(linux)
|
||||||
false
|
fn should_auto_hide_scrollbars(&self) -> bool {}
|
||||||
}
|
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn write_to_clipboard(&self, item: ClipboardItem) {}
|
fn write_to_clipboard(&self, item: ClipboardItem) {}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn read_from_clipboard(&self) -> Option<ClipboardItem> {
|
fn read_from_clipboard(&self) -> Option<ClipboardItem> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ struct LinuxTextSystemState {
|
||||||
postscript_names_by_font_id: HashMap<FontId, String>,
|
postscript_names_by_font_id: HashMap<FontId, String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo!(linux): Double check this
|
||||||
unsafe impl Send for LinuxTextSystemState {}
|
unsafe impl Send for LinuxTextSystemState {}
|
||||||
unsafe impl Sync for LinuxTextSystemState {}
|
unsafe impl Sync for LinuxTextSystemState {}
|
||||||
|
|
||||||
|
@ -54,33 +55,52 @@ impl Default for LinuxTextSystem {
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
impl PlatformTextSystem for LinuxTextSystem {
|
impl PlatformTextSystem for LinuxTextSystem {
|
||||||
|
// todo!(linux)
|
||||||
fn add_fonts(&self, fonts: Vec<Cow<'static, [u8]>>) -> Result<()> {
|
fn add_fonts(&self, fonts: Vec<Cow<'static, [u8]>>) -> Result<()> {
|
||||||
Ok(()) //TODO
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo!(linux)
|
||||||
fn all_font_names(&self) -> Vec<String> {
|
fn all_font_names(&self) -> Vec<String> {
|
||||||
Vec::new()
|
Vec::new()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo!(linux)
|
||||||
fn all_font_families(&self) -> Vec<String> {
|
fn all_font_families(&self) -> Vec<String> {
|
||||||
Vec::new()
|
Vec::new()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo!(linux)
|
||||||
fn font_id(&self, descriptor: &Font) -> Result<FontId> {
|
fn font_id(&self, descriptor: &Font) -> Result<FontId> {
|
||||||
Ok(FontId(0)) //TODO
|
Ok(FontId(0))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo!(linux)
|
||||||
fn font_metrics(&self, font_id: FontId) -> FontMetrics {
|
fn font_metrics(&self, font_id: FontId) -> FontMetrics {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo!(linux)
|
||||||
fn typographic_bounds(&self, font_id: FontId, glyph_id: GlyphId) -> Result<Bounds<f32>> {
|
fn typographic_bounds(&self, font_id: FontId, glyph_id: GlyphId) -> Result<Bounds<f32>> {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo!(linux)
|
||||||
fn advance(&self, font_id: FontId, glyph_id: GlyphId) -> Result<Size<f32>> {
|
fn advance(&self, font_id: FontId, glyph_id: GlyphId) -> Result<Size<f32>> {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo!(linux)
|
||||||
fn glyph_for_char(&self, font_id: FontId, ch: char) -> Option<GlyphId> {
|
fn glyph_for_char(&self, font_id: FontId, ch: char) -> Option<GlyphId> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo!(linux)
|
||||||
fn glyph_raster_bounds(&self, params: &RenderGlyphParams) -> Result<Bounds<DevicePixels>> {
|
fn glyph_raster_bounds(&self, params: &RenderGlyphParams) -> Result<Bounds<DevicePixels>> {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo!(linux)
|
||||||
fn rasterize_glyph(
|
fn rasterize_glyph(
|
||||||
&self,
|
&self,
|
||||||
params: &RenderGlyphParams,
|
params: &RenderGlyphParams,
|
||||||
|
@ -88,9 +108,13 @@ impl PlatformTextSystem for LinuxTextSystem {
|
||||||
) -> Result<(Size<DevicePixels>, Vec<u8>)> {
|
) -> Result<(Size<DevicePixels>, Vec<u8>)> {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo!(linux)
|
||||||
fn layout_line(&self, text: &str, font_size: Pixels, runs: &[FontRun]) -> LineLayout {
|
fn layout_line(&self, text: &str, font_size: Pixels, runs: &[FontRun]) -> LineLayout {
|
||||||
LineLayout::default() //TODO
|
LineLayout::default() //TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo!(linux)
|
||||||
fn wrap_line(
|
fn wrap_line(
|
||||||
&self,
|
&self,
|
||||||
text: &str,
|
text: &str,
|
||||||
|
|
|
@ -77,6 +77,7 @@ pub(crate) struct LinuxWindowState {
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub(crate) struct LinuxWindow(pub(crate) Arc<LinuxWindowState>);
|
pub(crate) struct LinuxWindow(pub(crate) Arc<LinuxWindowState>);
|
||||||
|
|
||||||
|
//todo!(linux): Remove other RawWindowHandle implementation
|
||||||
unsafe impl blade_rwh::HasRawWindowHandle for RawWindow {
|
unsafe impl blade_rwh::HasRawWindowHandle for RawWindow {
|
||||||
fn raw_window_handle(&self) -> blade_rwh::RawWindowHandle {
|
fn raw_window_handle(&self) -> blade_rwh::RawWindowHandle {
|
||||||
let mut wh = blade_rwh::XcbWindowHandle::empty();
|
let mut wh = blade_rwh::XcbWindowHandle::empty();
|
||||||
|
@ -287,10 +288,12 @@ impl PlatformWindow for LinuxWindow {
|
||||||
self.0.inner.lock().scale_factor
|
self.0.inner.lock().scale_factor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn titlebar_height(&self) -> Pixels {
|
fn titlebar_height(&self) -> Pixels {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn appearance(&self) -> WindowAppearance {
|
fn appearance(&self) -> WindowAppearance {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
@ -299,10 +302,12 @@ impl PlatformWindow for LinuxWindow {
|
||||||
Rc::clone(&self.0.display)
|
Rc::clone(&self.0.display)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn mouse_position(&self) -> Point<Pixels> {
|
fn mouse_position(&self) -> Point<Pixels> {
|
||||||
Point::default()
|
Point::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn modifiers(&self) -> crate::Modifiers {
|
fn modifiers(&self) -> crate::Modifiers {
|
||||||
crate::Modifiers::default()
|
crate::Modifiers::default()
|
||||||
}
|
}
|
||||||
|
@ -311,12 +316,15 @@ impl PlatformWindow for LinuxWindow {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn set_input_handler(&mut self, input_handler: PlatformInputHandler) {}
|
fn set_input_handler(&mut self, input_handler: PlatformInputHandler) {}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn take_input_handler(&mut self) -> Option<PlatformInputHandler> {
|
fn take_input_handler(&mut self) -> Option<PlatformInputHandler> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn prompt(
|
fn prompt(
|
||||||
&self,
|
&self,
|
||||||
_level: crate::PromptLevel,
|
_level: crate::PromptLevel,
|
||||||
|
@ -327,24 +335,36 @@ impl PlatformWindow for LinuxWindow {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn activate(&self) {}
|
fn activate(&self) {}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn set_title(&mut self, title: &str) {}
|
fn set_title(&mut self, title: &str) {}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn set_edited(&mut self, edited: bool) {}
|
fn set_edited(&mut self, edited: bool) {}
|
||||||
|
|
||||||
|
//todo!(linux), this corresponds to `orderFrontCharacterPalette` on macOS,
|
||||||
|
// but it looks like the equivalent for Linux is GTK specific:
|
||||||
|
//
|
||||||
|
// https://docs.gtk.org/gtk3/signal.Entry.insert-emoji.html
|
||||||
|
//
|
||||||
|
// This API might need to change, or we might need to build an emoji picker into GPUI
|
||||||
fn show_character_palette(&self) {
|
fn show_character_palette(&self) {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn minimize(&self) {
|
fn minimize(&self) {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn zoom(&self) {
|
fn zoom(&self) {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn toggle_full_screen(&self) {
|
fn toggle_full_screen(&self) {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
@ -385,10 +405,12 @@ impl PlatformWindow for LinuxWindow {
|
||||||
self.0.callbacks.lock().appearance_changed = Some(callback);
|
self.0.callbacks.lock().appearance_changed = Some(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn is_topmost_for_position(&self, _position: crate::Point<Pixels>) -> bool {
|
fn is_topmost_for_position(&self, _position: crate::Point<Pixels>) -> bool {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
fn invalidate(&self) {}
|
fn invalidate(&self) {}
|
||||||
|
|
||||||
fn draw(&self, scene: &crate::Scene) {
|
fn draw(&self, scene: &crate::Scene) {
|
||||||
|
|
|
@ -118,7 +118,11 @@ impl Platform for TestPlatform {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn text_system(&self) -> Arc<dyn PlatformTextSystem> {
|
fn text_system(&self) -> Arc<dyn PlatformTextSystem> {
|
||||||
Arc::new(TestTextSystem {})
|
#[cfg(target_os = "linux")]
|
||||||
|
return Arc::new(TestTextSystem {});
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
return Arc::new(crate::platform::mac::MacTextSystem::new());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run(&self, _on_finish_launching: Box<dyn FnOnce()>) {
|
fn run(&self, _on_finish_launching: Box<dyn FnOnce()>) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ use std::borrow::Cow;
|
||||||
|
|
||||||
pub(crate) struct TestTextSystem {}
|
pub(crate) struct TestTextSystem {}
|
||||||
|
|
||||||
|
//todo!(linux)
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
impl PlatformTextSystem for TestTextSystem {
|
impl PlatformTextSystem for TestTextSystem {
|
||||||
fn add_fonts(&self, fonts: Vec<Cow<'static, [u8]>>) -> Result<()> {
|
fn add_fonts(&self, fonts: Vec<Cow<'static, [u8]>>) -> Result<()> {
|
||||||
|
|
|
@ -7,8 +7,8 @@ use terminal::{
|
||||||
Terminal, TerminalBuilder,
|
Terminal, TerminalBuilder,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
// #[cfg(target_os = "macos")]
|
||||||
use std::os::unix::ffi::OsStrExt;
|
// use std::os::unix::ffi::OsStrExt;
|
||||||
|
|
||||||
pub struct Terminals {
|
pub struct Terminals {
|
||||||
pub(crate) local_handles: Vec<WeakModel<terminal::Terminal>>,
|
pub(crate) local_handles: Vec<WeakModel<terminal::Terminal>>,
|
||||||
|
|
|
@ -280,7 +280,8 @@ pub fn init(
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Produces a link error on linux due to duplicated `state_new` symbol
|
// Produces a link error on linux due to duplicated `state_new` symbol
|
||||||
|
// todo!(linux): Restore purescript
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
language(
|
language(
|
||||||
"purescript",
|
"purescript",
|
||||||
|
|
|
@ -257,7 +257,7 @@ fn main() {
|
||||||
initialize_workspace(app_state.clone(), cx);
|
initialize_workspace(app_state.clone(), cx);
|
||||||
|
|
||||||
if stdout_is_a_pty() {
|
if stdout_is_a_pty() {
|
||||||
//TODO: unblock this
|
//todo!(linux): unblock this
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
upload_panics_and_crashes(http.clone(), cx);
|
upload_panics_and_crashes(http.clone(), cx);
|
||||||
cx.activate(true);
|
cx.activate(true);
|
||||||
|
@ -919,6 +919,7 @@ fn load_user_themes_in_background(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
|
||||||
.detach();
|
.detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo!(linux): Port fsevents to linux
|
||||||
/// Spawns a background task to watch the themes directory for changes.
|
/// Spawns a background task to watch the themes directory for changes.
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
fn watch_themes(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
|
fn watch_themes(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue