- input: mouse events, modifiers, dispatch phases. - window: Element / AnyElement / IntoElement, Render / AnyView (entities render as elements), listener(), empty(); Window with the draw cycle (render, layout to fill the viewport, prepaint, paint, finish) and phase checks; content-mask / element-offset / opacity / element-id stacks; element state across frames (ElementStateKey); hitboxes, hit testing, occlusion; mouse dispatch (capture + bubble, stop_propagation); hover- and notify-driven invalidation of rendered views; painting: paint_quad with device-pixel snapping, drop/inset shadows, paint_path, paint_style (port of Style::paint). - elements: div() (Styled, children, hover, mouse down/up/move/scroll, clicks with element state, occlude, overflow clipping, opacity) and canvas(); Styled extend lists generated by tools/gen_style.py. - app: observe_notifications hook used by windows. - Tests: end-to-end views -> scene, clicks, hover, invalidation, nested views, bubbling, occlusion, shadows/borders/clipping, canvas, resize, and aborts on misuse. The card example now renders a real view and simulates hover and click. - Docs: PORTING.md M6 status and deviations; README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
133 lines
4.9 KiB
Plaintext
133 lines
4.9 KiB
Plaintext
// Generated using `moon info`, DON'T EDIT IT
|
|
package "experiments/gpui/app"
|
|
|
|
import {
|
|
"experiments/gpui/executor",
|
|
"moonbitlang/core/debug",
|
|
}
|
|
|
|
// Values
|
|
|
|
// Errors
|
|
|
|
// Types and methods
|
|
pub struct App {
|
|
// private fields
|
|
}
|
|
pub fn App::advance_clock(Self, Int32) -> Unit
|
|
pub fn App::background_executor(Self) -> @executor.Executor
|
|
pub fn[G] App::default_global(Self, GlobalKey[G], () -> G) -> G
|
|
pub fn App::defer_call(Self, (Self) -> Unit) -> Unit
|
|
pub fn App::entity_count(Self) -> Int32
|
|
pub fn App::foreground_executor(Self) -> @executor.Executor
|
|
pub fn[G] App::global(Self, GlobalKey[G]) -> G
|
|
pub fn[G] App::global_mut(Self, GlobalKey[G]) -> G
|
|
pub fn[G] App::has_global(Self, GlobalKey[G]) -> Bool
|
|
pub fn[T] App::insert_entity(Self, Reservation[T], (Context[T]) -> T) -> Entity[T]
|
|
pub fn App::new(dispatcher? : &@executor.Dispatcher) -> Self
|
|
pub fn[T] App::new_entity(Self, (Context[T]) -> T) -> Entity[T]
|
|
pub fn App::notify(Self, EntityId) -> Unit
|
|
pub fn[T] App::observe(Self, Entity[T], (Entity[T], Self) -> Unit) -> Subscription
|
|
pub fn[G] App::observe_global(Self, GlobalKey[G], (Self) -> Unit) -> Subscription
|
|
pub fn App::observe_notifications(Self, (EntityId) -> Unit) -> Subscription
|
|
pub fn[T] App::observe_release(Self, Entity[T], (T, Self) -> Unit) -> Subscription
|
|
pub fn[T] App::read_entity(Self, Entity[T]) -> T
|
|
pub fn[T] App::release(Self, Entity[T]) -> Unit
|
|
pub fn[G] App::remove_global(Self, GlobalKey[G]) -> G
|
|
pub fn[T] App::reserve_entity(Self) -> Reservation[T]
|
|
pub fn App::run_until_parked(Self) -> Unit
|
|
pub fn[G] App::set_global(Self, GlobalKey[G], G) -> Unit
|
|
pub fn[R] App::spawn(Self, async (AsyncApp) -> R) -> @executor.Task[R]
|
|
pub fn[T, E] App::subscribe(Self, Entity[T], EventKey[E], (Entity[T], E, Self) -> Unit) -> Subscription
|
|
pub fn App::to_async(Self) -> AsyncApp
|
|
pub fn[G] App::try_global(Self, GlobalKey[G]) -> G?
|
|
pub fn[R] App::update(Self, (Self) -> R) -> R
|
|
pub fn[T, R] App::update_entity(Self, Entity[T], (T, Context[T]) -> R) -> R
|
|
pub fn[G, R] App::update_global(Self, GlobalKey[G], (G, Self) -> R) -> R
|
|
|
|
pub struct AsyncApp {
|
|
app : App
|
|
}
|
|
pub fn AsyncApp::background_executor(Self) -> @executor.Executor
|
|
pub fn AsyncApp::foreground_executor(Self) -> @executor.Executor
|
|
pub fn[T] AsyncApp::read_entity(Self, Entity[T]) -> T
|
|
pub fn[R] AsyncApp::spawn(Self, async (Self) -> R) -> @executor.Task[R]
|
|
pub fn[R] AsyncApp::update(Self, (App) -> R) -> R
|
|
pub fn[T, R] AsyncApp::update_entity(Self, Entity[T], (T, Context[T]) -> R) -> R
|
|
|
|
pub struct Context[T] {
|
|
app : App
|
|
// private fields
|
|
}
|
|
pub fn[T] Context::defer_call(Self[T], (App) -> Unit) -> Unit
|
|
pub fn[T, E] Context::emit(Self[T], EventKey[E], E) -> Unit
|
|
pub fn[T] Context::entity(Self[T]) -> Entity[T]
|
|
pub fn[T] Context::entity_id(Self[T]) -> EntityId
|
|
pub fn[T] Context::notify(Self[T]) -> Unit
|
|
pub fn[T, W] Context::observe(Self[T], Entity[W], (T, Entity[W], Self[T]) -> Unit) -> Subscription
|
|
pub fn[T, G] Context::observe_global(Self[T], GlobalKey[G], (T, Self[T]) -> Unit) -> Subscription
|
|
pub fn[T, W] Context::observe_release(Self[T], Entity[W], (T, W, Self[T]) -> Unit) -> Subscription
|
|
pub fn[T] Context::observe_self(Self[T], (T, Self[T]) -> Unit) -> Subscription
|
|
pub fn[T] Context::on_release(Self[T], (T, App) -> Unit) -> Subscription
|
|
pub fn[T, R] Context::spawn(Self[T], async (WeakEntity[T], AsyncApp) -> R) -> @executor.Task[R]
|
|
pub fn[T, W, E] Context::subscribe(Self[T], Entity[W], EventKey[E], (T, Entity[W], E, Self[T]) -> Unit) -> Subscription
|
|
pub fn[T, E] Context::subscribe_self(Self[T], EventKey[E], (T, E, Self[T]) -> Unit) -> Subscription
|
|
pub fn[T] Context::weak_entity(Self[T]) -> WeakEntity[T]
|
|
|
|
pub struct Entity[T] {
|
|
// private fields
|
|
}
|
|
pub fn[T] Entity::downgrade(Self[T]) -> WeakEntity[T]
|
|
pub fn[T] Entity::entity_id(Self[T]) -> EntityId
|
|
pub fn[T] Entity::is_released(Self[T]) -> Bool
|
|
pub fn[T] Entity::read(Self[T], App) -> T
|
|
pub fn[T, R] Entity::update(Self[T], App, (T, Context[T]) -> R) -> R
|
|
pub impl[T] Eq for Entity[T]
|
|
pub impl[T] Hash for Entity[T]
|
|
pub impl[T] Show for Entity[T]
|
|
|
|
#derive(Compare, Eq, Hash, @debug.Debug)
|
|
pub(all) struct EntityId(Int32)
|
|
pub impl Show for EntityId
|
|
|
|
pub struct EventKey[E] {
|
|
id : Int32
|
|
name : String
|
|
// private fields
|
|
}
|
|
pub fn[E] EventKey::new(String) -> Self[E]
|
|
|
|
pub struct GlobalKey[G] {
|
|
id : Int32
|
|
name : String
|
|
// private fields
|
|
}
|
|
pub fn[G] GlobalKey::new(String) -> Self[G]
|
|
|
|
pub struct Reservation[T] {
|
|
// private fields
|
|
}
|
|
pub fn[T] Reservation::entity_id(Self[T]) -> EntityId
|
|
|
|
type SubscriberSet[K, C]
|
|
|
|
pub struct Subscription {
|
|
// private fields
|
|
}
|
|
pub fn Subscription::detach(Self) -> Unit
|
|
pub fn Subscription::is_active(Self) -> Bool
|
|
pub fn Subscription::join(Self, Self) -> Self
|
|
pub fn Subscription::new(() -> Unit) -> Self
|
|
pub fn Subscription::unsubscribe(Self) -> Unit
|
|
|
|
pub struct WeakEntity[T] {
|
|
// private fields
|
|
}
|
|
pub fn[T] WeakEntity::entity_id(Self[T]) -> EntityId
|
|
pub fn[T, R] WeakEntity::update(Self[T], App, (T, Context[T]) -> R) -> R?
|
|
pub fn[T] WeakEntity::upgrade(Self[T]) -> Entity[T]?
|
|
|
|
// Type aliases
|
|
|
|
// Traits
|