Files
moon-gpui/src/window/pkg.generated.mbti
T
Sprite b388a70aa7 M7 test platform: Platform traits, Application, TestPlatform, VisualTestContext
- input: MouseExitEvent, ModifiersChangedEvent, PlatformInput, and
  DispatchEventResult.
- platform: core Platform and PlatformWindow traits plus WindowId,
  WindowBounds, WindowOptions, WindowParams, and ClipboardItem.
- window: Application, AnyWindowHandle, WindowHandle[V],
  Window::from_platform, dispatch_input, prevent_default, close/activation
  hooks, and replace_root_view while keeping standalone Window::new;
  closing a window releases its root view; hit-testing runs between
  prepaint and paint gated by pointer containment.
- platform/test: TestPlatform, TestWindow (recording Scenes and simulating
  frames, input, resize, scale factor, active/hover status, and close),
  TestAppContext, and VisualTestContext with automatic frame pumping and
  a runaway-redraw guard.
- Tests & example: platform tests, TestPlatform/VisualTestContext unit and
  panic-on-misuse tests, elements visual integration tests, and
  src/examples/card updated to run on TestAppContext/VisualTestContext.
- Docs: updated docs/PORTING.md and README.md.
2026-11-24 23:40:38 +00:00

199 lines
8.5 KiB
Plaintext

