first pass of merging in warp (doesn't build)

This commit is contained in:
Ryan Ward
2026-07-01 16:08:58 -05:00
parent 2f64909469
commit 4770ac06b5
3662 changed files with 414574 additions and 89772 deletions
+7 -9
View File
@@ -1,17 +1,15 @@
use futures::future::LocalBoxFuture;
use std::sync::mpsc;
use crate::platform::app::TerminationResult;
use crate::platform::test::FontDB as TestFontDB;
use crate::{
integration::TestDriver,
platform::{self},
AppContext, AssetProvider,
};
use futures::future::LocalBoxFuture;
use super::delegate::{self, AppDelegate};
use super::event_loop::{self, AppEvent};
use super::windowing::WindowManager;
use std::sync::mpsc;
use crate::integration::TestDriver;
use crate::platform::app::TerminationResult;
use crate::platform::test::FontDB as TestFontDB;
use crate::platform::{self};
use crate::{AppContext, AssetProvider};
pub struct App {
callbacks: platform::app::AppCallbacks,
@@ -1,18 +1,14 @@
use parking_lot::Mutex;
use crate::{
clipboard::InMemoryClipboard,
notification::{NotificationSendError, RequestPermissionsOutcome},
platform::{self, Cursor},
};
use std::mem::ManuallyDrop;
use std::sync::mpsc::Sender;
use std::sync::Arc;
use std::sync::OnceLock;
use std::sync::{Arc, OnceLock};
use std::thread;
use parking_lot::Mutex;
use super::event_loop::AppEvent;
use crate::clipboard::InMemoryClipboard;
use crate::notification::{NotificationSendError, RequestPermissionsOutcome};
use crate::platform::{self, Cursor};
/// Stores the ID of the application's main thread, which we can reference
/// to determine if a given thread is the main thread or not.
@@ -44,7 +40,7 @@ impl AppDelegate {
fn send_event(&self, event: AppEvent) {
if self.event_sender.send(event).is_err() {
log::warn!("Tried to send event, but event loop is no longer running");
log::debug!("Tried to send event, but event loop is no longer running");
}
}
}
@@ -214,7 +210,7 @@ impl platform::DispatchDelegate for DispatchDelegate {
.send(AppEvent::RunTask(ManuallyDrop::new(task)))
.is_err()
{
log::warn!("Tried to send event, but event loop is no longer running");
log::debug!("Tried to send event, but event loop is no longer running");
}
}
}
@@ -1,14 +1,11 @@
use std::mem::ManuallyDrop;
use std::sync::mpsc::{Receiver, Sender};
use crate::{
platform::{
self,
app::{AppCallbackDispatcher, ApproveTerminateResult, TerminationResult},
TerminationMode,
},
AppContext, WindowId,
use crate::platform::app::{
AppCallbackDispatcher, ApproveTerminateResult, TerminationRequestSource, TerminationResult,
};
use crate::platform::{self, TerminationMode};
use crate::{AppContext, WindowId};
/// Application events handled on the headless platform's main thread.
pub(super) enum AppEvent {
@@ -51,7 +48,7 @@ pub(super) fn run(
let should_terminate = match termination_mode {
TerminationMode::Cancellable => {
matches!(
callbacks.should_terminate_app(),
callbacks.should_terminate_app(TerminationRequestSource::User),
ApproveTerminateResult::Terminate
)
}
@@ -9,6 +9,5 @@ mod windowing;
pub use app::App;
pub use delegate::AppDelegate;
#[cfg(target_os = "macos")]
pub(crate) use windowing::Window;
@@ -1,16 +1,16 @@
use std::{cell::RefCell, collections::HashMap, rc::Rc, sync::mpsc};
use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;
use std::sync::mpsc;
use anyhow::Result;
use crate::{
geometry::rect::RectF,
geometry::vector::{vec2f, Vector2F},
platform::{self, WindowOptions},
windowing::WindowCallbacks,
WindowId,
};
use super::event_loop::AppEvent;
use crate::geometry::rect::RectF;
use crate::geometry::vector::{vec2f, Vector2F};
use crate::platform::{self, WindowOptions};
use crate::windowing::WindowCallbacks;
use crate::WindowId;
pub struct WindowManager {
windows: HashMap<WindowId, Rc<Window>>,