Module platform

Source
Expand description

This module contains items that you need to use or implement if you want use Slint in an environment without one of the supplied platform backends such as qt or winit.

The primary interface is the platform::Platform trait. Pass your implementation of it to Slint by calling platform::set_platform() early on in your application, before creating any Slint components.

The Slint on Microcontrollers documentation has additional examples.

Modules§

femtovg_rendererrenderer-femtovg and non-Android
This module contains the femtovg_renderer::FemtoVGRenderer and related types.
software_renderersoftware-renderer
This module contains the SoftwareRenderer and related types.

Structs§

LayoutConstraints
This struct describes layout constraints of a resizable element, such as a window.
WindowProperties
This struct contains getters that provide access to properties of the Window element, and is used with WindowAdapter::update_window_properties.

Enums§

Clipboard
The clip board, used in Platform::clipboard_text and Platform::set_clipboard_text`
Key
The Key enum is used to map a specific key by name e.g. Key::Control to an internal used unicode representation. The enum is convertible to std::char and slint::SharedString. Use this with slint::platform::WindowEvent to supply key events to Slint’s platform abstraction.
PlatformError
The platform encountered a fatal error.
PointerEventButton
This enum describes the different types of buttons for a pointer event, typically on a mouse or a pencil.
SetPlatformError
This enum describes the different error scenarios that may occur when set_platform fails.
WindowEvent
A event that describes user input or windowing system events.

Traits§

EventLoopProxy
Trait that is returned by the Platform::new_event_loop_proxy
Platform
This trait defines the interface between Slint and platform APIs typically provided by operating and windowing systems.
Renderer
This trait represents a Renderer that can render a slint scene.
WindowAdapter
This trait represents the adaptation layer between the Window API and then windowing specific window representation, such as a Win32 HWND handle or a wayland_surface_t.

Functions§

duration_until_next_timer_update
Returns the duration before the next timer is expected to be activated. This is the largest amount of time that you can wait before calling update_timers_and_animations().
set_platform
Set the Slint platform abstraction.
update_timers_and_animations
Call this function to update and potentially activate any pending timers, as well as advance the state of any active animations.