// Generated using `moon info`, DON'T EDIT IT
package "experiments/gpui/window"
import {
"experiments/gpui/app",
"experiments/gpui/color",
"experiments/gpui/geometry",
"experiments/gpui/input",
"experiments/gpui/layout",
"experiments/gpui/platform",
"experiments/gpui/scene",
"experiments/gpui/style",
"moonbitlang/core/debug",
}
// Values
pub fn application_for(@app.App) -> Application?
pub fn empty() -> AnyElement
pub fn fill(@geometry.Bounds[@geometry.Pixels], @color.Background) -> PaintQuad
pub fn[T, E] listener(@app.Context[T], (T, E, Window, @app.Context[T]) -> Unit) -> (E, Window, @app.App) -> Unit
pub fn outline(@geometry.Bounds[@geometry.Pixels], @color.Hsla, border_style? : @scene.BorderStyle) -> PaintQuad
// Errors
// Types and methods
pub struct AnyElement {
// private fields
}
pub fn AnyElement::bounds(Self) -> @geometry.Bounds[@geometry.Pixels]?
pub fn AnyElement::new(&Element) -> Self
pub fn AnyElement::paint(Self, Window, @app.App) -> Unit
pub fn AnyElement::prepaint(Self, Window, @app.App) -> Unit
pub fn AnyElement::request_layout(Self, Window, @app.App) -> @layout.LayoutId
pub impl IntoElement for AnyElement
pub struct AnyView {
entity_id : @app.EntityId
// private fields
}
pub fn[V : Render] AnyView::from_entity(@app.Entity[V]) -> Self
pub fn AnyView::into_any_element(Self) -> AnyElement
pub impl IntoElement for AnyView
#derive(Compare, Eq, Hash, @debug.Debug)
pub struct AnyWindowHandle {
id : @platform.WindowId
}
pub fn[R] AnyWindowHandle::update(Self, Application, (AnyView, Window, @app.App) -> R) -> R?
pub fn AnyWindowHandle::window_id(Self) -> @platform.WindowId
pub struct Application {
app : @app.App
platform : &@platform.Platform
// private fields
}
pub fn Application::active_window(Self) -> AnyWindowHandle?
pub fn Application::app(Self) -> @app.App
pub fn Application::close_window(Self, @platform.WindowId) -> Unit
pub fn Application::open_url(Self, String) -> Unit
pub fn[V : Render] Application::open_window(Self, @platform.WindowOptions, (Window, @app.App) -> @app.Entity[V]) -> WindowHandle[V]
pub fn Application::platform(Self) -> &@platform.Platform
pub fn Application::quit(Self) -> Unit
pub fn Application::read_from_clipboard(Self) -> @platform.ClipboardItem?
pub fn Application::refresh_windows(Self) -> Unit
pub fn Application::run(Self, (Self) -> Unit) -> Unit
pub fn Application::set_cursor_style(Self, @style.CursorStyle) -> Unit
pub fn[R] Application::update_window(Self, AnyWindowHandle, (AnyView, Window, @app.App) -> R) -> R?
pub fn Application::window(Self, @platform.WindowId) -> Window?
pub fn Application::window_count(Self) -> Int32
pub fn Application::windows(Self) -> Array[AnyWindowHandle]
pub fn Application::with_platform(&@platform.Platform) -> Self
pub fn Application::write_to_clipboard(Self, @platform.ClipboardItem) -> Unit
pub struct ElementStateKey[S] {
id : Int32
name : String
// private fields
}
pub fn[S] ElementStateKey::new(String) -> Self[S]
#derive(Eq, @debug.Debug)
pub(all) struct Hitbox {
id : Int32
bounds : @geometry.Bounds[@geometry.Pixels]
content_mask : @geometry.ContentMask[@geometry.Pixels]
behavior : HitboxBehavior
}
pub fn Hitbox::is_hovered(Self, Window) -> Bool
#derive(Eq, Hash, @debug.Debug)
pub(all) enum HitboxBehavior {
Normal
BlockMouse
}
#derive(Eq, @debug.Debug)
pub(all) struct PaintQuad {
bounds : @geometry.Bounds[@geometry.Pixels]
corner_radii : @geometry.Corners[@geometry.Pixels]
background : @color.Background
border_widths : @geometry.Edges[@geometry.Pixels]
border_color : @color.Hsla
border_style : @scene.BorderStyle
}
pub struct Window {
// private fields
}
pub fn Window::activate_window(Self) -> Unit
pub fn Window::bounds(Self) -> @geometry.Bounds[@geometry.Pixels]
pub fn Window::close(Self) -> Unit
pub fn Window::content_mask(Self) -> @geometry.ContentMask[@geometry.Pixels]
pub fn Window::default_prevented(Self) -> Bool
pub fn Window::dispatch_input(Self, @input.PlatformInput) -> @input.DispatchEventResult
pub fn Window::dispatch_mouse_event(Self, @input.MouseEvent) -> Bool
pub fn Window::draw(Self) -> @scene.Scene
pub fn Window::draw_if_dirty(Self) -> Bool
pub fn Window::element_offset(Self) -> @geometry.Point[@geometry.Pixels]
pub fn Window::element_opacity(Self) -> Double
pub fn Window::frame_count(Self) -> Int32
pub fn Window::global_element_id(Self) -> String?
pub fn Window::insert_hitbox(Self, @geometry.Bounds[@geometry.Pixels], HitboxBehavior) -> Hitbox
pub fn Window::is_closed(Self) -> Bool
pub fn Window::is_dirty(Self) -> Bool
pub fn Window::is_window_active(Self) -> Bool
pub fn Window::is_window_hovered(Self) -> Bool
pub fn Window::layout_bounds(Self, @layout.LayoutId) -> @geometry.Bounds[@geometry.Pixels]
pub fn Window::modifiers(Self) -> @input.Modifiers
pub fn Window::mouse_position(Self) -> @geometry.Point[@geometry.Pixels]
pub fn Window::new(@app.App, @geometry.Size[@geometry.Pixels], scale_factor? : Double, rem_size? : @geometry.Pixels) -> Self
pub fn Window::on_close(Self, (@app.App) -> Unit) -> Unit
pub fn Window::on_mouse_event(Self, (@input.MouseEvent, @input.DispatchPhase, Self, @app.App) -> Unit) -> Unit
pub fn Window::on_should_close(Self, (Self, @app.App) -> Bool) -> Unit
pub fn Window::on_window_active_change(Self, (Self, @app.App) -> Unit) -> Unit
pub fn Window::paint_drop_shadows(Self, @geometry.Bounds[@geometry.Pixels], @geometry.Corners[@geometry.Pixels], Array[@style.BoxShadow]) -> Unit
pub fn Window::paint_inset_shadows(Self, @geometry.Bounds[@geometry.Pixels], @geometry.Corners[@geometry.Pixels], Array[@style.BoxShadow]) -> Unit
pub fn Window::paint_path(Self, Array[Array[@geometry.Point[@geometry.Pixels]]], @color.Background) -> Unit
pub fn Window::paint_primitive(Self, @scene.Primitive) -> Unit
pub fn Window::paint_quad(Self, PaintQuad) -> Unit
pub fn Window::paint_style(Self, @style.Style, @geometry.Bounds[@geometry.Pixels], () -> Unit) -> Unit
pub fn Window::prevent_default(Self) -> Unit
pub fn Window::read_from_clipboard(Self) -> @platform.ClipboardItem?
pub fn Window::refresh(Self) -> Unit
pub fn Window::rem_size(Self) -> @geometry.Pixels
pub fn Window::remove_window(Self) -> Unit
pub fn[V : Render] Window::replace_root_view(Self, (Self, @app.Context[V]) -> V) -> @app.Entity[V]
pub fn Window::request_layout(Self, @style.Style, Array[@layout.LayoutId]) -> @layout.LayoutId
pub fn Window::request_measured_layout(Self, @style.Style, (@geometry.Size[@geometry.Pixels?], @geometry.Size[@layout.AvailableSpace]) -> @geometry.Size[@geometry.Pixels]) -> @layout.LayoutId
pub fn Window::resize(Self, @geometry.Size[@geometry.Pixels], scale_factor? : Double) -> Unit
pub fn Window::root_view(Self) -> AnyView?
pub fn Window::scale_factor(Self) -> Double
pub fn Window::scene(Self) -> @scene.Scene
pub fn Window::set_cursor_style(Self, @style.CursorStyle) -> Unit
pub fn Window::set_rem_size(Self, @geometry.Pixels) -> Unit
pub fn[V : Render] Window::set_root_view(Self, @app.Entity[V]) -> Unit
pub fn Window::set_window_title(Self, String) -> Unit
pub fn Window::stop_propagation(Self) -> Unit
pub fn Window::viewport_size(Self) -> @geometry.Size[@geometry.Pixels]
pub fn Window::window_id(Self) -> @platform.WindowId
pub fn Window::window_title(Self) -> String?
pub fn[R] Window::with_content_mask(Self, @geometry.ContentMask[@geometry.Pixels]?, () -> R) -> R
pub fn[R] Window::with_element_id(Self, String?, () -> R) -> R
pub fn[R] Window::with_element_offset(Self, @geometry.Point[@geometry.Pixels], () -> R) -> R
pub fn[R] Window::with_element_opacity(Self, Double?, () -> R) -> R
pub fn[S, R] Window::with_element_state(Self, ElementStateKey[S], (S?) -> (R, S)) -> R
pub fn Window::write_to_clipboard(Self, @platform.ClipboardItem) -> Unit
pub struct WindowHandle[V] {
id : @platform.WindowId
// private fields
}
pub fn[V] WindowHandle::entity(Self[V]) -> @app.Entity[V]
pub fn[V, R] WindowHandle::read_with(Self[V], Application, (V, @app.App) -> R) -> R?
pub fn[V] WindowHandle::to_any(Self[V]) -> AnyWindowHandle
pub fn[V, R] WindowHandle::update(Self[V], Application, (V, Window, @app.Context[V]) -> R) -> R?
pub fn[V] WindowHandle::window_id(Self[V]) -> @platform.WindowId
// Type aliases
// Traits
pub(open) trait Element {
fn request_layout(Self, Window, @app.App) -> @layout.LayoutId
fn prepaint(Self, @geometry.Bounds[@geometry.Pixels], Window, @app.App) -> Unit
fn paint(Self, @geometry.Bounds[@geometry.Pixels], Window, @app.App) -> Unit
}
pub(open) trait IntoElement {
fn into_any_element(Self) -> AnyElement
}
pub impl[V : Render] IntoElement for @app.Entity[V]
pub(open) trait Render {
fn render(Self, Window, @app.Context[Self]) -> AnyElement
}