MPLABĀ® Harmony Graphics Suite
GFX v3.13.0
Legato API Documentation
|
#include "gfx/legato/common/legato_common.h"
#include "gfx/driver/gfx_driver.h"
#include "gfx/legato/core/legato_input.h"
#include "gfx/legato/core/legato_scheme.h"
#include "gfx/legato/string/legato_stringtable.h"
#include "gfx/legato/widget/legato_editwidget.h"
Go to the source code of this file.
Data Structures | |
struct | leLayerState |
struct | leState |
This struct represents the state of the library. More... | |
Typedefs | |
typedef void(* | leLanguageChangedCallback_FnPtr) (uint32_t) |
This function pointer represents a language change callback. More... | |
typedef enum leLayerClearMode | leLayerClearMode |
typedef struct leLayerState | leLayerState |
typedef struct leState | leState |
This struct represents the state of the library. More... | |
Enumerations | |
enum | leLayerClearMode { LE_LAYERCLEARMODE_DEFAULT, LE_LAYERCLEARMODE_DISABLE, LE_LAYERCLEARMODE_FORCE } |
Functions | |
leResult | leInitialize (const gfxDisplayDriver *dispDriver, const gfxGraphicsProcessor *gpuDriver) |
Initialize Legato library. More... | |
void | leShutdown (void) |
Shutdown Legato library. More... | |
leResult | leUpdate (uint32_t dt) |
Shutdown Legato library. More... | |
uint32_t | leLayerCount (void) |
int32_t | leAddLayer (void) |
leResult | leRemoveLayer (uint32_t idx) |
leLayerState * | leGetLayerState (uint32_t idx) |
leColorMode | leGetLayerColorMode (uint32_t lyrIdx) |
Get layer color mode. More... | |
leResult | leSetLayerColorMode (uint32_t lyrIdx, leColorMode mode) |
Set layer color mode. More... | |
leResult | leAddRootWidget (leWidget *wgt, uint32_t layer) |
Add root widget to layer. More... | |
leResult | leRemoveRootWidget (leWidget *wgt, uint32_t layer) |
Remove root widget to layer. More... | |
leBool | leGetLayerRenderHorizontal (uint32_t lyrIdx) |
Get layer render direction. More... | |
leResult | leSetLayerRenderHorizontal (uint32_t lyrIdx, leBool horz) |
Set layer render direction. More... | |
leLayerClearMode | leGetLayerClearMode (uint32_t lyrIdx) |
Get layer clear mode. More... | |
leResult | leSetLayerClearMode (uint32_t lyrIdx, leLayerClearMode mode) |
Set layer clear mode. More... | |
leStringTable * | leGetStringTable (void) |
Get string table. More... | |
void | leSetStringTable (const leStringTable *table) |
Set string table. More... | |
uint32_t | leGetStringLanguage (void) |
Get language index. More... | |
void | leSetStringLanguage (uint32_t id) |
Get language by index. More... | |
leScheme * | leGetDefaultScheme (void) |
Get default scheme. More... | |
leWidget * | leGetFocusWidget (void) |
Get focus widget. More... | |
leResult | leSetFocusWidget (leWidget *widget) |
Get language by index. More... | |
leEditWidget * | leGetEditWidget (void) |
Get edit widget. More... | |
leResult | leSetEditWidget (leEditWidget *widget) |
Set edit widget. More... | |
leResult | leSetLanguageChangedCallback (leLanguageChangedCallback_FnPtr cb) |
Set language change callback. More... | |
void | leRedrawAll (void) |
Redraw All. More... | |
leBool | leIsDrawing (void) |
Check active screen drawing state. More... | |
leBool | leWidgetIsInScene (const leWidget *wgt) |
Determines whether the widget is in the scene. More... | |
int32_t | leGetWidgetLayer (const leWidget *wgt) |
leResult | leEdit_StartEdit (void) |
Send start edit command. More... | |
void | leEdit_EndEdit (void) |
Send end edit command. More... | |
void | leEdit_Clear (void) |
Send clear command. More... | |
void | leEdit_Accept (void) |
Send accept command. More... | |
void | leEdit_Set (leString *str) |
Send set command. More... | |
void | leEdit_Append (leString *str) |
Send start edit command. More... | |
void | leEdit_Backspace (void) |
Send backspace command. More... | |
typedef void(* leLanguageChangedCallback_FnPtr) (uint32_t) |
This function pointer represents a language change callback.
A language change callback is called when when the language change event occurs.
This struct represents the state of the library.
The state of the libary is a global structure.
Add root widget to layer.
Adds the root widget wgt to the layer layer. The library maintains a static list of widgets that are considered to be scene roots. The library treats these roots as layers and the display driver may configure itself to render these roots to different hardware layers. This API adds a child widget to one of the static roots.
void. |
void leEdit_Accept | ( | void | ) |
Send accept command.
Passes a 'accept' command to the current edit widget, if one exists.
void leEdit_Append | ( | leString * | str | ) |
Send start edit command.
Passes a 'append' command and string str to the current edit widget, if one exists.
void. |
void leEdit_Backspace | ( | void | ) |
Send backspace command.
Passes a 'backspace' command to the current edit widget, if one exists.
void. |
void leEdit_Clear | ( | void | ) |
Send clear command.
Sends a 'clear' command to the current edit widget, if one exists.
void leEdit_EndEdit | ( | void | ) |
Send end edit command.
Sends an 'end edit' command to the current edit widget, if one exists.
void leEdit_Set | ( | leString * | str | ) |
Send set command.
Passes a 'set' command and string str to the current edit widget, if one exists.
void. |
leResult leEdit_StartEdit | ( | void | ) |
Send start edit command.
Passes a 'start edit' command to the current edit widget, if one exists.
void. |
leScheme* leGetDefaultScheme | ( | void | ) |
Get default scheme.
Returns the pointer to the current default scheme.
void. |
leEditWidget* leGetEditWidget | ( | void | ) |
Get edit widget.
Edit widgets are widgets that inherit the 'edit widget' API function list. These widgets are capable of receiving edit events from other widgets that are edit event broadcasters. A broadcaster could be a 'key pad' and a receiver could be a 'text edit' box.
void. |
leWidget* leGetFocusWidget | ( | void | ) |
Get focus widget.
The focus widget is the widget that is currently receiving all input events. This can happen when the user initiates a touch down event on the widget and is currently dragging their finger on the display. The widget will receive all touch moved events until a touch up event is received.
void. |
leLayerClearMode leGetLayerClearMode | ( | uint32_t | lyrIdx | ) |
Get layer clear mode.
Gets the the layer clear mode
lyrIdx | is the index of the layer to query |
leColorMode leGetLayerColorMode | ( | uint32_t | lyrIdx | ) |
Get layer color mode.
Gets the the layer color mode
lyrIdx | is the index of the layer to query |
leBool leGetLayerRenderHorizontal | ( | uint32_t | lyrIdx | ) |
Get layer render direction.
Gets the the layer render direction
lyrIdx | is the index of the layer to query |
uint32_t leGetStringLanguage | ( | void | ) |
Get language index.
Returns the language index of the current context.
void. |
leStringTable* leGetStringTable | ( | void | ) |
Get string table.
Get a pointer to the leStringTable structure that maintains the strings, associated fonts, etc.
void. |
leResult leInitialize | ( | const gfxDisplayDriver * | dispDriver, |
const gfxGraphicsProcessor * | gpuDriver | ||
) |
Initialize Legato library.
This function performs basic initialization of the Legato library state. It accepts and intializes a display controller driver specified by dispDriver
dispDriver | is the display controller driver. |
leBool leIsDrawing | ( | void | ) |
Check active screen drawing state.
Indicates if the library currently drawing a frame. Because frame updates can asynchronous to making changes to the UI state it is best to only make updates to the state of a widget only when the layer is not drawing.
void. |
void leRedrawAll | ( | void | ) |
Redraw All.
Forces the library to redraw the currently active scene in its entirety.
void. |
Remove root widget to layer.
Remove the root widget wgt from the layer layer. The library maintains a static list of widgets that are considered to be scene roots. The library treats these roots as layers and the display driver may configure itself to render these roots to different hardware layers. This API adds a child widget to one of the static roots.
void. |
leResult leSetEditWidget | ( | leEditWidget * | widget | ) |
Set edit widget.
Sets the active edit widget to widget. Edit widgets are widgets that inherit the 'edit widget' API function list. These widgets are capable of receiving edit events from other widgets that are edit event broadcasters. A broadcaster could be a 'key pad' and a receiver could be a 'text edit' box.
void. |
Get language by index.
Sets the focus widget to widget.
void. |
leResult leSetLanguageChangedCallback | ( | leLanguageChangedCallback_FnPtr | cb | ) |
Set language change callback.
Sets the callback function to cb to handle the language change event.
cb | is the new callback function. |
leResult leSetLayerClearMode | ( | uint32_t | lyrIdx, |
leLayerClearMode | mode | ||
) |
Set layer clear mode.
Sets the the layer clear mode at index
lyrIdx | is the index of the layer to modify |
mode | is the clear mode to set |
leResult leSetLayerColorMode | ( | uint32_t | lyrIdx, |
leColorMode | mode | ||
) |
Set layer color mode.
Sets the the layer color mode at index
lyrIdx | is the index of the layer to query |
mode | is the color mode to set |
Set layer render direction.
Sets the the layer render direction at index. By default a layer is rendered from top-down with dirty rectangles sliced favoring height. In horizontal mode layers are rendered from left to right with rectangles sliced favoring width. This can help reduce tearing for scenes that have horizontal movement.
lyrIdx | is the index of the layer to modify |
true | if the layer should use horizontal mode |
void leSetStringLanguage | ( | uint32_t | id | ) |
Get language by index.
Returns the language at the location specified by idx.
void. |
void leSetStringTable | ( | const leStringTable * | table | ) |
Set string table.
Set string table to table.
table | is pointer to a string table. |
void leShutdown | ( | void | ) |
Shutdown Legato library.
Shutdowns the active Legato library state.
leResult leUpdate | ( | uint32_t | dt | ) |
Shutdown Legato library.
Shutdown the Legato library in dt milliseconds after the last leUpdate() was called. If the value of dt is zero then time-dependent features will not advance. the active Legato library state. This function updates the active Legato library context state. It performs event processing as well as servicing of the widget paint loop. It should be called often.
dt | is a delta time. |
Determines whether the widget is in the scene.
Determines if wgt is in he current scheme. Searches the active scene for a given widget.
void. |