FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    HeadlessWindowExtensions

    trait · ferroui-headless · v0.5.0

    trait HeadlessWindowExtensions
    

    Set of extension methods to simplify usage of headless windows in the headless scenarios.

    The parameters that are optional in the original (RawInputModifiers.None) are always given.

    View source

    Members

    capture_rendered_frame

    fn capture_rendered_frame(self: &Self) -> Option<WriteableBitmap>
    

    Triggers a renderer timer tick and captures last rendered frame.

    Returns the bitmap with last rendered frame; None if nothing was rendered.

    Source

    get_last_rendered_frame

    fn get_last_rendered_frame(self: &Self) -> Option<WriteableBitmap>
    

    Reads last rendered frame. Note, in order to trigger rendering timer, FerroHeadlessPlatform::force_render_timer_tick method should be called.

    Returns the bitmap with last rendered frame; None if nothing was rendered.

    Panics

    Panics if the application uses the headless drawing (NotSupportedException): it draws nothing.

    Source

    key_press

    fn key_press(self: &Self, key: Key, modifiers: RawInputModifiers, physical_key: PhysicalKey, key_symbol: Option<&str>)
    

    Simulates a keyboard press on the headless window/toplevel.

    Source

    key_press_qwerty

    fn key_press_qwerty(self: &Self, physical_key: PhysicalKey, modifiers: RawInputModifiers)
    

    Simulates a keyboard press on the headless window/toplevel, as if typed on a QWERTY keyboard.

    Source

    key_release

    fn key_release(self: &Self, key: Key, modifiers: RawInputModifiers, physical_key: PhysicalKey, key_symbol: Option<&str>)
    

    Simulates a keyboard release on the headless window/toplevel.

    Source

    key_release_qwerty

    fn key_release_qwerty(self: &Self, physical_key: PhysicalKey, modifiers: RawInputModifiers)
    

    Simulates a keyboard release on the headless window/toplevel, as if typed on a QWERTY keyboard.

    Source

    key_text_input

    fn key_text_input(self: &Self, text: &str)
    

    Simulates a text input event on the headless window/toplevel.

    This event is independent of key_press and key_release. If you need to simulate text input to a TextBox or a similar control, please use this method.

    Source

    mouse_down

    fn mouse_down(self: &Self, point: Point, button: MouseButton, modifiers: RawInputModifiers)
    

    Simulates a mouse down on the headless window/toplevel.

    In the headless platform, there is a single mouse pointer. There are no helper methods for pen input; for touch, see touch_begin.

    Source

    mouse_move

    fn mouse_move(self: &Self, point: Point, modifiers: RawInputModifiers)
    

    Simulates a mouse move on the headless window/toplevel.

    Source

    mouse_up

    fn mouse_up(self: &Self, point: Point, button: MouseButton, modifiers: RawInputModifiers)
    

    Simulates a mouse up on the headless window/toplevel.

    Source

    mouse_wheel

    fn mouse_wheel(self: &Self, point: Point, delta: Vector, modifiers: RawInputModifiers)
    

    Simulates a mouse wheel on the headless window/toplevel.

    Source

    touch_begin

    fn touch_begin(self: &Self, point: Point, modifiers: RawInputModifiers) -> Rc<dyn IHeadlessTouchPointer>
    

    Begins a simulated touch contact on the headless window/toplevel.

    Each call begins an independent contact with its own unique touch id, so several contacts can be active at the same time to simulate multi-touch gestures.

    Returns a touch pointer representing the contact. Pass it to touch_move and touch_end, or dispose it to cancel the contact.

    Source

    touch_move

    fn touch_move(self: &Self, touch_pointer: &dyn IHeadlessTouchPointer, point: Point, modifiers: RawInputModifiers)
    

    Moves a simulated touch contact started by touch_begin.

    Source

    touch_end

    fn touch_end(self: &Self, touch_pointer: &dyn IHeadlessTouchPointer, point: Point, modifiers: RawInputModifiers)
    

    Ends a simulated touch contact started by touch_begin, as if the finger was lifted.

    Source

    drag_drop

    fn drag_drop(self: &Self, point: Point, type_: RawDragEventType, data: Rc<dyn IDataTransfer>, effects: DragDropEffects, modifiers: RawInputModifiers)
    

    Simulates a drag and drop target event on the headless window/toplevel. This event simulates a user moving files from another app to the current app.

    Source

    set_render_scaling

    fn set_render_scaling(self: &Self, scaling: f64)
    

    Changes the render scaling (DPI scaling) of the headless window/toplevel. This simulates a DPI change, triggering scaling changed notifications and a layout pass.

    Source

    Trait implementations

    Availability

    Extracted for x86_64-unknown-linux-gnu, aarch64-apple-darwin. Cargo features are listed in the crate index.