GUIslice  0.16.0
Embedded GUI in C
GUIslice.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <inttypes.h>
#include "GUIslice_config.h"
Include dependency graph for GUIslice.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gslc_tsRect
 Rectangular region. Defines X,Y corner coordinates plus dimensions. More...
 
struct  gslc_tsPt
 Define point coordinates. More...
 
struct  gslc_tsColor
 Color structure. Defines RGB triplet. More...
 
struct  gslc_tsEvent
 Event structure. More...
 
struct  gslc_tsEventTouch
 Structure used to pass touch data through event. More...
 
struct  gslc_tsFont
 Font reference structure. More...
 
struct  gslc_tsImgRef
 Image reference structure. More...
 
struct  gslc_tsElemRef
 Element reference structure. More...
 
struct  gslc_tsElem
 Element Struct. More...
 
struct  gslc_tsCollect
 Element collection struct. More...
 
struct  gslc_tsPage
 Page structure. More...
 
struct  gslc_tsInputMap
 Input mapping. More...
 
struct  gslc_tsGui
 GUI structure. More...
 

Macros

#define GSLC_PMEM
 
#define GSLC_2PI
 
#define GSLC_ELEM_FEA_VALID
 Element features type. More...
 
#define GSLC_ELEM_FEA_EDIT_EN
 Element supports edit. More...
 
#define GSLC_ELEM_FEA_ROUND_EN
 Element is drawn with a rounded profile. More...
 
#define GSLC_ELEM_FEA_CLICK_EN
 Element accepts touch presses. More...
 
#define GSLC_ELEM_FEA_GLOW_EN
 Element supports glowing state. More...
 
#define GSLC_ELEM_FEA_FRAME_EN
 Element is drawn with a frame. More...
 
#define GSLC_ELEM_FEA_FILL_EN
 Element is drawn with a fill. More...
 
#define GSLC_ELEM_FEA_NONE
 Element default (no features set)) More...
 
#define GSLC_ALIGNV_TOP
 Element text alignment. More...
 
#define GSLC_ALIGNV_MID
 Vertical align to middle. More...
 
#define GSLC_ALIGNV_BOT
 Vertical align to bottom. More...
 
#define GSLC_ALIGNH_LEFT
 Horizontal align to left. More...
 
#define GSLC_ALIGNH_MID
 Horizontal align to middle. More...
 
#define GSLC_ALIGNH_RIGHT
 Horizontal align to right. More...
 
#define GSLC_ALIGN_TOP_LEFT
 Align to top-left. More...
 
#define GSLC_ALIGN_TOP_MID
 Align to middle of top. More...
 
#define GSLC_ALIGN_TOP_RIGHT
 Align to top-right. More...
 
#define GSLC_ALIGN_MID_LEFT
 Align to middle of left side. More...
 
#define GSLC_ALIGN_MID_MID
 Align to center. More...
 
#define GSLC_ALIGN_MID_RIGHT
 Align to middle of right side. More...
 
#define GSLC_ALIGN_BOT_LEFT
 Align to bottom-left. More...
 
#define GSLC_ALIGN_BOT_MID
 Align to middle of bottom. More...
 
#define GSLC_ALIGN_BOT_RIGHT
 Align to bottom-right. More...
 
#define GSLC_COL_RED_DK4
 Basic color definition. More...
 
#define GSLC_COL_RED_DK3
 Red (dark3) More...
 
#define GSLC_COL_RED_DK2
 Red (dark2) More...
 
#define GSLC_COL_RED_DK1
 Red (dark1) More...
 
#define GSLC_COL_RED
 Red. More...
 
#define GSLC_COL_RED_LT1
 Red (light1) More...
 
#define GSLC_COL_RED_LT2
 Red (light2) More...
 
#define GSLC_COL_RED_LT3
 Red (light3) More...
 
#define GSLC_COL_RED_LT4
 Red (light4) More...
 
#define GSLC_COL_GREEN_DK4
 Green (dark4) More...
 
#define GSLC_COL_GREEN_DK3
 Green (dark3) More...
 
#define GSLC_COL_GREEN_DK2
 Green (dark2) More...
 
#define GSLC_COL_GREEN_DK1
 Green (dark1) More...
 
#define GSLC_COL_GREEN
 Green. More...
 
#define GSLC_COL_GREEN_LT1
 Green (light1) More...
 
#define GSLC_COL_GREEN_LT2
 Green (light2) More...
 
#define GSLC_COL_GREEN_LT3
 Green (light3) More...
 
#define GSLC_COL_GREEN_LT4
 Green (light4) More...
 
#define GSLC_COL_BLUE_DK4
 Blue (dark4) More...
 
#define GSLC_COL_BLUE_DK3
 Blue (dark3) More...
 
#define GSLC_COL_BLUE_DK2
 Blue (dark2) More...
 
#define GSLC_COL_BLUE_DK1
 Blue (dark1) More...
 
#define GSLC_COL_BLUE
 Blue. More...
 
#define GSLC_COL_BLUE_LT1
 Blue (light1) More...
 
#define GSLC_COL_BLUE_LT2
 Blue (light2) More...
 
#define GSLC_COL_BLUE_LT3
 Blue (light3) More...
 
#define GSLC_COL_BLUE_LT4
 Blue (light4) More...
 
#define GSLC_COL_BLACK
 Black. More...
 
#define GSLC_COL_GRAY_DK3
 Gray (dark) More...
 
#define GSLC_COL_GRAY_DK2
 Gray (dark) More...
 
#define GSLC_COL_GRAY_DK1
 Gray (dark) More...
 
#define GSLC_COL_GRAY
 Gray. More...
 
#define GSLC_COL_GRAY_LT1
 Gray (light1) More...
 
#define GSLC_COL_GRAY_LT2
 Gray (light2) More...
 
#define GSLC_COL_GRAY_LT3
 Gray (light3) More...
 
#define GSLC_COL_WHITE
 White. More...
 
#define GSLC_COL_YELLOW
 Yellow. More...
 
#define GSLC_COL_YELLOW_DK
 Yellow (dark) More...
 
#define GSLC_COL_PURPLE
 Purple. More...
 
#define GSLC_COL_CYAN
 Cyan. More...
 
#define GSLC_COL_MAGENTA
 Magenta. More...
 
#define GSLC_COL_TEAL
 Teal. More...
 
#define GSLC_COL_ORANGE
 Orange. More...
 
#define GSLC_COL_BROWN
 Brown. More...
 
#define GSLC_COLMONO_BLACK
 Black. More...
 
#define GSLC_COLMONO_WHITE
 White. More...
 
#define TOUCH_ROTATION_DATA
 Additional definitions for Touch Handling These macros define the transforms used in remapping the touchscreen inputs on the basis of the GUI nRotation setting. More...
 
#define TOUCH_ROTATION_SWAPXY(rotation)
 
#define TOUCH_ROTATION_FLIPX(rotation)
 
#define TOUCH_ROTATION_FLIPY(rotation)
 
#define GSLC_ELEMREF_DEFAULT
 Define the default element reference flags for new elements. More...
 
#define GSLC_MIN(a, b)
 
#define GSLC_MAX(a, b)
 
#define TOUCH_ROTATION_DATA
 Additional definitions for Touch Handling These macros define the transforms used in remapping the touchscreen inputs on the basis of the GUI nRotation setting. More...
 
#define TOUCH_ROTATION_SWAPXY(rotation)
 
#define TOUCH_ROTATION_FLIPX(rotation)
 
#define TOUCH_ROTATION_FLIPY(rotation)
 
#define GSLC_DEBUG_PRINT(sFmt, ...)
 Macro to enable optional debug output. More...
 
#define GSLC_DEBUG2_PRINT(sFmt, ...)
 
