Version: 1.0
Status: ⚫⚫⚫
Compositor plugin for Thunder framework.
This document describes purpose and functionality of the Compositor plugin. It includes detailed specification of its configuration, methods and properties provided.
All identifiers on the interface described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such.
The table below provides and overview of acronyms used in this document and their definitions.
Acronym | Description |
---|---|
API | Application Programming Interface |
HTTP | Hypertext Transfer Protocol |
JSON | JavaScript Object Notation; a data interchange format |
JSON-RPC | A remote procedure call protocol encoded in JSON |
The table below provides and overview of terms and abbreviations used in this document and their definitions.
Term | Description |
---|---|
callsign | The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique. |
Ref ID | Description |
---|---|
HTTP | HTTP specification |
JSON-RPC | JSON-RPC 2.0 specification |
JSON | JSON specification |
Thunder | Thunder API Reference |
Compositor gives you controll over what is displayed on screen.
The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [Thunder].
The table below lists configuration options of the plugin.
Name | Type | Description |
---|---|---|
callsign | string | Plugin instance name (default: Compositor) |
classname | string | Class name: Compositor |
locator | string | Library name: libWPEFrameworkCompositor.so |
autostart | boolean | Determines if the plugin is to be started automatically along with the framework |
The following methods are provided by the Compositor plugin:
Compositor interface methods:
Method | Description |
---|---|
putontop | Puts client surface on top in z-order |
putbelow | Puts client surface below another surface |
select | Directs the input to the given client, disabling all the others |
Puts client surface on top in z-order.
Use this method to get a client's surface to the top position.
Name | Type | Description |
---|---|---|
params | object | |
params.client | string | Client name |
Name | Type | Description |
---|---|---|
result | null | Always null |
Code | Message | Description |
---|---|---|
2 | ERROR_UNAVAILABLE |
Client not found |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "Compositor.1.putontop",
"params": {
"client": "Netflix"
}
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": null
}
Puts client surface below another surface.
Use this method to reorder client surfaces in the z-order list.
Name | Type | Description |
---|---|---|
params | object | |
params.client | string | Client name to change z-order position |
params.relative | string | Client to put the other surface below |
Name | Type | Description |
---|---|---|
result | null | Always null |
Code | Message | Description |
---|---|---|
2 | ERROR_UNAVAILABLE |
Client(s) not found |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "Compositor.1.putbelow",
"params": {
"client": "Netflix",
"relative": "WebKitBrowser"
}
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": null
}
Directs the input to the given client, disabling all the others.
Use this method to direct all inputs to this client. The client that is receiving the inputs prior to this call will nolonger receive it anymore after this call.
Name | Type | Description |
---|---|---|
params | object | |
params.client | string | Client name |
Name | Type | Description |
---|---|---|
result | null | Always null |
Code | Message | Description |
---|---|---|
2 | ERROR_UNAVAILABLE |
Client not found |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "Compositor.1.select",
"params": {
"client": "Netflix"
}
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": null
}
The following properties are provided by the Compositor plugin:
Compositor interface properties:
Property | Description |
---|---|
resolution | Screen resolution |
zorder RO | List of compositor clients sorted by z-order |
geometry | Client surface geometry |
visiblity WO | Client surface visibility |
opacity WO | Client surface opacity |
Provides access to the screen resolution.
Use this property to set or retrieve the current resolution of the screen.
Name | Type | Description |
---|---|---|
(property) | string | Screen resolution (must be one of the following: unknown, 480i, 480p, 720p50, 720p60, 1080p24, 1080i50, 1080p50, 1080p60, 2160p50, 2160p60) |
Code | Message | Description |
---|---|---|
22 | ERROR_UNKNOWN_KEY |
Unknown resolution |
2 | ERROR_UNAVAILABLE |
Set resolution is not supported or failed |
1 | ERROR_GENERAL |
Failed to set resolution |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "Compositor.1.resolution"
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": "1080p24"
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "Compositor.1.resolution",
"params": "1080p24"
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": "null"
}
Provides access to the list of compositor clients sorted by z-order.
This property is read-only.
Use this property to retrieve the list of all clients in z-order. Each client has an z-order-value that determines its position with respect to the screen. The ordering is that the top position is closest to the screen, the next z-order-value first behind the top, and so on.
Name | Type | Description |
---|---|---|
(property) | array | List of compositor clients sorted by z-order |
(property)[#] | string | Client name |
Code | Message | Description |
---|---|---|
1 | ERROR_GENERAL |
Failed to get z-order |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "Compositor.1.zorder"
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": [
"Netflix"
]
}
Provides access to the client surface geometry.
Use this property to update or retrieve the geometry of a client's surface.
Name | Type | Description |
---|---|---|
(property) | object | Client surface geometry |
(property).x | number | Horizontal coordinate of the surface |
(property).y | number | Vertical coordinate of the surface |
(property).width | number | Surface width |
(property).height | number | Surface height |
The client shall be passed as the index to the property, e.g. Compositor.1.geometry@Netflix.
Code | Message | Description |
---|---|---|
2 | ERROR_UNAVAILABLE |
Client not found |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "Compositor.1.geometry@Netflix"
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": {
"x": 0,
"y": 0,
"width": 1280,
"height": 720
}
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "Compositor.1.geometry@Netflix",
"params": {
"x": 0,
"y": 0,
"width": 1280,
"height": 720
}
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": "null"
}
Provides access to the client surface visibility.
This property is write-only.
Use this property to set the client's surface visibility.
Name | Type | Description |
---|---|---|
(property) | string | Client surface visibility (must be one of the following: visible, hidden) |
The client shall be passed as the index to the property, e.g. Compositor.1.visiblity@Netflix.
Code | Message | Description |
---|---|---|
2 | ERROR_UNAVAILABLE |
Client not found |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "Compositor.1.visiblity@Netflix",
"params": "visible"
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": "null"
}
Provides access to the client surface opacity.
This property is write-only.
Use this property to set the client's surface opacity level.
Name | Type | Description |
---|---|---|
(property) | number | Opacity level (0 to 255; 0: fully transparent, 255: fully opaque) |
The client shall be passed as the index to the property, e.g. Compositor.1.opacity@Netflix.
Code | Message | Description |
---|---|---|
2 | ERROR_UNAVAILABLE |
Client not found |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "Compositor.1.opacity@Netflix",
"params": 127
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": "null"
}