Harmony
Scripting Interface Documentation
Backdrop Class Reference

The Backdrop JavaScript global object. Get, set and add backdrops. More...

Public Slots

QScriptValue backdrops (String &group)
 Return the backdrops of a group. More...
 
bool setBackdrops (String &group, QScriptValue &backdrops)
 
bool addBackdrop (String &group, QScriptValue &backdrop)
 

Detailed Description

The Backdrop JavaScript global object. Get, set and add backdrops.

Member Function Documentation

◆ addBackdrop

bool Backdrop::addBackdrop ( String &  group,
QScriptValue &  backdrop 
)
slot

Add a single backdrop. New backdrop is on top all others.

Parameters
groupthe name of the group node.
backdrop- backdrop JSON object, as described above.
Returns
true for success, false => failure.

◆ backdrops

QScriptValue Backdrop::backdrops ( String &  group)
slot

Return the backdrops of a group.

This method returns an array of javascript objects where each object represent a single backdrop. Since backdrop do not have keys/unique ID, all backdrops are returned in the order they are defined in the group. The group node must be provided as input.

Here is an example of a backdrop object.

{
"position" : {"x":-1030,"y":-1191,"w":376,"h":284},
"title" : {"text":"HAIR","color":4278190080,"size":14,"font":"Arial"},
"description" : {"text":"This backdrop include all the modules of hair.\n","color":4278190080,"size":14,"font":"Arial"},
"color" : 4286859713
}

Color is rgba, in reverse order.

Parameters
groupname of the group node.
Returns
an array of backdrop object

◆ setBackdrops

bool Backdrop::setBackdrops ( String &  group,
QScriptValue &  backdrops 
)
slot

Set the backdrops for the specified group. This replaces all the backdrops in the group. The backdrop is in the format as the array returned by 'Backdrop.backdrops(group). The code will parse the javascript object and will set the backdrops on the group. If the

Parameters
groupthe name of the group node.
backdropsan array of backdrop objects or a single backdrop object. See description above for backdrop object.
Returns
true is the operation was done on a valid group. false => failure