#define GSLC_DEBUG_PRINT_CONST(sFmt, ...)
 
#define GSLC_DEBUG2_PRINT_CONST(sFmt, ...)
 
#define gslc_ElemCreateTxt_P(pGui, nElemId, nPage, nX, nY, nW, nH, strTxt, pFont, colTxt, colFrame, colFill, nAlignTxt, bFrameEn, bFillEn)
 Create a read-only text element. More...
 
#define gslc_ElemCreateTxt_P_R(pGui, nElemId, nPage, nX, nY, nW, nH, strTxt, strLength, pFont, colTxt, colFrame, colFill, nAlignTxt, bFrameEn, bFillEn)
 Create a read-write text element (element in Flash, string in RAM) More...
 
#define gslc_ElemCreateTxt_P_R_ext(pGui, nElemId, nPage, nX, nY, nW, nH, strTxt, strLength, pFont, colTxt, colTxtGlow, colFrame, colFill, nAlignTxt, nMarginX, nMarginY, bFrameEn, bFillEn, bClickEn, bGlowEn, pfuncXEvent, pfuncXDraw, pfuncXTouch, pfuncXTick)
 Create a read-write text element (element in Flash, string in RAM) with extended customization options. More...
 
#define gslc_ElemCreateBox_P(pGui, nElemId, nPage, nX, nY, nW, nH, colFrame, colFill, bFrameEn, bFillEn, pfuncXDraw, pfuncXTick)
 Create a read-only box element. More...
 
#define gslc_ElemCreateLine_P(pGui, nElemId, nPage, nX0, nY0, nX1, nY1, colFill)
 Create a read-only line element. More...
 
#define gslc_ElemCreateBtnTxt_P(pGui, nElemId, nPage, nX, nY, nW, nH, strTxt, pFont, colTxt, colFrame, colFill, colFrameGlow, colFillGlow, nAlignTxt, bFrameEn, bFillEn, callFunc, extraData)
 Create a text button element. More...
 
#define gslc_ElemCreateBtnTxt_P_R(pGui, nElemId, nPage, nX, nY, nW, nH, strTxt, strLength, pFont, colTxt, colFrame, colFill, colFrameGlow, colFillGlow, nAlignTxt, bFrameEn, bFillEn, callFunc, extraData)
 

Typedefs

typedef int16_t(* GSLC_CB_DEBUG_OUT) (char ch)
 
typedef struct gslc_tsElem gslc_tsElem
 Element Struct. More...
 
typedef struct gslc_tsEvent gslc_tsEvent
 Event structure. More...
 
typedef bool(* GSLC_CB_EVENT) (void *pvGui, gslc_tsEvent sEvent)
 Callback function for element drawing. More...
 
