GUIslice
0.16.0
Embedded GUI in C
|
Functions | |
gslc_tsElem | gslc_ElemCreate (gslc_tsGui *pGui, int16_t nElemId, int16_t nPageId, int16_t nType, gslc_tsRect rElem, char *pStrBuf, uint8_t nStrBufMax, int16_t nFontId) |
Create a new element with default styling. More... | |
gslc_tsElemRef * | gslc_ElemAdd (gslc_tsGui *pGui, int16_t nPageId, gslc_tsElem *pElem, gslc_teElemRefFlags eFlags) |
Add the Element to the list of generated elements in the GUI environment. More... | |
uint8_t | gslc_GetElemRefFlag (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, uint8_t nFlagMask) |
Get the flags associated with an element reference. More... | |
void | gslc_SetElemRefFlag (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, uint8_t nFlagMask, uint8_t nFlagVal) |
Set the flags associated with an element reference. More... | |
gslc_tsElem * | gslc_GetElemFromRef (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef) |
Returns a pointer to an element from an element reference, copying from FLASH to RAM if element is stored in PROGMEM. More... | |
gslc_tsElem * | gslc_GetElemFromRefD (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nLineNum) |
Returns a pointer to an element from an element reference. More... | |
void * | gslc_GetXDataFromRef (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nType, int16_t nLineNum) |
Returns a pointer to the data structure associated with an extended element. More... | |
void | gslc_ElemSetImage (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_tsImgRef sImgRef, gslc_tsImgRef sImgRefSel) |
Set an element to use a bitmap image. More... | |
bool | gslc_ElemDrawByRef (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_teRedrawType eRedraw) |
Draw an element to the active display. More... | |
void | gslc_ElemDraw (gslc_tsGui *pGui, int16_t nPageId, int16_t nElemId) |
Draw an element to the active display. More... | |
void | gslc_DrawTxtBase (gslc_tsGui *pGui, char *pStrBuf, gslc_tsRect rTxt, gslc_tsFont *pTxtFont, gslc_teTxtFlags eTxtFlags, int8_t eTxtAlign, gslc_tsColor colTxt, gslc_tsColor colBg, int16_t nMarginW, int16_t nMarginH) |
Draw text with full text justification. More... | |
void | gslc_SetRoundRadius (gslc_tsGui *pGui, uint8_t nRadius) |
Set the global rounded radius. More... | |
void gslc_DrawTxtBase | ( | gslc_tsGui * | pGui, |
char * | pStrBuf, | ||
gslc_tsRect | rTxt, | ||
gslc_tsFont * | pTxtFont, | ||
gslc_teTxtFlags | eTxtFlags, | ||
int8_t | eTxtAlign, | ||
gslc_tsColor | colTxt, | ||
gslc_tsColor | colBg, | ||
int16_t | nMarginW, | ||
int16_t | nMarginH | ||
) |
Draw text with full text justification.
[in] | pGui | Pointer to GUI |
[in] | pStrBuf | Pointer to text string buffer |
[in] | rTxt | Rectangle region to contain the text |
[in] | pTxtFont | Pointer to the font |
[in] | eTxtFlags | Text string attributes |
[in] | eTxtAlign | Text alignment / justification mode |
[in] | colTxt | Text foreground color |
[in] | colBg | Text background color |
[in] | nMarginW | Horizontal margin within rect region to keep text away |
[in] | nMarginH | Vertical margin within rect region to keep text away |
gslc_tsElemRef* gslc_ElemAdd | ( | gslc_tsGui * | pGui, |
int16_t | nPageId, | ||
gslc_tsElem * | pElem, | ||
gslc_teElemRefFlags | eFlags | ||
) |
Add the Element to the list of generated elements in the GUI environment.
[in] | pGui | Pointer to GUI |
[in] | nPageId | Page ID to add element to (GSLC_PAGE_NONE to skip in case of temporary creation for compound elements) |
[in] | pElem | Pointer to Element to add |
[in] | eFlags | Flags describing the element (eg. whether the element should be stored in internal RAM array or is located in Flash/PROGMEM). |
gslc_tsElem gslc_ElemCreate | ( | gslc_tsGui * | pGui, |
int16_t | nElemId, | ||
int16_t | nPageId, | ||
int16_t | nType, | ||
gslc_tsRect | rElem, | ||
char * | pStrBuf, | ||
uint8_t | nStrBufMax, | ||
int16_t | nFontId | ||
) |
Create a new element with default styling.
[in] | pGui | Pointer to GUI |
[in] | nElemId | User-supplied ID for referencing this element (or GSLC_ID_AUTO to auto-generate) |
[in] | nPageId | The page ID on which this page should be associated |
[in] | nType | Enumeration that indicates the type of element that is requested for creation. The type adjusts the visual representation and default styling. |
[in] | rElem | Rectangle region framing the element |
[in] | pStrBuf | String to copy into element |
[in] | nStrBufMax | Maximum length of string buffer (pStrBuf). Only applicable if GSLC_LOCAL_STR=0. Ignored if GSLC_LOCAL_STR=1.) |
[in] | nFontId | Font ID for textual elements |
void gslc_ElemDraw | ( | gslc_tsGui * | pGui, |
int16_t | nPageId, | ||
int16_t | nElemId | ||
) |
Draw an element to the active display.
[in] | pGui | Pointer to GUI |
[in] | nPageId | ID of page containing element |
[in] | nElemId | ID of element |
bool gslc_ElemDrawByRef | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pElemRef, | ||
gslc_teRedrawType | eRedraw | ||
) |
Draw an element to the active display.
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Ptr to Element reference to draw |
[in] | eRedraw | Redraw mode |
void gslc_ElemSetImage | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pElemRef, | ||
gslc_tsImgRef | sImgRef, | ||
gslc_tsImgRef | sImgRefSel | ||
) |
Set an element to use a bitmap image.
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Pointer to Element reference to update |
[in] | sImgRef | Image reference (normal state) |
[in] | sImgRefSel | Image reference (glowing state) |
gslc_tsElem* gslc_GetElemFromRef | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pElemRef | ||
) |
Returns a pointer to an element from an element reference, copying from FLASH to RAM if element is stored in PROGMEM.
This function enables all APIs to work with Elements irrespective of whether they were created in RAM or Flash.
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Pointer to Element Reference |
gslc_tsElem* gslc_GetElemFromRefD | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pElemRef, | ||
int16_t | nLineNum | ||
) |
Returns a pointer to an element from an element reference.
This is a wrapper for GetElemFromRef() including debug checking for invalid pointers.
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Pointer to Element Reference |
[in] | nLineNum | Line number from calling function (ie. LINE) |
uint8_t gslc_GetElemRefFlag | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pElemRef, | ||
uint8_t | nFlagMask | ||
) |
Get the flags associated with an element reference.
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Element reference pointer |
[in] | nFlagMask | Flags to read |
void* gslc_GetXDataFromRef | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pElemRef, | ||
int16_t | nType, | ||
int16_t | nLineNum | ||
) |
Returns a pointer to the data structure associated with an extended element.
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Pointer to Element Reference |
[in] | nType | Expected type indicator (ie. GSLC_TYPEX_*) |
[in] | nLineNum | Line number from calling function (ie. LINE) |
void gslc_SetElemRefFlag | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pElemRef, | ||
uint8_t | nFlagMask, | ||
uint8_t | nFlagVal | ||
) |
Set the flags associated with an element reference.
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Element reference pointer |
[in] | nFlagMask | Flags to read |
[in] | nFlagVal | Values to assign to masked flags |
void gslc_SetRoundRadius | ( | gslc_tsGui * | pGui, |
uint8_t | nRadius | ||
) |
Set the global rounded radius.
[in] | pGui | Pointer to GUI |
[in] | nRadius | Radius for rounded elements |