30#ifdef LV_LVGL_H_INCLUDE_SIMPLE
112 void activateScreen(uint32_t anim_time=0, lv_scr_load_anim_t anim=LV_SCR_LOAD_ANIM_NONE);
152 bool setObjValue(
const char* objName, int16_t val);
178 lvppSwitch(
const char* fName, lv_obj_t* parent=
nullptr);
215 lvppButton(
const char* fName,
const char* pText=
nullptr, lv_obj_t* parent=
nullptr);
254 void setOptions(std::vector<std::string> &inOptions);
307 lvppFullImageToggleButton(
const char* fName, lv_img_dsc_t uncheckedImg, lv_img_dsc_t checkedImg, lv_obj_t* parent=
nullptr);
345 lvppImage(
const char* fName, lv_obj_t* parent=
nullptr);
352 void setImage(
const lv_img_dsc_t* pImg);
360 virtual void setSize(lv_coord_t width, lv_coord_t height);
392 lvppLabel(
const char* fName,
const char* pText=
nullptr, lv_obj_t* parent=
nullptr);
398 virtual void setText(
const char* pText);
422 lvppBar(
const char* fName, lv_obj_t* parent=
nullptr);
429 void setRange(int16_t range_min, int16_t range_max);
444 void baseSetter(int16_t nVal,
bool animate=
true);
459 lvppSlider(
const char* fName, lv_obj_t* parent=
nullptr);
466 void setRange(int16_t range_min, int16_t range_max);
481 void baseSetter(int16_t nVal,
bool animate=
true);
496 lvppArc(
const char* fName, lv_obj_t* parent=
nullptr);
515 void setRange(int16_t range_min, int16_t range_max);
552 void baseSetter(int16_t nVal,
bool animate=
true);
571 lvppDropdown(
const char* fName,
const char* pOptions=
nullptr, lv_obj_t* parent=
nullptr);
615 void getSelectedText(
char* selStr, uint8_t selStrLen) { lv_dropdown_get_selected_str(
obj, selStr, selStrLen); };
645 lvppRoller(
const char* fName,
const char* pOptions=
nullptr, lv_obj_t* parent=
nullptr);
682 void getSelectedText(
char* selStr, uint8_t selStrLen) { lv_roller_get_selected_str(
obj, selStr, selStrLen); };
729 lvppCanvasFullColor(
const char* fName, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_color_t* providedBuffer=
nullptr, lv_obj_t* parent=
nullptr);
744 void drawPixel(lv_coord_t x, lv_coord_t y, lv_color_t color);
756 void drawRect(lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h,
757 lv_coord_t borderThickness, lv_color_t borderColor, lv_color_t fillColor, uint16_t radius, lv_opa_t opa);
766 void drawLine(lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2, lv_coord_t
width, lv_color_t color);
778 void drawLabel(lv_coord_t x, lv_coord_t y, lv_coord_t maxW, lv_color_t color,
const char* pText);
853 lvppCanvasIndexed(
const char* fName, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, uint8_t colorDepth, lv_color_t* providedBuffer=
nullptr, lv_obj_t* parent=
nullptr);
911 void drawPixel(lv_coord_t x, lv_coord_t y, lv_color_t color);
927 void drawLineVert(lv_coord_t x1, lv_coord_t y1, lv_coord_t h, lv_color_t color);
943 void drawLineHoriz(lv_coord_t x1, lv_coord_t y1, lv_coord_t w, lv_color_t color);
960 lv_color_t borderColor);
969 lv_color_t borderColorInd);
978 void drawRectWithFill(lv_coord_t x1, lv_coord_t y1, lv_coord_t w, lv_coord_t h,
979 lv_color_t borderColor, lv_color_t fillColor);
989 lv_color_t borderColorInd, lv_color_t fillColorInd);
1013 lv_color_t borderColor, lv_color_t fillColor);
1023 lv_color_t borderColorInd, lv_color_t fillColorInd);
1028#if LV_COLOR_DEPTH == 16
1029 std::map<uint16_t, uint8_t> colorToIndex;
1030#elif LV_COLOR_DEPTH == 8
1031 std::map<uint8_t, uint8_t> colorToIndex;
Support file for app_hal.c which is only used in simulation/native builds.
Create an Arc widget - also based on lvppBaseWithValue like Bar and Slider.
Definition: lvpp.h:488
void baseSetter(int16_t nVal, bool animate=true)
Implementation which sets the current value of the widget itself. This function generally gets called...
Definition: lvppArc.cpp:50
lv_style_t style_pressed_color
Definition: lvpp.h:554
void setArcIndicatorColor(lv_color_t newColor)
Set the Arc's indicator Color - can be useful for custom values/ranges corresponding to different vis...
void setRange(int16_t range_min, int16_t range_max)
Set the Range of your new arc widget.
Definition: lvppArc.cpp:70
void setArcRotationAndSweep(uint16_t rot, uint16_t startAngle=361, uint16_t endAngle=361)
Set the Arc Rotation And Sweep amounts.
Definition: lvppArc.cpp:59
lv_style_t style_ind
Definition: lvpp.h:553
void setArcColor(lv_color_t newColor)
Set the Arc Color - can be useful for custom values/ranges corresponding to different visual represen...
Definition: lvppArc.cpp:54
int16_t baseGetter()
Implementation of getting the value from the widget.
Definition: lvppArc.cpp:46
Create a 'bar' widget from LVGL and allow range and value to be used.
Definition: lvpp.h:414
int16_t baseGetter()
Implementation of getting the value from the widget.
Definition: lvppBar.cpp:42
void setRange(int16_t range_min, int16_t range_max)
Set the Range of your new bar widget.
Definition: lvppBar.cpp:50
void baseSetter(int16_t nVal, bool animate=true)
Implementation which sets the current value of the widget itself. This function generally gets called...
Definition: lvppBar.cpp:46
lvppBase is the root of the C++ library LVGLPlusPlus. It strives to create consistent ways to manipul...
Definition: lvppBase.h:70
lv_obj_t * obj
The LVGL object that was created for this widget.
Definition: lvppBase.h:359
virtual void setText(const char *pText)
Set the Text for the primary text label. For a button, for instance, this is the text on top of the b...
Definition: lvppBase.cpp:190
Derivation from lvppBase. Those widgets which have an inherant 'value' to show are based on this slig...
Definition: lvppBase.h:408
Construct a canvas which uses FULL_COLOR rather than indexed color methods.
Definition: lvpp.h:716
lv_draw_rect_dsc_t * pDscRect
Definition: lvpp.h:780
lv_coord_t width
Definition: lvpp.h:785
void drawPixel(lv_coord_t x, lv_coord_t y, lv_color_t color)
Draw a single pixel on to the canvas.
Definition: lvppCanvas.cpp:405
virtual ~lvppCanvasFullColor()
Definition: lvppCanvas.cpp:386
lv_point_t twoPoints[2]
Definition: lvpp.h:783
void drawRect(lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_coord_t borderThickness, lv_color_t borderColor, lv_color_t fillColor, uint16_t radius, lv_opa_t opa)
Draw a rectangle on the canvas.
Definition: lvppCanvas.cpp:409
lv_color_t * pBuffer
Definition: lvpp.h:784
void drawLabel(lv_coord_t x, lv_coord_t y, lv_coord_t maxW, lv_color_t color, const char *pText)
Draw a text label onto the canvas.
Definition: lvppCanvas.cpp:447
void setbgColor(lv_color_t bgColor)
Set the background color of the canvas.
Definition: lvppCanvas.cpp:401
lv_draw_label_dsc_t * pDscLabel
Definition: lvpp.h:782
void drawLine(lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2, lv_coord_t width, lv_color_t color)
Draw a line on the canvas.
Definition: lvppCanvas.cpp:429
lv_draw_line_dsc_t * pDscLine
Definition: lvpp.h:781
lv_coord_t height
Definition: lvpp.h:785
Construct a canvas which uses INDEXED color rather than FULL color methods.
Definition: lvpp.h:835
lv_coord_t height
Definition: lvpp.h:1034
void drawRectWithoutFillByIndex(lv_coord_t x1, lv_coord_t y1, lv_coord_t w, lv_coord_t h, lv_color_t borderColorInd)
Draw a rectangle on the canvas without filling in the rectangle using an index color.
Definition: lvppCanvas.cpp:248
lv_color_t * pBuffer
Definition: lvpp.h:1033
void setbgColorByIndex(lv_color_t bgColorIndex)
Set the backgrond color from an index color.
Definition: lvppCanvas.cpp:163
void drawRectWithFillByIndex(lv_coord_t x1, lv_coord_t y1, lv_coord_t w, lv_coord_t h, lv_color_t borderColorInd, lv_color_t fillColorInd)
Draw a rectangle on the canvas and fill in the center of the rectangle. This uses index colors.
Definition: lvppCanvas.cpp:281
void drawPixelByIndex(lv_coord_t x, lv_coord_t y, lv_color_t colorIndex)
Draw a single pixel on to the canvas using an index color.
Definition: lvppCanvas.cpp:182
void clearColorIndex()
Remove all colors from the indexed color set.
Definition: lvppCanvas.cpp:137
void drawLineHoriz(lv_coord_t x1, lv_coord_t y1, lv_coord_t w, lv_color_t color)
Draw a horizontal line on the canvas.
Definition: lvppCanvas.cpp:214
bool getIndexFromColor(lv_color_t col, lv_color_t &ind)
Get the Index of a single Color.
Definition: lvppCanvas.cpp:142
void drawPixel(lv_coord_t x, lv_coord_t y, lv_color_t color)
Draw a single pixel on to the canvas.
Definition: lvppCanvas.cpp:172
uint16_t maxColorIndexesAllowed
Number of color indexes available based on the color depth at creation time.
Definition: lvpp.h:1025
void drawRectWithFill(lv_coord_t x1, lv_coord_t y1, lv_coord_t w, lv_coord_t h, lv_color_t borderColor, lv_color_t fillColor)
Draw a rectangle on the canvas and fill in the center of the rectangle.
Definition: lvppCanvas.cpp:270
void drawLineHorizByIndex(lv_coord_t x1, lv_coord_t y1, lv_coord_t w, lv_color_t indexCol)
Draw a horizontal line on the canvas using an index color.
Definition: lvppCanvas.cpp:224
lv_coord_t width
Definition: lvpp.h:1034
void drawCenteredRectWithoutFillByIndex(lv_coord_t xBorder, lv_coord_t yBorder, lv_color_t borderColorInd)
Draw a centered rectangle on the canvas. Will have xBorder/yBorder around it. This uses index colors.
Definition: lvppCanvas.cpp:324
virtual ~lvppCanvasIndexed()
Definition: lvppCanvas.cpp:91
bool addPaletteToIndex(lv_palette_t pal)
Add a full palette of color to the indexed color set. This is 10 colors.
Definition: lvppCanvas.cpp:114
void drawLineVertByIndex(lv_coord_t x1, lv_coord_t y1, lv_coord_t h, lv_color_t indexCol)
Draw a verical line on the canvas using an index color.
Definition: lvppCanvas.cpp:201
void drawRectWithoutFill(lv_coord_t x1, lv_coord_t y1, lv_coord_t w, lv_coord_t h, lv_color_t borderColor)
Draw a rectangle on the canvas without filling in the rectangle.
Definition: lvppCanvas.cpp:237
bool addColorToIndex(lv_color_t col)
Add a single color to the indexed color set.
Definition: lvppCanvas.cpp:100
void drawCenteredRectWithFillByIndex(lv_coord_t xBorder, lv_coord_t yBorder, lv_color_t borderColorInd, lv_color_t fillColorInd)
Draw a centered rectangle on the canvas and fill in the rectangle. Will have xBorder/yBorder around i...
Definition: lvppCanvas.cpp:350
void setbgColor(lv_color_t bgColor)
Set the background color of the canvas.
Definition: lvppCanvas.cpp:153
void drawCenteredRectWithFill(lv_coord_t xBorder, lv_coord_t yBorder, lv_color_t borderColor, lv_color_t fillColor)
Draw a centered rectangle on the canvas and fill in the rectangle. Will have xBorder/yBorder around i...
Definition: lvppCanvas.cpp:339
void drawCenteredRectWithoutFill(lv_coord_t xBorder, lv_coord_t yBorder, lv_color_t borderColor)
Draw a centered rectangle on the canvas. Will have xBorder/yBorder around it.
Definition: lvppCanvas.cpp:314
uint8_t colorIndexesUsed
Definition: lvpp.h:1026
void drawLineVert(lv_coord_t x1, lv_coord_t y1, lv_coord_t h, lv_color_t color)
Draw a verical line on the canvas.
Definition: lvppCanvas.cpp:191
Support for drop-down lists and choosing from a dropdown. Utilizes multiple inheritance of lvppBase a...
Definition: lvpp.h:562
virtual uint16_t lvOptionGetIndex()
This is the implementation of the pure virtual in lvppOptions. It is responsible for doing the actual...
Definition: lvppDropdown.cpp:46
void setOptions(const char *pOptions)
sets the complete list of options by way of a char pointer with options separated by \n
Definition: lvppDropdown.cpp:53
void setSelectedIndex(uint16_t curInd)
Set the selected option manually/programmatically.
Definition: lvppDropdown.cpp:76
void getSelectedText(char *selStr, uint8_t selStrLen)
Get the Text value of the currently selected option.
Definition: lvpp.h:615
void lvOptionSetter(const char *pOpts)
This is the implementation of the pure virtual in lvppOptions. It is responsible for doing the actual...
Definition: lvppDropdown.cpp:42
uint16_t getSelectedIndex()
Get the Index of the selected option.
Definition: lvpp.h:601
void clearOptions(void)
Removes all options from the dropdown.
Definition: lvppDropdown.cpp:61
void setDropdownDirection(lv_dir_t dropDirection)
Set the Dropdown Direction. Depending on the screen location of the drop-down, it may be desirable to...
Definition: lvppDropdown.cpp:72
Object for loading and displaying an image on a screen.
Definition: lvpp.h:337
void setImage(const lv_img_dsc_t *pImg)
Set the Image to be displayed. This is a pre-prepared lv_img_dsc_t directly from LVGL.
Definition: lvppImage.cpp:47
bool noRotation
Definition: lvpp.h:376
void setRotation(int16_t rotTenthsOfDegrees)
Set the Rotation angle of the image about the setPivot point.
Definition: lvppImage.cpp:102
virtual void setSize(lv_coord_t width, lv_coord_t height)
Set the Size object. In the case of lvppImage, we need to scale/zoom the image to match the size desi...
Definition: lvppImage.cpp:65
int16_t deferred_w
Definition: lvpp.h:375
int16_t deferred_h
Definition: lvpp.h:375
~lvppImage()
Definition: lvppImage.cpp:43
void setPivotPoint(lv_coord_t xPivot, lv_coord_t yPivot)
Set the Pivot Point for the image. Rotations will happen about this point.
Definition: lvppImage.cpp:111
const lv_img_dsc_t * pImage
Definition: lvpp.h:374
Enable the display of a text item.
Definition: lvpp.h:383
void setTextColor(lv_color_t newColor)
Set the Text Color of the label (not the background)
Definition: lvppLabel.cpp:60
virtual void setText(const char *pText)
Set the Text value to display.
Definition: lvppLabel.cpp:51
Utility class to aid in consistent handling of all lv_ widgets which have a list of choices....
Definition: lvppBase.h:547
std::vector< std::string > options
The vector of options kept locally.
Definition: lvppBase.h:632
Construct a roller list widget for option selection.
Definition: lvpp.h:636
void setSelectedIndex(uint16_t curInd)
Set the selected option manually/programmatically.
Definition: lvppDropdown.cpp:127
virtual void lvOptionSetter(const char *pOpts)
This is the implementation of the pure virtual in lvppOptions. It is responsible for doing the actual...
Definition: lvppDropdown.cpp:95
void clearOptions(void)
Removes all options from the roller.
Definition: lvppDropdown.cpp:117
void setOptions(const char *pOptions)
sets the complete list of options by way of a char pointer with options separated by \n
Definition: lvppDropdown.cpp:106
virtual uint16_t lvOptionGetIndex()
This is the implementation of the pure virtual in lvppOptions. It is responsible for doing the actual...
Definition: lvppDropdown.cpp:99
void getSelectedText(char *selStr, uint8_t selStrLen)
Get the Text value of the currently selected option.
Definition: lvpp.h:682
uint16_t getSelectedIndex()
Get the Index of the currently selected option.
Definition: lvpp.h:668
The lvppScreen is a non - lvppBase object for organizing the use of multiple screens in a project.
Definition: lvpp.h:68
lv_obj_t * pPriorScreen
Holder for prior screen when activateScreen() is called. Used in activatePriorScreen()
Definition: lvpp.h:160
~lvppScreen()
Definition: lvpp.h:78
bool setObjValue(const char *objName, int16_t val)
Set the value of the object objName to val if found.
Definition: lvppScreen.cpp:92
lv_obj_t * pScreen
The actual underlying LVGL screen pointer.
Definition: lvpp.h:159
std::vector< lvppBase * > objects
Data structure used to hold all of the object pointers.
Definition: lvpp.h:161
lvppBase * findObj(const char *pName)
Obtain a pointer to an object which was prior added to the lvppScreen by addObject().
Definition: lvppScreen.cpp:78
void activateScreen(uint32_t anim_time=0, lv_scr_load_anim_t anim=LV_SCR_LOAD_ANIM_NONE)
Load/Activate this screen either with or without animation based on parameters given.
Definition: lvppScreen.cpp:55
lv_obj_t * getScreen()
Get a pointer to the LVGL lv_obj_t screen object.
Definition: lvpp.h:98
void activatePriorScreen()
If you've activated this screen via activateScreen(), then this method will activate the screen which...
Definition: lvppScreen.cpp:65
void disableScrollBars()
Defeats the automatic use of scrollbars by LVGL when certain drawing operations might cause them to a...
Definition: lvppScreen.cpp:51
void addObject(lvppBase *pObj)
Add any lvppBase object pointer to the screen to keep track of.
Definition: lvppScreen.cpp:72
void setObjText(std::string str)
Construct a new Slider widget (similar to a bar in LVGL parlance).
Definition: lvpp.h:451
void setRange(int16_t range_min, int16_t range_max)
Set the Range of your new slider widget.
Definition: lvppBar.cpp:80
int16_t baseGetter()
Implementation of getting the value from the widget.
Definition: lvppBar.cpp:72
void baseSetter(int16_t nVal, bool animate=true)
Implementation which sets the current value of the widget itself. This function generally gets called...
Definition: lvppBar.cpp:76
On/Off switch widget.
Definition: lvpp.h:170
bool getCheckedState()
Get the Checked State of the switch.
Definition: lvppButton.cpp:186
void setCheckedState(bool bChecked=true)
Set the Checked State either on or off.
Definition: lvppButton.cpp:177
void setEnabled(bool bEnable=true)
Set the switch to be enabled or disabled.
Definition: lvppButton.cpp:168
Base class for LVGLPlusPlus widgets (lvppBase)