typedef bool(* GSLC_CB_DRAW) (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
 Callback function for element drawing. More...
 
typedef bool(* GSLC_CB_TOUCH) (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nX, int16_t nY)
 Callback function for element touch tracking. More...
 
typedef bool(* GSLC_CB_TICK) (void *pvGui, void *pvElemRef)
 Callback function for element tick. More...
 
typedef bool(* GSLC_CB_PIN_POLL) (void *pvGui, int16_t *pnPinInd, int16_t *pnPinVal)
 Callback function for pin polling. More...
 
typedef bool(* GSLC_CB_INPUT) (void *pvGui, void *pvElemRef, int16_t nStatus, void *pvData)
 Callback function for element input ready. More...
 
typedef struct gslc_tsRect gslc_tsRect
 Rectangular region. Defines X,Y corner coordinates plus dimensions. More...
 
typedef struct gslc_tsPt gslc_tsPt
 Define point coordinates. More...
 
typedef struct gslc_tsColor gslc_tsColor
 Color structure. Defines RGB triplet. More...
 
typedef struct gslc_tsEventTouch gslc_tsEventTouch
 Structure used to pass touch data through event. More...
 

Enumerations

enum  gslc_teElemId {
  GSLC_ID_USER_BASE, GSLC_ID_NONE, GSLC_ID_AUTO, GSLC_ID_TEMP,
  GSLC_ID_AUTO_BASE
}
 Element ID enumerations. More...
 
enum  gslc_tePageId { GSLC_PAGE_USER_BASE, GSLC_PAGE_NONE }
 Page ID enumerations. More...
 
enum  gslc_teStackPage { GSLC_STACK_BASE, GSLC_STACK_CUR, GSLC_STACK_OVERLAY, GSLC_STACK__MAX }
 Define page stack. More...
 
enum  gslc_teGroupId { GSLC_GROUP_ID_USER_BASE, GSLC_GROUP_ID_NONE }
 Group ID enumerations. More...
 
enum  gslc_teFontId { GSLC_FONT_USER_BASE, GSLC_FONT_NONE }
 Font ID enumerations. More...
 
enum  gslc_teElemInd { GSLC_IND_NONE, GSLC_IND_FIRST }
 Element Index enumerations. More...
 
enum  gslc_teTypeCore {
  GSLC_TYPE_NONE, GSLC_TYPE_BKGND, GSLC_TYPE_BTN, GSLC_TYPE_TXT,
  GSLC_TYPE_BOX, GSLC_TYPE_LINE, GSLC_TYPE_BASE_EXTEND
}
 Element type. More...
 
enum  gslc_teInputRawEvent {
  GSLC_INPUT_NONE, GSLC_INPUT_TOUCH, GSLC_INPUT_KEY_DOWN, GSLC_INPUT_KEY_UP,
  GSLC_INPUT_PIN_ASSERT, GSLC_INPUT_PIN_DEASSERT
}
 Raw input event types: touch, key, GPIOs. More...
 
enum  gslc_teAction {
  GSLC_ACTION_UNDEF, GSLC_ACTION_NONE, GSLC_ACTION_FOCUS_PREV, GSLC_ACTION_FOCUS_NEXT,
  GSLC_ACTION_SELECT, GSLC_ACTION_SET_REL, GSLC_ACTION_SET_ABS, GSLC_ACTION_DEBUG
}
 GUI Action Requested These actions are usually the result of an InputMap lookup. More...
 
enum  gslc_tePin {
  GSLC_PIN_BTN_A, GSLC_PIN_BTN_A_LONG, GSLC_PIN_BTN_B, GSLC_PIN_BTN_B_LONG,
  GSLC_PIN_BTN_C, GSLC_PIN_BTN_C_LONG, GSLC_PIN_BTN_D, GSLC_PIN_BTN_D_LONG,
  GSLC_PIN_BTN_E, GSLC_PIN_BTN_E_LONG, GSLC_PIN_BTN_UP, GSLC_PIN_BTN_DOWN,
  GSLC_PIN_BTN_LEFT, GSLC_PIN_BTN_RIGHT, GSLC_PIN_BTN_SEL
}
 General purpose pin/button constants. More...
 
enum  gslc_teTouch {
  GSLC_TOUCH_NONE, GSLC_TOUCH_TYPE_MASK, GSLC_TOUCH_COORD, GSLC_TOUCH_DIRECT,
  GSLC_TOUCH_SUBTYPE_MASK, GSLC_TOUCH_DOWN, GSLC_TOUCH_DOWN_IN, GSLC_TOUCH_DOWN_OUT,
  GSLC_TOUCH_UP, GSLC_TOUCH_UP_IN, GSLC_TOUCH_UP_OUT, GSLC_TOUCH_MOVE,
  GSLC_TOUCH_MOVE_IN, GSLC_TOUCH_MOVE_OUT, GSLC_TOUCH_FOCUS_ON, GSLC_TOUCH_FOCUS_OFF,
  GSLC_TOUCH_FOCUS_SELECT, GSLC_TOUCH_SET_REL, GSLC_TOUCH_SET_ABS
}
 Processed event from input raw events and actions. More...
 
enum  gslc_teInitStat { GSLC_INITSTAT_UNDEF, GSLC_INITSTAT_INACTIVE, GSLC_INITSTAT_FAIL, GSLC_INITSTAT_ACTIVE }
 Status of a module's initialization. More...
 
enum  gslc_teEventType {
  GSLC_EVT_NONE, GSLC_EVT_DRAW, GSLC_EVT_TOUCH, GSLC_EVT_TICK,
  GSLV_EVT_CUSTOM
}
 Event types. More...
 
enum  gslc_teEventSubType { GSLC_EVTSUB_NONE, GSLC_EVTSUB_DRAW_NEEDED, GSLC_EVTSUB_DRAW_FORCE }
 Event sub-types. More...
 
enum  gslc_teRedrawType { GSLC_REDRAW_NONE, GSLC_REDRAW_FULL, GSLC_REDRAW_INC }
 Redraw types. More...
 
enum  gslc_teFontRefType { GSLC_FONTREF_FNAME, GSLC_FONTREF_PTR }
 Font Reference types. More...
 
enum  gslc_teFontRefMode { GSLC_FONTREF_MODE_DEFAULT, GSLC_FONTREF_MODE_1, GSLC_FONTREF_MODE_2, GSLC_FONTREF_MODE_3 }
 Font Reference modes. More...
 
enum  gslc_teElemRefFlags {
  GSLC_ELEMREF_NONE, GSLC_ELEMREF_SRC_RAM, GSLC_ELEMREF_SRC_PROG, GSLC_ELEMREF_SRC_CONST,
  GSLC_ELEMREF_REDRAW_NONE, GSLC_ELEMREF_REDRAW_FULL, GSLC_ELEMREF_REDRAW_INC, GSLC_ELEMREF_GLOWING,
  GSLC_ELEMREF_VISIBLE, GSLC_ELEMREF_SRC, GSLC_ELEMREF_REDRAW_MASK
}
 Element reference flags: Describes characteristics of an element. More...
 
enum  gslc_teImgRefFlags {
  GSLC_IMGREF_NONE, GSLC_IMGREF_SRC_FILE, GSLC_IMGREF_SRC_SD, GSLC_IMGREF_SRC_RAM,
  GSLC_IMGREF_SRC_PROG, GSLC_IMGREF_FMT_BMP24, GSLC_IMGREF_FMT_BMP16, GSLC_IMGREF_FMT_RAW1,
  GSLC_IMGREF_FMT_JPG, GSLC_IMGREF_SRC, GSLC_IMGREF_FMT
}
 Image reference flags: Describes characteristics of an image reference. More...
 
enum  gslc_teTxtFlags {
  GSLC_TXT_MEM_RAM, GSLC_TXT_MEM_PROG, GSLC_TXT_ALLOC_NONE, GSLC_TXT_ALLOC_INT,
  GSLC_TXT_ALLOC_EXT, GSLC_TXT_ENC_PLAIN, GSLC_TXT_ENC_UTF8, GSLC_TXT_MEM,
  GSLC_TXT_ALLOC, GSLC_TXT_ENC, GSLC_TXT_DEFAULT
}
 Text reference flags: Describes the characteristics of a text string (ie. More...
 

Functions

char * gslc_GetVer (gslc_tsGui *pGui)
 Get the GUIslice version number. More...
 
const char * gslc_GetNameDisp (gslc_tsGui *pGui)
 Get the GUIslice display driver name. More...
 
const char * gslc_GetNameTouch (gslc_tsGui *pGui)
 Get the GUIslice touch driver name. More...
 
void * gslc_GetDriverDisp (gslc_tsGui *pGui)
 Get the native display driver instance. More...
 
void * gslc_GetDriverTouch (gslc_tsGui *pGui)
 Get the native touch driver instance. More...
 
bool gslc_Init (gslc_tsGui *pGui, void *pvDriver, gslc_tsPage *asPage, uint8_t nMaxPage, gslc_tsFont *asFont, uint8_t nMaxFont)
 Initialize the GUIslice library. More...
 
void gslc_InitDebug (GSLC_CB_DEBUG_OUT pfunc)
 Initialize debug output. More...
 
void gslc_DebugPrintf (const char *pFmt,...)
 Optimized printf routine for GUIslice debug/error output. More...
 
bool gslc_GuiRotate (gslc_tsGui *pGui, uint8_t nRotation)
 Dynamically change rotation, automatically adapt touchscreen axes swap/flip. More...
 
void gslc_Quit (gslc_tsGui *pGui)
 Exit the GUIslice environment. More...
 
void gslc_Update (gslc_tsGui *pGui)
 Perform main GUIslice handling functions. More...
 
bool gslc_SetBkgndImage (gslc_tsGui *pGui, gslc_tsImgRef sImgRef)
 Configure the background to use a bitmap image. More...
 
bool gslc_SetBkgndColor (gslc_tsGui *pGui, gslc_tsColor nCol)
 Configure the background to use a solid color. More...
 
bool gslc_SetTransparentColor (gslc_tsGui *pGui, gslc_tsColor nCol)
 Configure the color to use for image transparency. More...
 
gslc_tsRect gslc_GetClipRect (gslc_tsGui *pGui)
 Get the current the clipping rectangle. More...
 
bool gslc_SetClipRect (gslc_tsGui *pGui, gslc_tsRect *pRect)
 Set the clipping rectangle for further drawing. More...
 
bool gslc_IsInRect (int16_t nSelX, int16_t nSelY, gslc_tsRect rRect)
 Determine if a coordinate is inside of a rectangular region. More...
 
gslc_tsRect gslc_ExpandRect (gslc_tsRect rRect, int16_t nExpandW, int16_t nExpandH)
 Expand or contract a rectangle in width and/or height (equal amounts on both side), based on the centerpoint of the rectangle. More...
 
bool gslc_IsInWH (int16_t nSelX, int16_t nSelY, uint16_t nWidth, uint16_t nHeight)
 Determine if a coordinate is inside of a width x height region. More...
 
void gslc_UnionRect (gslc_tsRect *pRect, gslc_tsRect rAddRect)
 Expand a rect to include another rect. More...
 
void gslc_InvalidateRgnReset (gslc_tsGui *pGui)
 Reset the invalidation region. More...
 
void gslc_InvalidateRgnPage (gslc_tsGui *pGui, gslc_tsPage *pPage)
 Include an entire page (eg. More...
 
void gslc_InvalidateRgnScreen (gslc_tsGui *pGui)
 Mark the entire screen as invalidated. More...
 
void gslc_InvalidateRgnAdd (gslc_tsGui *pGui, gslc_tsRect rAddRect)
 Add a rectangular region to the invalidation region. More...
 
bool gslc_ClipPt (gslc_tsRect *pClipRect, int16_t nX, int16_t nY)
 Perform basic clipping of a single point to a clipping region. More...
 
bool gslc_ClipLine (gslc_tsRect *pClipRect, int16_t *pnX0, int16_t *pnY0, int16_t *pnX1, int16_t *pnY1)
 Perform basic clipping of a line to a clipping region. More...
 
bool gslc_ClipRect (gslc_tsRect *pClipRect, gslc_tsRect *pRect)
 Perform basic clipping of a rectangle to a clipping region. More...
 
gslc_tsImgRef gslc_GetImageFromFile (const char *pFname, gslc_teImgRefFlags eFmt)
 Create an image reference to a bitmap file in LINUX filesystem. More...
 
gslc_tsImgRef gslc_GetImageFromSD (const char *pFname, gslc_teImgRefFlags eFmt)
 Create an image reference to a bitmap file in SD card. More...
 
gslc_tsImgRef gslc_GetImageFromRam (unsigned char *pImgBuf, gslc_teImgRefFlags eFmt)
 Create an image reference to a bitmap in SRAM. More...
 
gslc_tsImgRef gslc_GetImageFromProg (const unsigned char *pImgBuf, gslc_teImgRefFlags eFmt)
 Create an image reference to a bitmap in program memory (PROGMEM) More...
 
void gslc_PolarToXY (uint16_t nRad, int16_t n64Ang, int16_t *nDX, int16_t *nDY)
 Convert polar coordinate to cartesian. More...
 
int16_t gslc_sinFX (int16_t n64Ang)
 Calculate fixed-point sine function from fractional degrees. More...
 
int16_t gslc_cosFX (int16_t n64Ang)
 Calculate fixed-point cosine function from fractional degrees. More...
 
gslc_tsColor gslc_ColorBlend2 (gslc_tsColor colStart, gslc_tsColor colEnd, uint16_t nMidAmt, uint16_t nBlendAmt)
 Create a color based on a blend between two colors. More...
 
gslc_tsColor gslc_ColorBlend3 (gslc_tsColor colStart, gslc_tsColor colMid, gslc_tsColor colEnd, uint16_t nMidAmt, uint16_t nBlendAmt)
 Create a color based on a blend between three colors. More...
 
bool gslc_ColorEqual (gslc_tsColor a, gslc_tsColor b)
 Check whether two colors are equal. More...
 
void gslc_DrawSetPixel (gslc_tsGui *pGui, int16_t nX, int16_t nY, gslc_tsColor nCol)
 Set a pixel on the active screen to the given color with lock. More...
 
void gslc_DrawLine (gslc_tsGui *pGui, int16_t nX0, int16_t nY0, int16_t nX1, int16_t nY1, gslc_tsColor nCol)
 Draw an arbitrary line using Bresenham's algorithm. More...
 
void gslc_DrawLineH (gslc_tsGui *pGui, int16_t nX, int16_t nY, uint16_t nW, gslc_tsColor nCol)
 Draw a horizontal line. More...
 
void gslc_DrawLineV (gslc_tsGui *pGui, int16_t nX, int16_t nY, uint16_t nH, gslc_tsColor nCol)
 Draw a vertical line. More...
 
void gslc_DrawLinePolar (gslc_tsGui *pGui, int16_t nX, int16_t nY, uint16_t nRadStart, uint16_t nRadEnd, int16_t n64Ang, gslc_tsColor nCol)
 Draw a polar ray segment. More...
 
void gslc_DrawFrameRect (gslc_tsGui *pGui, gslc_tsRect rRect, gslc_tsColor nCol)
 Draw a framed rectangle. More...
 
void gslc_DrawFrameRoundRect (gslc_tsGui *pGui, gslc_tsRect rRect, int16_t nRadius, gslc_tsColor nCol)
 Draw a framed rounded rectangle. More...
 
void gslc_DrawFillRect (gslc_tsGui *pGui, gslc_tsRect rRect, gslc_tsColor nCol)
 Draw a filled rectangle. More...
 
void gslc_DrawFillRoundRect (gslc_tsGui *pGui, gslc_tsRect rRect, int16_t nRadius, gslc_tsColor nCol)
 Draw a filled rounded rectangle. More...
 
void gslc_DrawFrameCircle (gslc_tsGui *pGui, int16_t nMidX, int16_t nMidY, uint16_t nRadius, gslc_tsColor nCol)
 Draw a framed circle. More...
 
void gslc_DrawFillCircle (gslc_tsGui *pGui, int16_t nMidX, int16_t nMidY, uint16_t nRadius, gslc_tsColor nCol)
 Draw a filled circle. More...
 
void gslc_DrawFrameTriangle (gslc_tsGui *pGui, int16_t nX0, int16_t nY0, int16_t nX1, int16_t nY1, int16_t nX2, int16_t nY2, gslc_tsColor nCol)
 Draw a framed triangle. More...
 
void gslc_DrawFillTriangle (gslc_tsGui *pGui, int16_t nX0, int16_t nY0, int16_t nX1, int16_t nY1, int16_t nX2, int16_t nY2, gslc_tsColor nCol)
 Draw a filled triangle. More...
 
void gslc_DrawFrameQuad (gslc_tsGui *pGui, gslc_tsPt *psPt, gslc_tsColor nCol)
 Draw a framed quadrilateral. More...
 
void gslc_DrawFillQuad (gslc_tsGui *pGui, gslc_tsPt *psPt, gslc_tsColor nCol)
 Draw a filled quadrilateral. More...
 
void gslc_DrawFillGradSector (gslc_tsGui *pGui, int16_t nQuality, int16_t nMidX, int16_t nMidY, int16_t nRad1, int16_t nRad2, gslc_tsColor cArcStart, gslc_tsColor cArcEnd, int16_t nAngSecStart, int16_t nAngSecEnd, int16_t nAngGradStart, int16_t nAngGradRange)
 Draw a gradient filled sector of a circle with support for inner and outer radius. More...
 
void gslc_DrawFillSector (gslc_tsGui *pGui, int16_t nQuality, int16_t nMidX, int16_t nMidY, int16_t nRad1, int16_t nRad2, gslc_tsColor cArc, int16_t nAngSecStart, int16_t nAngSecEnd)
 Draw a flat filled sector of a circle with support for inner and outer radius. More...
 
bool gslc_FontAdd (gslc_tsGui *pGui, int16_t nFontId, gslc_teFontRefType eFontRefType, const void *pvFontRef, uint16_t nFontSz)
 Load a font into the local font cache and assign font ID (nFontId). More...
 
bool gslc_FontSet (gslc_tsGui *pGui, int16_t nFontId, gslc_teFontRefType eFontRefType, const void *pvFontRef, uint16_t nFontSz)
 Load a font into the local font cache and store as font ID (nFontId) More...
 
gslc_tsFontgslc_FontGet (gslc_tsGui *pGui, int16_t nFontId)
 Fetch a font from its ID value. More...
 
bool gslc_FontSetMode (gslc_tsGui *pGui, int16_t nFontId, gslc_teFontRefMode eFontMode)
 Set the font operating mode. More...
 
int gslc_GetPageCur (gslc_tsGui *pGui)
 Fetch the current page ID. More...
 
void gslc_SetStackPage (gslc_tsGui *pGui, uint8_t nStackPos, int16_t nPageId)
 Assign a page to the page stack. More...
 
void gslc_SetStackState (gslc_tsGui *pGui, uint8_t nStackPos, bool bActive, bool bDoDraw)
 Change the status of a page in a page stack. More...
 
void gslc_SetPageBase (gslc_tsGui *pGui, int16_t nPageId)
 Assigns a page for the base layer in the page stack. More...
 
void gslc_SetPageCur (gslc_tsGui *pGui, int16_t nPageId)
 Select a page for the current layer in the page stack. More...
 
void gslc_SetPageOverlay (gslc_tsGui *pGui, int16_t nPageId)
 Select a page for the overlay layer in the page stack. More...
 
void gslc_PopupShow (gslc_tsGui *pGui, int16_t nPageId, bool bModal)
 Show a popup dialog. More...
 
void gslc_PopupHide (gslc_tsGui *pGui)
 Hides the currently active popup dialog. More...
 
void gslc_PageRedrawSet (gslc_tsGui *pGui, bool bRedraw)
 Update the need-redraw status for the current page. More...
 
bool gslc_PageRedrawGet (gslc_tsGui *pGui)
 Get the need-redraw status for the current page. More...
 
void gslc_PageAdd (gslc_tsGui *pGui, int16_t nPageId, gslc_tsElem *psElem, uint16_t nMaxElem, gslc_tsElemRef *psElemRef, uint16_t nMaxElemRef)
 Add a page to the GUI. More...
 
gslc_tsElemRefgslc_PageFindElemById (gslc_tsGui *pGui, int16_t nPageId, int16_t nElemId)
 Find an element in the GUI by its Page ID and Element ID. More...
 
gslc_tsElemRefgslc_ElemCreateTxt (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsRect rElem, char *pStrBuf, uint8_t nStrBufMax, int16_t nFontId)
 Create a Text Element. More...
 
gslc_tsElemRefgslc_ElemCreateBtnTxt (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsRect rElem, char *pStrBuf, uint8_t nStrBufMax, int16_t nFontId, GSLC_CB_TOUCH cbTouch)
 Create a textual Button Element. More...
 
gslc_tsElemRefgslc_ElemCreateBtnImg (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsRect rElem, gslc_tsImgRef sImgRef, gslc_tsImgRef sImgRefSel, GSLC_CB_TOUCH cbTouch)
 Create a graphical Button Element. More...
 
gslc_tsElemRefgslc_ElemCreateBox (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsRect rElem)
 Create a Box Element. More...
 
gslc_tsElemRefgslc_ElemCreateLine (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, int16_t nX0, int16_t nY0, int16_t nX1, int16_t nY1)
 Create a Line Element. More...
 
gslc_tsElemRefgslc_ElemCreateImg (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsRect rElem, gslc_tsImgRef sImgRef)
 Create an image Element. More...
 
int gslc_ElemGetId (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Get an Element ID from an element structure. More...
 
void gslc_ElemSetFillEn (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bFillEn)
 Set the fill state for an Element. More...
 
void gslc_ElemSetFrameEn (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bFrameEn)
 Set the frame state for an Element. More...
 
void gslc_ElemSetRoundEn (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bRoundEn)
 Set the rounded frame/fill state for an Element. More...
 
void gslc_ElemSetCol (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_tsColor colFrame, gslc_tsColor colFill, gslc_tsColor colFillGlow)
 Update the common color selection for an Element. More...
 
void gslc_ElemSetGlowCol (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_tsColor colFrameGlow, gslc_tsColor colFillGlow, gslc_tsColor colTxtGlow)
 Update the common color selection for glowing state of an Element. More...
 
void gslc_ElemSetGroup (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int nGroupId)
 Set the group ID for an element. More...
 
int gslc_ElemGetGroup (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Get the group ID for an element. More...
 
void gslc_ElemSetRect (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_tsRect rElem)
 Set the position and size for an element. More...
 
gslc_tsRect gslc_ElemGetRect (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Get the rectangular region for an element. More...
 
void gslc_ElemSetTxtAlign (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, unsigned nAlign)
 Set the alignment of a textual element (horizontal and vertical) More...
 
void gslc_ElemSetTxtMargin (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, unsigned nMargin)
 Set the margin around of a textual element. More...
 
void gslc_ElemSetTxtMarginXY (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int8_t nMarginX, int8_t nMarginY)
 Set the margin around of a textual element (X & Y offsets can be different) More...
 
void gslc_StrCopy (char *pDstStr, const char *pSrcStr, uint16_t nDstLen)
 Helper routine to perform string deep copy. More...
 
void gslc_ElemSetTxtStr (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, const char *pStr)
 Update the text string associated with an Element. More...
 
char * gslc_ElemGetTxtStr (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Fetch the current text string associated with an Element. More...
 
void gslc_ElemSetTxtCol (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_tsColor colVal)
 Update the text string color associated with an Element ID. More...
 
void gslc_ElemSetTxtMem (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_teTxtFlags eFlags)
 Update the text string location in memory. More...
 
void gslc_ElemSetTxtEnc (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_teTxtFlags eFlags)
 Update the text string encoding mode. More...
 
void gslc_ElemUpdateFont (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int nFontId)
 Update the Font selected for an Element's text. More...
 
void gslc_ElemSetRedraw (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_teRedrawType eRedraw)
 Update the need-redraw status for an element. More...
 
gslc_teRedrawType gslc_ElemGetRedraw (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Get the need-redraw status for an element. More...
 
void gslc_ElemSetGlowEn (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bGlowEn)
 Update the glowing enable for an element. More...
 
void gslc_ElemSetClickEn (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bClickEn)
 Update the click enable for an element. More...
 
void gslc_ElemSetTouchFunc (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, GSLC_CB_TOUCH funcCb)
 Update the touch function callback for an element. More...
 
void gslc_ElemSetStyleFrom (gslc_tsGui *pGui, gslc_tsElemRef *pElemRefSrc, gslc_tsElemRef *pElemRefDest)
 Copy style settings from one element to another. More...
 
bool gslc_ElemGetGlowEn (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Get the glowing enable for an element. More...
 
void gslc_ElemSetGlow (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bGlowing)
 Update the glowing indicator for an element. More...
 
bool gslc_ElemGetGlow (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Get the glowing indicator for an element. More...
 
void gslc_ElemSetVisible (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bVisible)
 Update the visibility status for an element. More...
 
bool gslc_ElemGetVisible (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Get the visibility status for an element. More...
 
bool gslc_ElemGetOnScreen (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Determine whether an element is visible on the screen. More...
 
void gslc_ElemSetDrawFunc (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, GSLC_CB_DRAW funcCb)
 Assign the drawing callback function for an element. More...
 
void gslc_ElemSetTickFunc (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, GSLC_CB_TICK funcCb)
 Assign the tick callback function for an element. More...
 
bool gslc_ElemOwnsCoord (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nX, int16_t nY, bool bOnlyClickEn)
 Determine if a coordinate is inside of an element. More...
 
bool gslc_InitTouch (gslc_tsGui *pGui, const char *acDev)
 Initialize the touchscreen device driver. More...
 
bool gslc_GetTouch (gslc_tsGui *pGui, int16_t *pnX, int16_t *pnY, uint16_t *pnPress, gslc_teInputRawEvent *peInputEvent, int16_t *pnInputVal)
 Initialize the touchscreen device driver. More...
 
void gslc_SetTouchRemapEn (gslc_tsGui *pGui, bool bEn)
 Configure touchscreen remapping. More...
 
void gslc_SetTouchRemapCal (gslc_tsGui *pGui, uint16_t nXMin, uint16_t nXMax, uint16_t nYMin, uint16_t nYMax)
 Configure touchscreen calibration remapping values. More...
 
void gslc_SetTouchPressCal (gslc_tsGui *pGui, uint16_t nPressMin, uint16_t nPressMax)
 Configure touchscreen calibration pressure values. More...
 
void gslc_SetTouchRemapYX (gslc_tsGui *pGui, bool bSwap)
 Configure touchscreen XY swap. More...
 
void gslc_SetPinPollFunc (gslc_tsGui *pGui, GSLC_CB_PIN_POLL pfunc)
 
void gslc_InitInputMap (gslc_tsGui *pGui, gslc_tsInputMap *asInputMap, uint8_t nInputMapMax)
 
void gslc_InputMapAdd (gslc_tsGui *pGui, gslc_teInputRawEvent eInputEvent, int16_t nInputVal, gslc_teAction eAction, int16_t nActionVal)
 
gslc_tsImgRef gslc_ResetImage ()
 Create a blank image reference structure. More...
 
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_tsElemRefgslc_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_tsElemgslc_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_tsElemgslc_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...
 
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...
 
void gslc_CollectReset (gslc_tsCollect *pCollect, gslc_tsElem *asElem, uint16_t nElemMax, gslc_tsElemRef *asElemRef, uint16_t nElemRefMax)
 Reset the members of an element collection. More...
 
gslc_tsElemRefgslc_CollectElemAdd (gslc_tsGui *pGui, gslc_tsCollect *pCollect, const gslc_tsElem *pElem, gslc_teElemRefFlags eFlags)
 Add an element to a collection. More...
 
bool gslc_CollectGetRedraw (gslc_tsGui *pGui, gslc_tsCollect *pCollect)
 Determine if any elements in a collection need redraw. More...
 
gslc_tsElemRefgslc_CollectFindElemById (gslc_tsGui *pGui, gslc_tsCollect *pCollect, int16_t nElemId)
 Find an element in a collection by its Element ID. More...
 
gslc_tsElemRefgslc_CollectFindElemFromCoord (gslc_tsGui *pGui, gslc_tsCollect *pCollect, int16_t nX, int16_t nY)
 Find an element in a collection by a coordinate coordinate. More...
 
int gslc_CollectGetNextId (gslc_tsGui *pGui, gslc_tsCollect *pCollect)
 Allocate the next available Element ID in a collection. More...
 
gslc_tsElemRefgslc_CollectGetElemRefTracked (gslc_tsGui *pGui, gslc_tsCollect *pCollect)
 Get the element within a collection that is currently being tracked. More...
 
void gslc_CollectSetElemTracked (gslc_tsGui *pGui, gslc_tsCollect *pCollect, gslc_tsElemRef *pElemRef)
 Set the element within a collection that is currently being tracked. More...
 
int16_t gslc_CollectGetFocus (gslc_tsGui *pGui, gslc_tsCollect *pCollect)
 Get the element index within a collection that is currently in focus. More...
 
void gslc_CollectSetFocus (gslc_tsGui *pGui, gslc_tsCollect *pCollect, int16_t nElemInd)
 Set the element index within a collection that is currently in focus. More...
 
bool gslc_CollectFindFocusStep (gslc_tsGui *pGui, gslc_tsCollect *pCollect, bool bNext, bool *pbWrapped, int16_t *pnElemInd)
 
void gslc_CollectSetParent (gslc_tsGui *pGui, gslc_tsCollect *pCollect, gslc_tsElemRef *pElemRefParent)
 Assign the parent element reference to all elements within a collection. More...
 
bool gslc_CollectEvent (void *pvGui, gslc_tsEvent sEvent)
 Common event handler function for an element collection. More...
 
void gslc_CollectTouch (gslc_tsGui *pGui, gslc_tsCollect *pCollect, gslc_tsEventTouch *pEventTouch)
 Handle touch events within the element collection. More...
 
bool gslc_CollectTouchCompound (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nRelX, int16_t nRelY, gslc_tsCollect *pCollect)
 Handle dispatch of touch (up,down,move) events to compound elements sub elements. More...
 
void gslc_CollectInput (gslc_tsGui *pGui, gslc_tsCollect *pCollect, gslc_tsEventTouch *pEventTouch)
 Handle direct input events within the element collection. More...
 
void gslc_TrackTouch (gslc_tsGui *pGui, gslc_tsPage *pPage, int16_t nX, int16_t nY, uint16_t nPress)
 Handles a touch event and performs the necessary tracking, glowing and selection actions depending on the press state. More...
 
void gslc_TrackInput (gslc_tsGui *pGui, gslc_tsPage *pPage, gslc_teInputRawEvent eInputEvent, int16_t nInputVal)
 Handles a direct input event and performs the necessary tracking, glowing and selection actions depending on the state. More...
 
bool gslc_InputMapLookup (gslc_tsGui *pGui, gslc_teInputRawEvent eInputEvent, int16_t nInputVal, gslc_teAction *peAction, int16_t *pnActionVal)
 
void gslc_GuiDestruct (gslc_tsGui *pGui)
 Free up any surfaces associated with the GUI, pages, collections and elements. More...
 
void gslc_PageDestruct (gslc_tsGui *pGui, gslc_tsPage *pPage)
 Free up any members associated with a page. More...
 
void gslc_CollectDestruct (gslc_tsGui *pGui, gslc_tsCollect *pCollect)
 Free up any members associated with an element collection. More...
 
void gslc_ElemDestruct (gslc_tsElem *pElem)
 Free up any members associated with an element. More...
 
void gslc_ResetFont (gslc_tsFont *pFont)
 Initialize a Font struct. More...
 
void gslc_ResetElem (gslc_tsElem *pElem)
 Initialize an Element struct. More...
 

Variables

GSLC_CB_DEBUG_OUT g_pfDebugOut
 Global debug output function. More...
 

Macro Definition Documentation

#define GSLC_2PI
#define GSLC_ALIGN_BOT_LEFT

Align to bottom-left.

#define GSLC_ALIGN_BOT_MID

Align to middle of bottom.

#define GSLC_ALIGN_BOT_RIGHT

Align to bottom-right.

#define GSLC_ALIGN_MID_LEFT

Align to middle of left side.

#define GSLC_ALIGN_MID_MID

Align to center.

#define GSLC_ALIGN_MID_RIGHT

Align to middle of right side.

#define GSLC_ALIGN_TOP_LEFT

Align to top-left.

#define GSLC_ALIGN_TOP_MID

Align to middle of top.

#define GSLC_ALIGN_TOP_RIGHT

Align to top-right.

#define GSLC_ALIGNH_LEFT

Horizontal align to left.

#define GSLC_ALIGNH_MID

Horizontal align to middle.

#define GSLC_ALIGNH_RIGHT

Horizontal align to right.

#define GSLC_ALIGNV_BOT

Vertical align to bottom.

#define GSLC_ALIGNV_MID

Vertical align to middle.

#define GSLC_ALIGNV_TOP

Element text alignment.

Vertical align to top

#define GSLC_COL_BLACK

Black.

#define GSLC_COL_BLUE

Blue.

#define GSLC_COL_BLUE_DK1

Blue (dark1)

#define GSLC_COL_BLUE_DK2

Blue (dark2)

#define GSLC_COL_BLUE_DK3

Blue (dark3)

#define GSLC_COL_BLUE_DK4

Blue (dark4)

#define GSLC_COL_BLUE_LT1

Blue (light1)

#define GSLC_COL_BLUE_LT2

Blue (light2)

#define GSLC_COL_BLUE_LT3

Blue (light3)

#define GSLC_COL_BLUE_LT4

Blue (light4)

#define GSLC_COL_BROWN

Brown.

#define GSLC_COL_CYAN

Cyan.

#define GSLC_COL_GRAY

Gray.

#define GSLC_COL_GRAY_DK1

Gray (dark)

#define GSLC_COL_GRAY_DK2

Gray (dark)

#define GSLC_COL_GRAY_DK3

Gray (dark)

#define GSLC_COL_GRAY_LT1

Gray (light1)

#define GSLC_COL_GRAY_LT2

Gray (light2)

#define GSLC_COL_GRAY_LT3

Gray (light3)

#define GSLC_COL_GREEN

Green.

#define GSLC_COL_GREEN_DK1

Green (dark1)

#define GSLC_COL_GREEN_DK2

Green (dark2)

#define GSLC_COL_GREEN_DK3

Green (dark3)

#define GSLC_COL_GREEN_DK4

Green (dark4)

#define GSLC_COL_GREEN_LT1

Green (light1)

#define GSLC_COL_GREEN_LT2

Green (light2)

#define GSLC_COL_GREEN_LT3

Green (light3)

#define GSLC_COL_GREEN_LT4

Green (light4)

#define GSLC_COL_MAGENTA

Magenta.

#define GSLC_COL_ORANGE

Orange.

#define GSLC_COL_PURPLE

Purple.

#define GSLC_COL_RED

Red.

#define GSLC_COL_RED_DK1

Red (dark1)

#define GSLC_COL_RED_DK2

Red (dark2)

#define GSLC_COL_RED_DK3

Red (dark3)

#define GSLC_COL_RED_DK4

Basic color definition.

Red (dark4)

#define GSLC_COL_RED_LT1

Red (light1)

#define GSLC_COL_RED_LT2

Red (light2)

#define GSLC_COL_RED_LT3

Red (light3)

#define GSLC_COL_RED_LT4

Red (light4)

#define GSLC_COL_TEAL

Teal.

#define GSLC_COL_WHITE

White.

#define GSLC_COL_YELLOW

Yellow.

#define GSLC_COL_YELLOW_DK

Yellow (dark)

#define GSLC_COLMONO_BLACK

Black.

#define GSLC_COLMONO_WHITE

White.

#define GSLC_ELEM_FEA_CLICK_EN

Element accepts touch presses.

#define GSLC_ELEM_FEA_EDIT_EN

Element supports edit.

#define GSLC_ELEM_FEA_FILL_EN

Element is drawn with a fill.

#define GSLC_ELEM_FEA_FRAME_EN

Element is drawn with a frame.

#define GSLC_ELEM_FEA_GLOW_EN

Element supports glowing state.

#define GSLC_ELEM_FEA_NONE

Element default (no features set))

#define GSLC_ELEM_FEA_ROUND_EN

Element is drawn with a rounded profile.

#define GSLC_ELEM_FEA_VALID

Element features type.

Element record is valid

#define GSLC_ELEMREF_DEFAULT

Define the default element reference flags for new elements.

#define GSLC_MAX (   a,
 
)
#define GSLC_MIN (   a,
 
)
#define GSLC_PMEM

Typedef Documentation

typedef int16_t(* GSLC_CB_DEBUG_OUT) (char ch)
typedef bool(* GSLC_CB_DRAW) (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)

Callback function for element drawing.

typedef bool(* GSLC_CB_EVENT) (void *pvGui, gslc_tsEvent sEvent)

Callback function for element drawing.

typedef bool(* GSLC_CB_INPUT) (void *pvGui, void *pvElemRef, int16_t nStatus, void *pvData)

Callback function for element input ready.

typedef bool(* GSLC_CB_PIN_POLL) (void *pvGui, int16_t *pnPinInd, int16_t *pnPinVal)

Callback function for pin polling.

typedef bool(* GSLC_CB_TICK) (void *pvGui, void *pvElemRef)

Callback function for element tick.

typedef bool(* GSLC_CB_TOUCH) (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nX, int16_t nY)

Callback function for element touch tracking.

typedef struct gslc_tsColor gslc_tsColor

Color structure. Defines RGB triplet.

typedef struct gslc_tsElem gslc_tsElem

Element Struct.

  • Represents a single graphic element in the GUIslice environment
  • A page is made up of a number of elements
  • Each element is created with a user-specified ID for further accesses (or GSLC_ID_AUTO for it to be auto-generated)
  • Display order of elements in a page is based upon the creation order
  • Extensions to the core element types is provided through the pXData reference and pfuncX* callback functions.
typedef struct gslc_tsEvent gslc_tsEvent

Event structure.

Structure used to pass touch data through event.

typedef struct gslc_tsPt gslc_tsPt

Define point coordinates.

typedef struct gslc_tsRect gslc_tsRect

Rectangular region. Defines X,Y corner coordinates plus dimensions.

Enumeration Type Documentation

GUI Action Requested These actions are usually the result of an InputMap lookup.

Enumerator
GSLC_ACTION_UNDEF 

Invalid action.

GSLC_ACTION_NONE 

No action to perform.

GSLC_ACTION_FOCUS_PREV 

Advance focus to the previous GUI element.

GSLC_ACTION_FOCUS_NEXT 

Advance focus to the next GUI element.

GSLC_ACTION_SELECT 

Select the currently focused GUI element.

GSLC_ACTION_SET_REL 

Adjust value (relative) of focused element.

GSLC_ACTION_SET_ABS 

Adjust value (absolute) of focused element.

GSLC_ACTION_DEBUG 

Internal debug action.

Element ID enumerations.

  • The Element ID is the primary means for user code to reference a graphic element.
  • Application code can assign arbitrary Element ID values in the range of 0...16383
  • Specifying GSLC_ID_AUTO to ElemCreate() requests that GUIslice auto-assign an ID value for the Element. These auto-assigned values will begin at GSLC_ID_AUTO_BASE.
  • Negative Element ID values are reserved
Enumerator
GSLC_ID_USER_BASE 

Starting Element ID for user assignments.

GSLC_ID_NONE 

No Element ID has been assigned.

GSLC_ID_AUTO 

Auto-assigned Element ID requested.

GSLC_ID_TEMP 

ID for Temporary Element.

GSLC_ID_AUTO_BASE 

Starting Element ID to start auto-assignment (when GSLC_ID_AUTO is specified)

Element Index enumerations.

  • The Element Index is used for internal purposes as an offset
Enumerator
GSLC_IND_NONE 

No Element Index is available.

GSLC_IND_FIRST 

User elements start at index 0.

Element reference flags: Describes characteristics of an element.

  • Primarily used to support relocation of elements to Flash memory (PROGMEM)
Enumerator
GSLC_ELEMREF_NONE 

No element defined.

GSLC_ELEMREF_SRC_RAM 

Element is read/write Stored in RAM (internal element array)) Access directly.

GSLC_ELEMREF_SRC_PROG 

Element is read-only / const Stored in FLASH (external to element array) Access via PROGMEM.

GSLC_ELEMREF_SRC_CONST 

Element is read-only / const Stored in FLASH (external to element array) Access directly.

GSLC_ELEMREF_REDRAW_NONE 

No redraw requested.

GSLC_ELEMREF_REDRAW_FULL 

Full redraw of element requested.

GSLC_ELEMREF_REDRAW_INC 

Incremental redraw of element requested.

GSLC_ELEMREF_GLOWING 

Element state is glowing.

GSLC_ELEMREF_VISIBLE 

Element is currently shown (ie. visible)

GSLC_ELEMREF_SRC 

Mask for Source flags.

GSLC_ELEMREF_REDRAW_MASK 

Mask for Redraw flags.

Event sub-types.

Enumerator
GSLC_EVTSUB_NONE 
GSLC_EVTSUB_DRAW_NEEDED 

Incremental redraw (as needed)

GSLC_EVTSUB_DRAW_FORCE 

Force a full redraw.

Event types.

Enumerator
GSLC_EVT_NONE 

No event; ignore.

GSLC_EVT_DRAW 

Perform redraw.

GSLC_EVT_TOUCH 

Track touch event.

GSLC_EVT_TICK 

Perform background tick handling.

GSLV_EVT_CUSTOM 

Custom event.

Font ID enumerations.

  • The Font ID is the primary means for user code to reference a specific font.
  • Application code can assign arbitrary Font ID values in the range of 0...16383
  • Negative Font ID values are reserved
Enumerator
GSLC_FONT_USER_BASE 

Starting Font ID for user assignments.

GSLC_FONT_NONE 

No Font ID has been assigned.

Font Reference modes.

  • The Font Reference mode defines the source for the selected font. For graphics libraries that offer multiple types of fonts, this can be used to differentiate between a default font, hardware fonts, software fonts, etc.
  • The encoding between the different modes is driver-specific.
Enumerator
GSLC_FONTREF_MODE_DEFAULT 

Default font mode.

GSLC_FONTREF_MODE_1 

Font mode 1.

GSLC_FONTREF_MODE_2 

Font mode 2.

GSLC_FONTREF_MODE_3 

Font mode 3.

Font Reference types.

  • The Font Reference type defines the way in which a font is selected. In some device targets (such as LINUX SDL) a filename to a font file is provided. In others (such as Arduino, ESP8266), a pointer is given to a font structure (or NULL for default).
Enumerator
GSLC_FONTREF_FNAME 

Font reference is a filename (full path)

GSLC_FONTREF_PTR 

Font reference is a pointer to a font structure.

Group ID enumerations.

Enumerator
GSLC_GROUP_ID_USER_BASE 

Starting Group ID for user assignments.

GSLC_GROUP_ID_NONE 

No Group ID has been assigned.

Image reference flags: Describes characteristics of an image reference.

Enumerator
GSLC_IMGREF_NONE 

No image defined.

GSLC_IMGREF_SRC_FILE 

Image is stored in file system.

GSLC_IMGREF_SRC_SD 

Image is stored on SD card.

GSLC_IMGREF_SRC_RAM 

Image is stored in RAM.

GSLC_IMGREF_SRC_PROG 

Image is stored in program memory (PROGMEM)

GSLC_IMGREF_FMT_BMP24 

Image format is BMP (24-bit)

GSLC_IMGREF_FMT_BMP16 

Image format is BMP (16-bit RGB565)

GSLC_IMGREF_FMT_RAW1 

Image format is raw monochrome (1-bit)

GSLC_IMGREF_FMT_JPG 

Image format is JPG (ESP32/ESP8366)

GSLC_IMGREF_SRC 

Mask for Source flags.

GSLC_IMGREF_FMT 

Mask for Format flags.

Status of a module's initialization.

Enumerator
GSLC_INITSTAT_UNDEF 

Module status has not been defined yet.

GSLC_INITSTAT_INACTIVE 

Module is not enabled.

GSLC_INITSTAT_FAIL 

Module is enabled but failed to init.

GSLC_INITSTAT_ACTIVE 

Module is enabled and initalized OK.

Raw input event types: touch, key, GPIOs.

Enumerator
GSLC_INPUT_NONE 

No input event.

GSLC_INPUT_TOUCH 

Touch / mouse event.

GSLC_INPUT_KEY_DOWN 

Key press down / pin input asserted.

GSLC_INPUT_KEY_UP 

Key press up (released)

GSLC_INPUT_PIN_ASSERT 

GPIO pin input asserted (eg. set to 1 / High)

GSLC_INPUT_PIN_DEASSERT 

GPIO pin input deasserted (eg. set to 0 / Low)

Page ID enumerations.

  • The Page ID is the primary means for user code to reference a specific page of elements.
  • Application code can assign arbitrary Page ID values in the range of 0...16383
  • Negative Page ID values are reserved
Enumerator
GSLC_PAGE_USER_BASE 

Starting Page ID for user assignments.

GSLC_PAGE_NONE 

No Page ID has been assigned.

enum gslc_tePin

General purpose pin/button constants.

Enumerator
GSLC_PIN_BTN_A 

Button A (short press)

GSLC_PIN_BTN_A_LONG 

Button A (long press)

GSLC_PIN_BTN_B 

Button B (short press)

GSLC_PIN_BTN_B_LONG 

Button B (long press)

GSLC_PIN_BTN_C 

Button C (short press)

GSLC_PIN_BTN_C_LONG 

Button C (long press)

GSLC_PIN_BTN_D 

Button D (short press)

GSLC_PIN_BTN_D_LONG 

Button D (long press)

GSLC_PIN_BTN_E 

Button E (short press)

GSLC_PIN_BTN_E_LONG 

Button E (long press)

GSLC_PIN_BTN_UP 

Button Up (short press)

GSLC_PIN_BTN_DOWN 

Button Down (short press)

GSLC_PIN_BTN_LEFT 

Button Left (short press)

GSLC_PIN_BTN_RIGHT 

Button Right (short press)

GSLC_PIN_BTN_SEL 

Button Select (short press)

Redraw types.

Enumerator
GSLC_REDRAW_NONE 

No redraw requested.

GSLC_REDRAW_FULL 

Full redraw of element requested.

GSLC_REDRAW_INC 

Incremental redraw of element requested.

Define page stack.

Enumerator
GSLC_STACK_BASE 

Base page.

GSLC_STACK_CUR 

Current page.

GSLC_STACK_OVERLAY 

Overlay page (eg. popups)

GSLC_STACK__MAX 

Defines maximum number of pages in stack.

Processed event from input raw events and actions.

Enumerator
GSLC_TOUCH_NONE 

No touch event active.

GSLC_TOUCH_TYPE_MASK 

Mask for type: coord/direct mode.

GSLC_TOUCH_COORD 

Event based on touch coordinate.

GSLC_TOUCH_DIRECT 

Event based on specific element index (keyboard/GPIO action)

GSLC_TOUCH_SUBTYPE_MASK 

Mask for subtype.

GSLC_TOUCH_DOWN 

Touch event (down)

GSLC_TOUCH_DOWN_IN 

Touch event (down inside tracked element)

GSLC_TOUCH_DOWN_OUT 

Touch event (down outside tracked element)

GSLC_TOUCH_UP 

Touch event (up)

GSLC_TOUCH_UP_IN 

Touch event (up inside tracked element)

GSLC_TOUCH_UP_OUT 

Touch event (up outside tracked element)

GSLC_TOUCH_MOVE 

Touch event (move)

GSLC_TOUCH_MOVE_IN 

Touch event (move inside tracked element)

GSLC_TOUCH_MOVE_OUT 

Touch event (move outside tracked element)

GSLC_TOUCH_FOCUS_ON 

Direct event focus on element.

GSLC_TOUCH_FOCUS_OFF 

Direct event focus away from focused element.

GSLC_TOUCH_FOCUS_SELECT 

Direct event select focus element.

GSLC_TOUCH_SET_REL 

Direct event set value (relative) on focus element.

GSLC_TOUCH_SET_ABS 

Direct event set value (absolute) on focus element.

Text reference flags: Describes the characteristics of a text string (ie.

whether internal to element or external and RAM vs Flash).)

Supported flag combinations are:

  • ALLOC_NONE
  • ALLOC_INT | MEM_RAM
  • ALLOC_EXT | MEM_RAM
  • ALLOC_EXT | MEM_PROG
Enumerator
GSLC_TXT_MEM_RAM 

Text string is in SRAM (read-write)

GSLC_TXT_MEM_PROG 

Text string is in PROGMEM (read-only)

GSLC_TXT_ALLOC_NONE 

No text string present.

GSLC_TXT_ALLOC_INT 

Text string allocated in internal element memory (GSLC_STR_LOCAL=1)

GSLC_TXT_ALLOC_EXT 

Text string allocated in external memory (GSLC_STR_LOCAL=0), ie. user code.

GSLC_TXT_ENC_PLAIN 

Encoding is plain text (LATIN1))

GSLC_TXT_ENC_UTF8 

Encoding is UTF-8.

GSLC_TXT_MEM 

Mask for updating text memory type.

GSLC_TXT_ALLOC 

Mask for updating location of text string buffer allocation.

GSLC_TXT_ENC 

Mask for updating text encoding.

GSLC_TXT_DEFAULT 

Element type.

Enumerator
GSLC_TYPE_NONE 

No element type specified.

GSLC_TYPE_BKGND 

Background element type.

GSLC_TYPE_BTN 

Button element type.

GSLC_TYPE_TXT 

Text label element type.

GSLC_TYPE_BOX 

Box / frame element type.

GSLC_TYPE_LINE 

Line element type.

GSLC_TYPE_BASE_EXTEND 

Base value for extended type enumerations.

Variable Documentation

GSLC_CB_DEBUG_OUT g_pfDebugOut

Global debug output function.