lv_wayland_backend_private.h
API reference for lv_wayland_backend_private.h
Functions
lv_wayland_set_backend_display_data
Set the backend-specific display data.
The backend display data is set automatically to the return type of the init_display/resize_display, this function should only be used in special cases where it needs to be overridden temporarily
void lv_wayland_set_backend_display_data(lv_display_t *display, void *data)| Name | Type | Description |
|---|---|---|
[in] display | lv_display_t * | Pointer to the LVGL display object |
[in] data | void * | Pointer to backend-specific display data |
lv_wayland_get_backend_display_data
Get the backend-specific display data.
Retrieves the per-display data pointer that was returned by the backend's init_display/resize_display functions. This allows the backend to access its own display-specific state and resources.
void * lv_wayland_get_backend_display_data(lv_display_t *display)| Name | Type | Description |
|---|---|---|
[in] display | lv_display_t * | Pointer to the LVGL display object |
Returns: void * — Pointer to backend-specific display data
This returns the value that was returned by lv_wayland_backend_init_display_t or lv_wayland_backend_resize_display_t
See also: lv_wayland_backend_init_display_t
lv_wayland_get_window_surface
Get the Wayland surface for rendering.
Retrieves the wl_surface object associated with the display window. This is the surface that the backend must use for all rendering operations (attaching buffers, committing frames, etc.).
struct wl_surface * lv_wayland_get_window_surface(lv_display_t *display)| Name | Type | Description |
|---|---|---|
[in] display | lv_display_t * | Pointer to the LVGL display object |
Returns: struct wl_surface * — Pointer to the Wayland surface for rendering, or NULL if not available
This surface is managed by the Wayland driver and must not be destroyed by the backend
All rendering output should be attached to this surface
lv_wayland_backend_init_all
Initializes every compiled-in backend.
A backend whose init() fails is marked unavailable and skipped by all the functions below.
void lv_wayland_backend_init_all(void)lv_wayland_backend_deinit_all
Deinitializes every available backend.
void lv_wayland_backend_deinit_all(void)lv_wayland_backend_global_handler
Dispatches a global handler call to all available backends.
void lv_wayland_backend_global_handler(struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version)| Name | Type | Description |
|---|---|---|
[in] registry | struct wl_registry * | Wayland registry object |
[in] name | uint32_t | Numeric name of the global object |
[in] interface | const char * | String name of the interface |
[in] version | uint32_t | Version number of the interface |
lv_wayland_backend_init_display
Loops through all available backends to find one capable of initializing a display.
The function loops through all available backends until one can initialize a display
lv_result_t lv_wayland_backend_init_display(lv_wayland_backend_display_data_t *backend_ddata, lv_display_t *display, int32_t width, int32_t height)| Name | Type | Description |
|---|---|---|
[out] backend_ddata | lv_wayland_backend_display_data_t * | Backend display data |
[in] display | lv_display_t * | The display to initialize for |
[in] width | int32_t | the display width |
[in] height | int32_t | the display height |
Returns: lv_result_t — LV_RESULT_OK if the display was initialized else LV_RESULT_INVALID
lv_wayland_backend_deinit_display
Deinitializes a display.
void lv_wayland_backend_deinit_display(lv_wayland_backend_display_data_t *backend_ddata, lv_display_t *display)| Name | Type | Description |
|---|---|---|
[in] backend_ddata | lv_wayland_backend_display_data_t * | Backend display data of the display |
[in] display | lv_display_t * | The display to deinitialize |
Structs
lv_wayland_backend_ops_t
Wayland backend operations structure.
This structure defines the general set of operations that a Wayland backend must implement. All function pointers must be non-NULL.
| Member | Type | Description |
|---|---|---|
init | lv_wayland_backend_init_t | Initialize backend data |
global_handler | lv_wayland_backend_global_handler_t | Handle Wayland global objects |
deinit | lv_wayland_backend_deinit_t | Deinitialize backend data |
Lifecycle Order:: 1. init() - Initialize backend data 2. global_handler() - Called for each Wayland global (may be called multiple times) 3. deinit() - Clean up backend data
lv_wayland_backend_display_ops_t
Wayland backend display operations structure.
This structure defines the display specific set of operations that a Wayland backend must implement. All function pointers must be non-NULL.
| Member | Type | Description |
|---|---|---|
init_display | lv_wayland_backend_init_display_t | Initialize a new display |
resize_display | lv_wayland_backend_resize_display_t | Resize or reconfigure display |
deinit_display | lv_wayland_backend_destroy_display_t | Destroy a display |
Lifecycle Order:: 1. init_display() - Create display (may be called multiple times for multiple displays) 2. resize_display() - Resize display (called as needed) 3. deinit_display() - Destroy display (called once per display)
lv_wayland_backend_display_data_t
| Member | Type | Description |
|---|---|---|
ops | const lv_wayland_backend_display_ops_t * | Backend display specific operations |
backend_data | void * | General backend data |
display_data | void * | Specific display backend data |
Used by 2 functions
lv_wayland_backend_init_display— parambackend_ddatalv_wayland_backend_deinit_display— parambackend_ddata
Typedefs
lv_wayland_backend_init_t
lv_wayland_backend_init_tInitialize the backend data.
This function is called once when the Wayland driver is initialized to create the global backend data. The context written to backend_data is passed back to every other operation of the backend. It may be left NULL by a backend that keeps no global state.
lv_wayland_backend_deinit_t
lv_wayland_backend_deinit_tDeinitialize the backend data.
This function is called when the Wayland driver is deinitialized. It must clean up all resources allocated in the init function and free the backend context.
lv_wayland_backend_init_display_t
lv_wayland_backend_init_display_tInitialize a new display.
This function is called when creating a new LVGL display on Wayland. It should allocate and initialize per-display resources needed for rendering.
lv_wayland_backend_resize_display_t
lv_wayland_backend_resize_display_tResize or reconfigure a display.
This function is called when a display needs to be resized or when its rotation is modified. The backend should update its rendering resources accordingly.
lv_wayland_backend_destroy_display_t
lv_wayland_backend_destroy_display_tDestroy a display.
This function is called when an LVGL display is being destroyed. It must clean up all per-display resources and free the display data that was allocated in init_display.
lv_wayland_backend_global_handler_t
lv_wayland_backend_global_handler_tHandle Wayland global objects.
This function is called for every global object advertised by the Wayland compositor. The backend can use this to bind to Wayland protocols it requires (e.g., wl_shm, EGL extensions, DMA-BUF protocols, etc.).
Dependencies
lvgl_public.hwayland-client.h
Last updated on