Actions Definitions

Stock Action Definitions

Storyboard supports a stock list of stock actions.  These actions are all prefixed with “gra.” And can be used by your application.  

gra.screen

Cause a screen transition to occur by replacing the current screen with the new one.  The data argument is as follows:

screen=[screen name]

gra.screen.fade

Causes a screen transition to occur by fading the old screen into the new one. The data argument is as follows:

screen=[screen name]

rate Defines how the alpha values will change (string)

linear

easein

easeout

easeinout

bounce

frames Number of frames for the transition (number)

duration Length of the transition in milliseconds number)

gra.screen.hold

Hold all screen updates.  While held a screen will not redraw.

gra.screen.release

Release a held screen.  If a screen was damaged during a hold then the redraw occurs when this action is triggered.

gra.datachange

Change the data on a key base on the argument list.

gra.screen.focus.set

Focus a particular control. The data argument is as follows, if both are set then the "index" is used:

        index= The focus index to set focus to

        control= The name of a control to focus

gra.screen.focus.next

Focus the next focusable control. The data argument is as follows:

        min=        The minimum focus index to move to (number)

        max=        The maximum focus index to move to (number)

gra.screen.focus.prev

Focus the previous focusable control. The data argument is as follows:

        min=        The minimum focus index to move to (number)

        max=        The maximum focus index to move to (number)

gra.screen.focus.direction

Focus the next control in a direction. The data argument is as follows:

        min=        The minimum focus index to move to (number)

        max=        The maximum focus index to move to (number)

        direction=[up|down|left|right]        The direction to move in

gra.table.scroll

Scrolls the content of one or more tables. The data argument is as follows:

        control=   The name of the table to navigate, may occur more than once (string)

        row=   The absolute row to start navigating from (number, default is current row)

        col=   The absolute column to start navigating from (number, default is current col)

        delta_row=    The number of rows to move, positive == down, negative == up (number)

        delta_col=    The number of columns to move, positive == right, negative == left (number)

        duration=    The number of ms to perform the navigation in, 0 == immediately (number)

        fps=    The desired frame rate, 0 == immediately (number)

gra.table.resize

Sets the size of the data for a table. The data argument is as follows:

        control=   The name of the table to adjust, only one accepted (string)

        rows=     The number of rows for the table (number, default is current table rows)

        cols=    The number of columns for the table (number, default is current table columns)

gra.table.navigate

Navigates the cells of a table, sets the active cell which in turn generates the cell focus events.  If the new active cell is not visible the table will be scrolled in order to show this cell.  The data argument is as follows:

        control=   The name of the table to adjust (string)

        duration=    The number of ms to perform the navigation in, 0 == immediately (number)

        fps=    The desired frame rate, 0 == immediately (number)

direction = The type of navigation to do (string) , values can be

        set        Set the active cell to row,col

        next        Move to the next cell (columns then rows)

        prev        Move to the previous cell (columns then rows)

        up        Move to the cell above

        down        Move to the cell below

        left        Move to the cell left

        right        Move to the cell right

        home        Move to the first cell (1,1)

        end        Move to the last cell (max_row,max_col)

        row=     The row to set the active cell to (only valid with direction=set) (number)

       col=   The col to set the active cell to (only valid with direction=set) (number)

gra.log

Use the GRE logging mechanism to output a message. The data value is the message to output.

For example to log a diagnostic message:

<action type="log" data="I've received the event" />

gra.control.zorder

Move a control forward or back in the control heiarchy within it's layer. If the direction is backward or forward then the control moves in that direciton one level If the direction is toback or tofront then the control moves relative to the reference control

direction = The direction to move the control in

        tofront        Move in front of reference control, if no reference control then move to front of all other controls

        toback        Move in back of reference control, if no reference control then move to back of all other controls

        forward        Move forward one level

        backward        Move back one level

reference=name of a control to move relative to, or none

control=The name of the control to move

gra.resource.dump_def

Remove a resource which is managed by the resource manager.

pool= The pool of resources to target (“image” or “font”)

ref= A reference to a targeted resource to dump if required

Plugin Action Definitions

The following actions are only available when optional Storyboard plugins has been loaded.

gra.lua

Cause a lua script function to execute.  The function that is executed is the value associated with the 'script=' data member.  The remaining data values are comma separated key=value pairs that are provided to the lua function as values in the argument table.

For example to call the lua function 'myfunction' with the value of the application data 'myvar' assigned to the key 'firstargument' you would have an action that looks like:

<action ... type="lua" data="script=myfunction,firstargument=${app:myvar}" />

Requires :  libgre-plugin-lua.so

gra.animate

Start an animation.  Animations are started base don their name. Each animation can have an optional unique "id" which can later be used to stop a particular animation. The data argument is as follows:

name=The animation name to start (string)

id=An optional id name for the animation

When the animation completes it will emit a notification event.  The event is as follows:

gre.animate.complete.[name]

Requires: libgre-plugin-animation.so

gra.animate.stop

Stop an animation.  If you stop an animation only by "name" then all running animations with that name will stop and emit a complete event. If you stop an anaimation by "id" then only animations with that "id" will stop and emit a complete event. The data argument is as follows:

name=The animation name to stop (string)

id=An optional id name for the animation t stop

When the animation stops it will emit a notification event.  The event is as follows:

gre.animate.complete.[name]

Requires: libgre-plugin-animation.so

gra.timer

Start, stop and control a timer.  The data argument for the timer action are:

name=[timername]   The name to use with this timer (required)

rtime=[mstime]  The relative time delay in ms to use for the first firing

atime=[date]  The YY:MM:DD:HH:mm:ss:ms absolute time to use for the first firing

repeat=[mstime]   The number of ms to repeat the timer after the initial firing (optional)

count=number    The number of times you want this event to fire before stopping (optional)     

One of rtime or atime must be specified and a value of 0 for rtime/atime and repeat indicates that the timer should stop firing.

For example, to start a timer that fires in 1s from the event and then every 500ms afterwards:

<action ... type="timer" data="name=MyTimer,rtime=1000,repeat=500" />

Then to stop the timer:

<action ... type="timer" data="name=MyTimer,rtime=0,repeat=0" />

An event will be generated each time that the timer fires and will be named timer.<name> so for the examples above, the event would be generated would be timer.MyTimer.

Requires :  libgre-plugin-timer.so       

gra.screen.path

Causes a screen transition to occur by fading the old screen into the new one. The data argument is as follows:

screen=[screen name]

        rate                 Defines how the alpha values will change (string)

        linear

        easein

        easeout

        easeinout

        bounce

        frames              Nnumber of frames for the transition (number)

        duration         Length of the transition in milliseconds (number)

        direction      Direction to transition from (string)

                left

                right

                top

                bottom

Requires: libgre-plugin-screen-path.so

gra.screen.scale

Causes a screen transition to occur by scaling the old screen into the new one.  The data argument is as follows:

        screen=[screen name]

        frames                number of frames for the transition (number)

        duration         Length of the transition in milliseconds (number)

        layers                which layers to transition, default is all (string)

        all                full screen

      delta        only layers that are different between the screens

Requires: libgre-plugin-screen-scale.so

gra.redirect

Redirect an event to another GREIO channel:

        channel=[channel name]

Requires: libgre-plugin-event-redirect.so

gra.greio

Causes a screen transition to occur by scaling the old screen into the new one.  The data argument is as follows:

        name        GREIO channel name

        event        Event name

        target        event target

        format        Event data format

        data        Event data

Requires: libgre-plugin-greio.so

gra.screendump

Dump the contents of the screen to an image file.

        filename        The name of the image file to create

Requires: libgre-plugin-screen-dump.so