Overview
Westeros is a lightweight Wayland Compositor library that allows users to create Wayland displays and also allows nesting and embedding displays that contain third-party applications. The WPE integration with Westeros enables a better video experience with increased smoothness and enhanced browser responsiveness. Westeros is designed for embedded systems and is a replacement for Weston.
- Westeros is small and simple making it easier to understand and maintain.
- Westeros caters to the needs of embedded systems over traditional desktop computing.
- Westeros is a shared library that provides an API for creating and operating a compositor.
- Westeros includes sample compositor app OR you can implement a custom compositor.
- Westeros allows an application to create a Wayland display within itself- referred to as an embedded compositor. The main UI can then control the embedded application window and lifecycle.
Architecture
eyJleHRTcnZJbnRlZ1R5cGUiOiIiLCJnQ2xpZW50SWQiOiIiLCJjcmVhdG9yTmFtZSI6IlVua25vd24gVXNlciAoeW1haGFyYW5hKSIsIm91dHB1dFR5cGUiOiJibG9jayIsImxhc3RNb2RpZmllck5hbWUiOiJVbmtub3duIFVzZXIgKHltYWhhcmFuYSkiLCJsYW5ndWFnZSI6ImVuIiwidWlDb25maWciOiJ7fSIsImRpYWdyYW1EaXNwbGF5TmFtZSI6IiIsInNGaWxlSWQiOiIiLCJhdHRJZCI6IjE0NDkwMTQxMCIsImRpYWdyYW1OYW1lIjoiV2VzdGVyb3MgQXJjaGl0ZWN0dXJlLmRyYXdpbyIsImFzcGVjdCI6IiIsImxpbmtzIjoiYXV0byIsImNlb05hbWUiOiJXZXN0ZXJvcyIsInRic3R5bGUiOiJ0b3AiLCJjYW5Db21tZW50IjpmYWxzZSwiZGlhZ3JhbVVybCI6IiIsImNzdkZpbGVVcmwiOiIiLCJib3JkZXIiOnRydWUsIm1heFNjYWxlIjoiMSIsIm93bmluZ1BhZ2VJZCI6MzE3MTk0MzksImVkaXRhYmxlIjpmYWxzZSwiY2VvSWQiOjMxNzE5NDM5LCJwYWdlSWQiOiIiLCJsYm94Ijp0cnVlLCJzZXJ2ZXJDb25maWciOnsiZW1haWxwcmV2aWV3IjoiMSJ9LCJvZHJpdmVJZCI6IiIsInJldmlzaW9uIjoxLCJtYWNyb0lkIjoiYzY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OjEsIm1hY3JvSWQiOiIzOTk2ODlkYi1kMzMzLTQ3NTktYWI5My0wOTZiZDA1ZThlMWYiLCJwcmV2aWV3TmFtZSI6Indlc3Rlcm9zIHVzZSBjYXNlLmRyYXdpby5wbmciLCJsaWNlbnNlU3RhdHVzIjoiT0siLCJzZXJ2aWNlIjoiIiwiaXNUZW1wbGF0ZSI6IiIsIndpZHRoIjoibnVsbCIsInNpbXBsZVZpZXdlciI6ZmFsc2UsImxhc3RNb2RpZmllZCI6MTYxNDY5NDU1MDAwMCwiZXhjZWVkUGFnZVdpZHRoIjpmYWxzZSwib0NsaWVudElkIjoiIn0=
The hosting application (MSO Guide) has control over the presentation & composition of third-party applications.
Advantages of Westeros over Weston Compositor
There are two main sets of attributes of Westeros that make it a good choice:
First
- Westeros is small, simple, and targets embedded systems.
- Its small code size makes it easier to understand and maintain.
- Westeros concentrates on functionality needed for embedded systems rather than trying to include features that are related to traditional desktop computing.
Second
- The functionality of Wayland composition is in a shared library that provides an API for creating and operating a compositor.
- You can use the included sample compositor app, or you can use the sample as a reference for implementing a custom compositor.
- The use of embedded compositors allows applications to create additional Wayland display within itself.
A system could have a primary user interface which allows other third party applications to provide additional functionality such as Netflix, and the primary UI can control the size and position of the third party UI to provide seamless integration. If, on the other hand, you want to implement a system where the user moves, resizes, minimizes, and maximizes various windows, and does drag and drop operations etc., then Weston is a more appropriate choice.
Westeros as Wayland Library
- Westeros implements the Wayland protocols and is compatible with applications that are built to use Wayland compositors.
- Westeros supports the creation of normal, nested, and embedded Wayland Compositors.
- Westeros includes memory management primitives in order to provide a better video experience.
Build Steps
Bitbake recipes for building wpewebkit, which is integrated with Westeros, are available in the meta-metrological
layer in the CMF space. Changes which are required to build and run Westeros-integrated applications on the Raspberry Pi platform, have been merged into meta-cmf-raspberrypi
CMF Layer.
Steps to run a Westeros-enabled Application
Since the Westeros compositor is integrated with the WPE Browser, any application/link using WPE can be used to demonstrate a Westeros compositor.
To run a Westeros-enabled application:
- Set the following environment variables prior to running a compositor-enabled application:
$ export XDG_RUNTIME_DIR=/run/user/0/
$ export WAYLAND_DISPLAY=WPE
- Run the Westeros compositor for WPE display server:
$ westeros --renderer /usr/lib/libwesteros_render_gl.so.0.0.0 --display WPE
- Run the wizardkit UI Application:
$ WPELauncher http://<RaspberryPi Hybrid Ip>:80/wizardkit/ui/guide.html
- Run the pre-built Westeros bits included with the test case:
$ westeros_test --display WPE