Module api

Module api 

Source
Expand description

This module contains types that are public and re-exported in the slint-rs as well as the slint-interpreter crate as public API.

Re-exports§

pub use crate::SharedString;
pub use crate::future::*;

Structs§

LogicalPosition
A position represented in the coordinate space of logical pixels. That is the space before applying a display device specific scale factor.
LogicalSize
A size represented in the coordinate space of logical pixels. That is the space before applying a display device specific scale factor.
PhysicalPosition
A position represented in the coordinate space of physical device pixels. That is the space after applying a display device specific scale factor to pixels from the logical coordinate space.
PhysicalSize
A size represented in the coordinate space of physical device pixels. That is the space after applying a display device specific scale factor to pixels from the logical coordinate space.
Weak
Struct that’s used to hold weak references of a Slint component
Window
This type represents a window towards the windowing system, that’s used to render the scene of a component. It provides API to control windowing system specific aspects such as the position on the screen.

Enums§

CloseRequestResponse
This enum describes whether a Window is allowed to be hidden when the user tries to close the window. It is the return type of the callback provided to Window::on_close_requested.
EventLoopError
Error returned from the invoke_from_event_loop() and quit_event_loop() function
GraphicsAPI
This enum describes a low-level access to specific graphics APIs used by the renderer.
PlatformError
The platform encountered a fatal error.
RenderingState
This enum describes the different rendering states, that will be provided to the parameter of the callback for set_rendering_notifier on the slint::Window.
SetRenderingNotifierError
This enum describes the different error scenarios that may occur when the application registers a rendering notifier on a slint::Window.
WindowPosition
The position of the window in either physical or logical pixels. This is used with Window::set_position.
WindowSize
The size of a window represented in either physical or logical pixels. This is used with Window::set_size.

Traits§

ComponentHandle
This trait describes the common public API of a strongly referenced Slint component. It allows creating strongly-referenced clones, a conversion into/ a weak pointer as well as other convenience functions.
Global
This trait is used to obtain references to global singletons exported in .slint markup. Alternatively, you can use ComponentHandle::global to obtain access.

Functions§

invoke_from_event_loop
Adds the specified function to an internal queue, notifies the event loop to wake up. Once woken up, any queued up functors will be invoked.
quit_event_loop
Schedules the main event loop for termination. This function is meant to be called from callbacks triggered by the UI. After calling the function, it will return immediately and once control is passed back to the event loop, the initial call to slint::run_event_loop() will return.
set_xdg_app_id
Sets the application id for use on Wayland or X11 with xdg compliant window managers. This must be set before the window is shown, and has only an effect on Wayland or X11.