Events Definitions

Stock Event Definitions

Storyboard supports a stock list of common events.  These events are all prefixed with “gre.” and can be used by your application.  

System Events

GR_EVENT_APP_INIT “gre.init”

The system has been initialized and is ready.  This is the first event set in the system.

Data:

        No data payload

GR_EVENT_APP_QUIT “gre.quit”

The system is being shutdown.

Data:

        No data payload

GR_EVENT_SCREEN_REDRAW “gre.redraw”

An area of the screen has been damaged (visible data has changed). A redraw event may not cause actual screen drawing if the control which has changed is hidden or offscreen.

Data:

        int        x

        int        y

        int        width

        int        height

If the values are all 0 then the entire screen has been damaged

Pointer events

The following events are generated in response to a device such as a mouse or a touchscreen.  These events are targeted at specific controls based upon the controls location and sensitivity.

GR_EVENT_PRESS “gre.press”

A mouse/touchscreen has been pressed.

Data

unsigned button (this will be a combination of the following)      

        GR_EVENT_BTN_LEFT - 0x0001: if this is a touchscreen then the button is always left
        GR_EVENT_BTN_MIDDLE - 0x0002
        GR_EVENT_BTN_RIGHT - 0x0004

unsigned timestamp

This is an event timestamp which is in milliseconds from application start.

int16 subtype

        GR_EVENT_RELEASE_IN

        GR_EVENT_RELEASE_OUT

int16        x

int16        y

int16 z

This paramter is render manager dependent.

GR_EVENT_RELEASE “gre.release”

A mouse/trouchscreen has been released.

unsigned button (this will be a combination of the following)      

        GR_EVENT_BTN_LEFT - 0x0001: if this is a touchscreen then the button is always left
        GR_EVENT_BTN_MIDDLE - 0x0002
        GR_EVENT_BTN_RIGHT - 0x0004

unsigned timestamp

This is an event timestamp which is in milliseconds from application start.

int16 subtype

        GR_EVENT_RELEASE_IN

        GR_EVENT_RELEASE_OUT

int16        x

int16        y

int16 z

This paramter is render manager dependent.

GR_EVENT_TOUCH “gre.touch”

If a mouse/touchscreen presses and then releases on the same control then a touch event will be generated.  This is useful for activating button style elements.  If the release is found to intersect a different control then a touch event is not generated.

unsigned button (this will be a combination of the following)      

        GR_EVENT_BTN_LEFT - 0x0001

unsigned timestamp

This is an event timestamp which is in milliseconds from application start.

int16 subtype

        GR_EVENT_RELEASE_IN

        GR_EVENT_RELEASE_OUT

int16        x

int16        y

int16 z

This paramter is render manager dependent.

GR_EVENT_MOTION “gre.motion”

A mouse/touchscreen is generating motion or drag events.  This can happen with or without a button pressed when the source is a mouse.

Data:

unsigned button (this will be a combination of the following)      

        GR_EVENT_BTN_LEFT - 0x0001: if this is a touchscreen then the button is always left
        GR_EVENT_BTN_MIDDLE - 0x0002
        GR_EVENT_BTN_RIGHT - 0x0004

unsigned timestamp

This is an event timestamp which is in milliseconds from application start.

int16 subtype

        GR_EVENT_RELEASE_IN

        GR_EVENT_RELEASE_OUT

int16        x

int16        y

int16 z

This paramter is render manager dependent.

GR_EVENT_INBOUND “gre.inbound”

A mouse/touchscreen has entered a control (if dragging a pointer or finger).  This event is generated once the coordinates enter a control boundary.  If mouse motion events are disabled in the render manager then this event will not be generated.

Data:

unsigned button (this will be a combination of the following)      

        GR_EVENT_BTN_LEFT - 0x0001: if this is a touchscreen then the button is always left
        GR_EVENT_BTN_MIDDLE - 0x0002
        GR_EVENT_BTN_RIGHT - 0x0004

unsigned timestamp

This is an event timestamp which is in milliseconds from application start.

int16 subtype

        GR_EVENT_RELEASE_IN

        GR_EVENT_RELEASE_OUT

int16        x

int16        y

int16 z

This paramter is render manager dependent.

GR_EVENT_INBOUND “gre.outbound”

A mouse/touchscreen has left a control (if dragging a pointer or finger).  This event is generated once the coordinates leave a control boundary.  If mouse motion events are disabled in the render manager then this event will not be generated.

Data:

unsigned button (this will be a combination of the following)      

        GR_EVENT_BTN_LEFT - 0x0001: if this is a touchscreen then the button is always left
        GR_EVENT_BTN_MIDDLE - 0x0002
        GR_EVENT_BTN_RIGHT - 0x0004

unsigned timestamp

This is an event timestamp which is in milliseconds from application start.

int16 subtype

        GR_EVENT_RELEASE_IN

        GR_EVENT_RELEASE_OUT

int16        x

int16        y

int16 z

This paramter is render manager dependent.

