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
MIT License
Bot releases are visible (Hide)
Published by ImpulseAdventure almost 8 years ago
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 codePublished by ImpulseAdventure almost 8 years ago
PROGMEM
).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).
Published by ImpulseAdventure almost 8 years ago
PROGMEM
)
ElemSetTxtMem()
tsElem.eTxtFlags
ElemGetRedraw()
CollectGetRedraw()
eTxtFlags
: DrvDrawTxt()
, DrvGetTxtSize()
Published by ImpulseAdventure almost 8 years ago
/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
XSelNum
) need to include text string storage to support GSLC_LOCAL_STR=0
Published by ImpulseAdventure almost 8 years ago
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)Published by ImpulseAdventure almost 8 years ago
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
Published by ImpulseAdventure almost 8 years ago
tsElem.nType
uses int
instead of teElemType
. teElemType
GUIslice_ex.h
and not require changes toGUIslice.h
header.teTouch
enumeration separates state and positionPublished by ImpulseAdventure almost 8 years ago
pfuncXEvent
) to GUI,PageEvent()
, CollectEvent()
, ElemEvent()
*SetEventFunc()
for Page, Collect, ElemtsEvent
, tsEventTouch
, teEventType
,teEventSubType
ElemOwnsCoord()
tsCollect.pElemParent
NotifyElemTouch()
to ElemSendEventTouch()
teTouch
enumerationPublished by ImpulseAdventure almost 8 years ago
Enhancements
InitEnv()
call to specify frameElemSetTxtMargin()
to define text marginGetVer()
to return current library versionInitEnv()
: changed parameters to support configuration ofPublished by ImpulseAdventure almost 8 years ago
ElemSetStyleFrom
)ElemSetFrameEn
)ElemSetGlowCol
)GSLC_COL_*
) to offer moreElemSetCol()
: 4th parameter was occasionally used to define FrameGlowGSLC_COL_*_LT
and GSLC_COL_*_DK
) are replacedGSLC_COL_*_LT#
or _DK#
where # represents the level of shadePublished by ImpulseAdventure almost 8 years ago
Published by ImpulseAdventure almost 8 years ago
Separate rendering layer from core library
Published by ImpulseAdventure almost 8 years ago