GUIslice  0.16.0
Embedded GUI in C
Internal: Page Functions
Collaboration diagram for Internal: Page Functions:

Functions

bool gslc_PageEvent (void *pvGui, gslc_tsEvent sEvent)
 Common event handler function for a page. More...
 
void gslc_PageRedrawGo (gslc_tsGui *pGui)
 Redraw all elements on the active page. More...
 
void gslc_PageFlipSet (gslc_tsGui *pGui, bool bNeeded)
 Indicate whether the screen requires page flip. More...
 
bool gslc_PageFlipGet (gslc_tsGui *pGui)
 Get state of pending page flip state. More...
 
void gslc_PageFlipGo (gslc_tsGui *pGui)
 Update the visible screen if page has been marked for flipping. More...
 
gslc_tsPagegslc_PageFindById (gslc_tsGui *pGui, int16_t nPageId)
 Find a page in the GUI by its ID. More...
 
void gslc_PageRedrawCalc (gslc_tsGui *pGui)
 Perform a redraw calculation on the page to determine if additional elements should also be redrawn. More...
 
int16_t gslc_PageFocusStep (gslc_tsGui *pGui, gslc_tsPage *pPage, bool bNext)
 
gslc_tsEvent gslc_EventCreate (gslc_tsGui *pGui, gslc_teEventType eType, uint8_t nSubType, void *pvScope, void *pvData)
 Create an event structure. More...
 
bool gslc_ElemEvent (void *pvGui, gslc_tsEvent sEvent)
 Common event handler function for an element. More...
 
bool gslc_ElemSendEventTouch (gslc_tsGui *pGui, gslc_tsElemRef *pElemRefTracked, gslc_teTouch eTouch, int16_t nX, int16_t nY)
 Trigger an element's touch event. More...
 

Detailed Description

Function Documentation

bool gslc_ElemEvent ( void *  pvGui,
gslc_tsEvent  sEvent 
)

Common event handler function for an element.

Parameters
[in]pvGuiVoid pointer to GUI
[in]sEventEvent data structure
Returns
true if success, false if fail
bool gslc_ElemSendEventTouch ( gslc_tsGui pGui,
gslc_tsElemRef pElemRefTracked,
gslc_teTouch  eTouch,
int16_t  nX,
int16_t  nY 
)

Trigger an element's touch event.

This is an optional behavior useful in some extended element types.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefTrackedPointer to tracked Element reference (or NULL for none))
[in]eTouchTouch event type
[in]nXX coordinate of event (absolute coordinate)
[in]nYY coordinate of event (absolute coordinate)
Returns
true if success, false if error
gslc_tsEvent gslc_EventCreate ( gslc_tsGui pGui,
gslc_teEventType  eType,
uint8_t  nSubType,
void *  pvScope,
void *  pvData 
)

Create an event structure.

Parameters
[in]pGuiPointer to GUI
[in]eTypeEvent type (draw, touch, tick, etc.)
[in]nSubTypeRefinement of event type (or 0 if unused)
[in]pvScopeVoid ptr to object receiving event so that the event handler will have the context
[in]pvDataVoid ptr to additional data associated with the event (eg. coordinates for touch events)
Returns
None
bool gslc_PageEvent ( void *  pvGui,
gslc_tsEvent  sEvent 
)

Common event handler function for a page.

Parameters
[in]pvGuiVoid pointer to GUI
[in]sEventEvent data structure
Returns
true if success, false if fail
gslc_tsPage* gslc_PageFindById ( gslc_tsGui pGui,
int16_t  nPageId 
)

Find a page in the GUI by its ID.

Parameters
[in]pGuiPointer to GUI
[in]nPageIdPage ID to search
Returns
Ptr to a page or NULL if none found
bool gslc_PageFlipGet ( gslc_tsGui pGui)

Get state of pending page flip state.

Parameters
[in]pGuiPointer to GUI
Returns
True if screen requires page flip
void gslc_PageFlipGo ( gslc_tsGui pGui)

Update the visible screen if page has been marked for flipping.

  • On some hardware this can trigger a double-buffering page flip.
Parameters
[in]pGuiPointer to GUI
Returns
None
void gslc_PageFlipSet ( gslc_tsGui pGui,
bool  bNeeded 
)

Indicate whether the screen requires page flip.

  • This is generally called with bNeeded=true whenever drawing has been done to the active page. Page flip is actually performed later when calling PageFlipGo().
Parameters
[in]pGuiPointer to GUI
[in]bNeededTrue if screen requires page flip
Returns
None
int16_t gslc_PageFocusStep ( gslc_tsGui pGui,
gslc_tsPage pPage,
bool  bNext 
)
Todo:
Doc. This API is experimental and subject to change
void gslc_PageRedrawCalc ( gslc_tsGui pGui)

Perform a redraw calculation on the page to determine if additional elements should also be redrawn.

This routine checks to see if any transparent elements have been marked as needing redraw. If so, the whole page may be marked as needing redraw (or at least the other elements that have been exposed underneath).

Parameters
[in]pGuiPointer to GUI
Returns
none
void gslc_PageRedrawGo ( gslc_tsGui pGui)

Redraw all elements on the active page.

Only the elements that have been marked as needing redraw are rendered unless the entire page has been marked as needing redraw (in which case everything is drawn)

Parameters
[in]pGuiPointer to GUI
Returns
none