Keyboard Events

The following events are generated if a keyboard is present and supported by the render manager.

GR_EVENT_KEY_DOWN “gre.keydown”

A key is in the pressed state

Data:

unsigned code

        UTF-8 key

unsigned modifiers

        GR_EVENT_KEYMOD_ALT
        GR_EVENT_KEYMOD_CTRL
        GR_EVENT_KEYMOD_SHIFT

GR_EVENT_KEY_UP “gre.keyup”

A key which was previously pressed has been released

Data:

unsigned code

UTF-8 key

unsigned modifiers

        GR_EVENT_KEYMOD_ALT
        GR_EVENT_KEYMOD_CTRL
        GR_EVENT_KEYMOD_SHIFT

GR_EVENT_KEY_REPEAT “gre.keyrepeat”

A key is repeating, in the held state.

Data:

unsigned code

UTF-8 key

unsigned modifiers

        GR_EVENT_KEYMOD_ALT
        GR_EVENT_KEYMOD_CTRL
        GR_EVENT_KEYMOD_SHIFT

Screen Manager Events

The following events are generated by the Screen Manager during screen transitions.  These events are generated in the following order:

GR_EVENT_SCREEN_SHOW_PRE delivered to new Screen

GR_EVENT_SCREEN_HIDE_PRE delivered to current Screen

Screen transition occurs

GR_EVENT_SCREEN_SHOW_POST delivered to new Screen

GR_EVENT_SCREEN_HIDE_POST delivered to current Screen

GR_EVENT_SCREEN_SHOW_PRE “gre.screenshow.pre”

A screen is being shown.  This event is triggered before the screen is shown and signifies that a transition may be starting

Data:

char *name
                    

The screen which is being shown

GR_EVENT_SCREEN_SHOW_POST “gre.screenshow.post”

A screen has been shown.  This event is triggered after the screen is shown and signifies that a transition has ended.

Data:

char *name
                    

The screen which has been shown

GR_EVENT_SCREEN_HIDE_PRE “gre.screenhide.pre”

A screen is being hidden.  This event is triggered before the screen is hidden and signifies that a transition may be starting.

Data:

char *name
                    

The screen which is being hidden

GR_EVENT_SCREEN_HIDE_POST “gre.screenhide.post”

A screen has been hidden.  This event is triggered after the screen is hidden and signifies that a transition has ended.

Data:

char *name
                    

The screen which has been hidden

Focus Events

The following events are generated on a change of control focus.  If there is no focusable control on the current screen then these events will not be generated.  These events are targeted at the currently or last focused control.  When focus shifts from one control to another the lost focus event is sent first followed by the got focus event.

GR_EVENT_GOT_FOCUS “gre.gotfocus”

A control has received focus

Data:

        None

GR_EVENT_LOST_FOCUS “gre.lostfocus”

A control has lost focus

Data:

        None

Table Events

The following events are generated by a Table control.  If no table control is present then these events will not be generated.

GR_EVENT_TABLE_VIEWPORT  "gre.table.viewport"

A table has been resized via the table resize action.  This event notifies the system of the new table size and visible area.

Data:

uint32_t    top_row;    /// Top row visible
uint32_t    left_col;    /// Left column visible
uint32_t    bot_row;    /// Bottom row visible
uint32_t    right_col;    /// Right column visible
char        *table
                    

The table which has generated the event

GR_EVENT_CELL_GOT_FOCUS     "gre.cell.gotfocus"

A table cell has received focus and is the currently active cell.

Data:

uint32_t    row;    /// current row
uint32_t    col;    /// current col
char *table
                    

The table which has generated the event

GR_EVENT_CELL_LOST_FOCUS     "gre.cell.lostfocus"

A table cell has lost focus and is no longer the active cell.

uint32_t    row;    /// current row
uint32_t    col;    /// current col
char *table
                    

The table which has generated the event

Animation events

GR_EVENT_ANIMATION_COMPLETE     "gre.animate.complete"

An animation has completed.  The event name will be changed based on the animation which has completed.  The name will be as follows:

gre.animate.complete.[animation name]

Data: None

Plugin Event Definitions

The following events are generated by optional Storyboard plugins.

GRE_EVENT_GESTURE_UP "gre.gesture.up"

Data:

int gesture_num
int time
                

GRE_EVENT_GESTURE_DOWN "gre.gesture.down"

Data:

int gesture_num
int time
                

GRE_EVENT_GESTURE_LEFT "gre.gesture.left"

Data:

int gesture_num
int time
                

GRE_EVENT_GESTURE_RIGHT "gre.gesture.right"

Data:

int gesture_num
int time
                

GRE_SCREEN_DUMP_COMPLETE “gre.screendump.complete”

A screen dump action has completed.

Timer “timer.< name>”

Timer events are generated as a result of a timer action.  See documentation on the gra.timer action for further information about configuring timers.

The timer event name will be formatted as timer.[name]  where name is the value set as the name of the timer when the action was defined.