GUIslice drag & drop embedded GUI in C for touchscreen TFT on Arduino, Raspberry Pi, ARM, ESP8266 / ESP32 / M5stack using Adafruit-GFX / TFT_eSPI / UTFT / SDL
InitDebug()
to support redirection of debug output to Serial
/ stderr
debug_print()
renamed to GSLC_DEBUG_PRINT()
DEBUG_ERR 1
), set to 0
to reduce memoryDebugOut()
functiongslc_InitDebug()
at start of codePROGMEM
).tsPage
's internal element array in RAM or external Flash memory).ElemCreate*_P()
macros to build read-only elements in FlashElemCreate*_P()
macros to select Flash memory for elements, reducing RAM consumption considerably.loop()
ClipPt()
ElemDrawByRef()
gslc_tsElemRef
).
gslc_tsElem m_asPageElem[MAX_ELEM];
gslc_tsElemRef m_asPageElemRef[MAX_ELEM];
PageAdd()
adds two parameters (element reference array and total element count)./arduino/gslc_ex07_ard/
UPDATE: As of commit 67f3a93 (2017/01/08), all CPUs (eg. Feather M0) can use ElemCreate*_P() macros (even if PROGMEM is not supported).
PROGMEM
)
ElemSetTxtMem()
tsElem.eTxtFlags
ElemGetRedraw()
CollectGetRedraw()
eTxtFlags
: DrvDrawTxt()
, DrvGetTxtSize()
/arduino
directory, including a few example sketchesGUIslice_config.h
. Config also needs to be modified to match board/shield pinout.tsImgRef
).
ResetImage()
, GetImageFromFile()
, GetImageFromSD()
, GetImageFromRam()
, GetImageFromProg()
.InitTs()
removed (Init()
automatically calls InitTouch()
)InitTouch()
, GetTouch()
int16_t
GSLC_LOCAL_STR=0
. RPI/LINUX users will likely want to continue with the internal buffer mode.FontAdd()
range checkingElemSetTxtStr()
only redraws if changedElemXGaugeDraw()
eliminates redraw flickerGSLC_LOCAL_STR
DRV_DISP_ADAGFX
, ADAGFX_*
DRV_TOUCH_*
GSLC_ELEM_STRLEN_MAX
to GSLC_LOCAL_STR_LEN
ElemCreateBtnImg()
, ElemCreateImg()
, ElemSetImage()
, SetBkgndImage()
now use tsImgRef
instead of image filename. Create an image reference with GetImageFrom*()
ElemCreateTxt()
, ElemCreateBtnTxt()
, ElemCreate()
add buffer length parameter. If using legacy internal mode (GSLC_LOCAL_STR=1
) then simply pass a value of 0
as it will be ignored. If using external storage (GSLC_LOCAL_STR=0
) then character buffer should be a static or global variable.DrvLoadBmp()
replaced by DrvLoadImage()
DrvLoadImage()
, DrvSetBkgndImage()
, DrvSetElemImageNorm()
, DrvSetElemImageGlow()
, DrvDrawImage()
now use tsImgRef
Compound element structs (eg. XSelNum
) need to include text string storage to support GSLC_LOCAL_STR=0
GUIslice_config.h
InitEnv()
and DrvInitEnv()
UserInitEnv()
in examples)tsFont*
instead of void*
DrvGetTxtSize()
DrawElemByRef()
instead of driver578c460
)
InitEnv()
with user init (see UserInitEnv()
in examples)GUIslice_config.h
, modify as needed for environment / displaygslc_Color
to gslc_tsColor
, gslc_Pt
to gslc_tsPt
and gslc_Rect
to gslc_tsRect
Init()
call (see #c8c41a8
notes)src/GUIslice_drv_sdl.*
" supports both SDL1.2 and SDL2 via compiler flag ("DRV_TYPE_SDL1
" or "DRV_TYPE_SDL2
").SDL_Surface
while code for SDL2.0 typically stores SDL_Texture
.gslc_tsDriver
struct (tsGui.pvDriver
)GetTsTouch
) moved to "src/GUIslice_drv_sdl.*
"src/GUIslice_drv_sdl1.*
" to "src/GUIslice_drv_sdl.*
"VT_WRK_EN
to DRV_SDL_FIX_START
gslc_tsDriver
and passes into new param of Init()
GUIslice_drv.h
"DrvDraw()
routines return bool instead of voidbRedrawPartialEn
)pvSurfBkgnd
to pvImgBknd
) and related functions (eg. DrvSurfaceDestruct
to DrvImageDestruct
).DrvLoadBmp()
returns void* instead of SDL_Surface*tests/test-sdl.*
" to "tests/test-sdl1.*
" and added "tests/test-sdl2.*
"gslc_Pt
Using SDL2.0 on Raspberry Pi
fb1
. SDL2.0 using OpenGL will write to fb0
. An extra step needs to be taken to allow the hardware accelerated output on fb0
to be seen by fb1
.
rpi-fbcp
to mirror /dev/fb0
to /dev/fb1
tsElem.nType
uses int
instead of teElemType
. teElemType
enum split between core and extended file so that new types
can be defined in GUIslice_ex.h
and not require changes to
GUIslice.h
header.teTouch
enumeration separates state and positionpfuncXEvent
) to GUI,
Page, Collect, ElemPageEvent()
, CollectEvent()
, ElemEvent()
*SetEventFunc()
for Page, Collect, ElemtsEvent
, tsEventTouch
, teEventType
,
teEventSubType
ElemOwnsCoord()
tsCollect.pElemParent
NotifyElemTouch()
to ElemSendEventTouch()
teTouch
enumerationEnhancements
InitEnv()
call to specify frame
buffer and touch device. This facilitates support for
other display hardware.ElemSetTxtMargin()
to define text marginGetVer()
to return current library versionInitEnv()
: changed parameters to support configuration of
device paths from user code. tsGui* parameter is replaced by
framebuffer and touchscreen device path strings. Pass NULL if
not used (eg. no touch support).ElemSetStyleFrom
)ElemSetFrameEn
)ElemSetGlowCol
)GSLC_COL_*
) to offer more
shades and consistencyElemSetCol()
: 4th parameter was occasionally used to define FrameGlow
for certain controls (such as XSlider), but not it is only used for
FillGlowGSLC_COL_*_LT
and GSLC_COL_*_DK
) are replaced
by a GSLC_COL_*_LT#
or _DK#
where # represents the level of shade