![]() |
MPLABĀ® Harmony Graphics Suite
|
#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 |
This struct describes the layer state for a layer. More... | |
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 struct leState | leState |
This struct represents the state of the library. More... | |
Functions | |
leResult | leInitialize (const gfxDisplayDriver *dispDriver, const gfxGraphicsProcessor *gpuDriver) |
Initialize Legato library. More... | |
LIB_EXPORT void | leShutdown () |
Shutdown Legato library. More... | |
LIB_EXPORT leResult | leUpdate (uint32_t dt) |
Shutdown Legato library. More... | |
LIB_EXPORT leColorMode | leGetColorMode () |
Get color mode. More... | |
LIB_EXPORT leColorMode | leGetLayerColorMode (uint32_t lyrIdx) |
Get layer color mode. More... | |
leResult | leSetLayerColorMode (uint32_t lyrIdx, leColorMode mode) |
Set layer color mode. More... | |
leBool | leGetLayerRenderHorizontal (uint32_t lyrIdx) |
Get layer render direction. More... | |
leResult | leSetLayerRenderHorizontal (uint32_t lyrIdx, leBool horz) |
Set layer render direction. More... | |
LIB_EXPORT leStringTable * | leGetStringTable () |
Get string table. More... | |
LIB_EXPORT void | leSetStringTable (const leStringTable *table) |
Set string table. More... | |
LIB_EXPORT uint32_t | leGetStringLanguage () |
Get language index. More... | |
LIB_EXPORT void | leSetStringLanguage (uint32_t id) |
Get language by index. More... | |
LIB_EXPORT leScheme * | leGetDefaultScheme () |
Get default scheme. More... | |
LIB_EXPORT leWidget * | leGetFocusWidget () |
Get focus widget. More... | |
LIB_EXPORT leResult | leSetFocusWidget (leWidget *widget) |
Get language by index. More... | |
LIB_EXPORT leEditWidget * | leGetEditWidget () |
Get edit widget. More... | |
LIB_EXPORT leResult | leSetEditWidget (leEditWidget *widget) |
Set edit widget. More... | |
LIB_EXPORT leResult | leSetLanguageChangedCallback (leLanguageChangedCallback_FnPtr cb) |
Set language change callback. More... | |
LIB_EXPORT void | leRedrawAll () |
Redraw All. More... | |
LIB_EXPORT leBool | leIsDrawing () |
Check active screen drawing state. More... | |
LIB_EXPORT leResult | leAddRootWidget (leWidget *wgt, uint32_t layer) |
Add root widget to layer. More... | |
LIB_EXPORT leResult | leRemoveRootWidget (leWidget *wgt, uint32_t layer) |
Remove root widget to layer. More... | |
leBool | leWidgetIsInScene (const leWidget *wgt) |
Determines whether the widget is in the scene. More... | |
int32_t | leGetWidgetLayer (const leWidget *wgt) |
leResult | leEdit_StartEdit () |
Send start edit command. More... | |
void | leEdit_EndEdit () |
Send end edit command. More... | |
void | leEdit_Clear () |
Send clear command. More... | |
void | leEdit_Accept () |
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 () |
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 | ( | ) |
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 | ( | ) |
Send backspace command.
Passes a 'backspace' command to the current edit widget, if one exists.
void. |
void leEdit_Clear | ( | ) |
Send clear command.
Sends a 'clear' command to the current edit widget, if one exists.
void leEdit_EndEdit | ( | ) |
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 | ( | ) |
Send start edit command.
Passes a 'start edit' command to the current edit widget, if one exists.
void. |
LIB_EXPORT leColorMode leGetColorMode | ( | ) |
Get color mode.
Gets the the color mode of the current context.
void. |
LIB_EXPORT leScheme* leGetDefaultScheme | ( | ) |
Get default scheme.
Returns the pointer to the current default scheme.
void. |
LIB_EXPORT leEditWidget* leGetEditWidget | ( | ) |
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. |
LIB_EXPORT leWidget* leGetFocusWidget | ( | ) |
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. |
LIB_EXPORT 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 |
LIB_EXPORT uint32_t leGetStringLanguage | ( | ) |
Get language index.
Returns the language index of the current context.
void. |
LIB_EXPORT leStringTable* leGetStringTable | ( | ) |
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. |
LIB_EXPORT leBool leIsDrawing | ( | ) |
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. |
LIB_EXPORT void leRedrawAll | ( | ) |
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. |
LIB_EXPORT 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. |
LIB_EXPORT 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 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 |
LIB_EXPORT void leSetStringLanguage | ( | uint32_t | id | ) |
Get language by index.
Returns the language at the location specified by idx.
void. |
LIB_EXPORT void leSetStringTable | ( | const leStringTable * | table | ) |
Set string table.
Set string table to table.
table | is pointer to a string table. |
LIB_EXPORT void leShutdown | ( | ) |
LIB_EXPORT 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. |