portico/Sources/Portico/Core/Mountable.swift

10 lines
421 B
Swift

import Gtk
/// SPI mount requirement types that back directly to a `Gtk.Widget`
/// conform to this protocol so ``AnyView`` can call `mount` via
/// runtime-cast dispatch without exposing `Mountable` in the public
/// `View` hierarchy.
@_spi(Portico) @MainActor public protocol Mountable {
/// Mounts the receiver into a `Gtk.Widget`, using the given context.
func mount(_ ctx: MountContext) -> Gtk.Widget
}