class Tessell::Platform::FakeHost

Defined in:

tessell/platform/fake_host.cr

Constructors

Instance Method Summary

Instance methods inherited from class Tessell::Platform::Host

clipboard : Clipboard clipboard, close : Nil close, delay(ms : Int32) : Nil delay, ime : ImeSupport ime, poll_events(sink : Array(Tessell::Input::Event)) : Bool poll_events, present : Nil present, resized? : Bool resized?, scale : Float32 scale, ticks_ms : Int64 ticks_ms, title : String title, viewport : Tessell::Rect viewport

Constructor Detail

def self.new(width : Float32 = 800.0_f32, height : Float32 = 600.0_f32, scale : Float32 = 1.0_f32) #

[View source]

Instance Method Detail

def clipboard : Platform::Clipboard #

X1 契约实现:MemoryClipboard + committed text 能力如实上报。


[View source]
def clock_ms : Int64 #

[View source]
def close : Nil #

[View source]
def closed? : Bool #

[View source]
def event_log : Array(Tessell::Input::Event) #

[View source]
def frame_interval_ms : Int64 #

[View source]
def frame_interval_ms=(frame_interval_ms : Int64) #

[View source]
def frames : Int32 #

[View source]

[View source]
def inject(event : Tessell::Input::Event) : Nil #

[View source]
def key(code : Tessell::Input::KeyCode, modifiers : Tessell::Input::Modifiers = Tessell::Input::Modifiers.none) : Nil #

[View source]
def panic_on_unsupported : Bool #

[View source]
def panic_on_unsupported=(panic_on_unsupported : Bool) #

[View source]
def poll_events(sink : Array(Tessell::Input::Event)) : Bool #
Description copied from class Tessell::Platform::Host

泵一批输入事件进 sink(复用调用方缓冲);返回 false = 宿主要求退出。


[View source]
def present : Nil #
Description copied from class Tessell::Platform::Host

呈现当前帧(swap buffers / 位块传输)。


[View source]
def presents : Int32 #

[View source]
def pump_frame : Array(Tessell::Input::Event) #

泵一帧:推进虚拟时钟并返回本帧事件(合成帧步进,绝不 sleep)。


[View source]
def pump_log : Array(Int32) #

[View source]
def scale : Float32 #

[View source]
def scale=(scale : Float32) #

[View source]
def screenshot(path : String) : Nil #

未实现能力显式 panic(真实宿主无法应用的 op 不许静默成功)。


[View source]
def tap(x : Float32, y : Float32) : Nil #

按用户所见驱动:tap = 完整按压/抬起对(间隔 30ms 虚拟时钟内)。


[View source]
def text_input(text : String) : Nil #

[View source]
def title : String #

[View source]
def viewport : Tessell::Rect #

[View source]