/**1* @file lv_line.h2*3*/45#ifndef LV_LINE_H6#define LV_LINE_H78#ifdef __cplusplus9extern "C" {10#endif1112/*********************13* INCLUDES14*********************/15#ifdef LV_CONF_INCLUDE_SIMPLE16#include "lv_conf.h"17#else18#include "../../lv_conf.h"19#endif2021#if USE_LV_LINE != 02223#include "../lv_core/lv_obj.h"2425/*********************26* DEFINES27*********************/2829/**********************30* TYPEDEFS31**********************/3233/*Data of line*/34typedef struct35{36/*Inherited from 'base_obj' so no inherited ext.*/ /*Ext. of ancestor*/37const lv_point_t * point_array; /*Pointer to an array with the points of the line*/38uint16_t point_num; /*Number of points in 'point_array' */39uint8_t auto_size :1; /*1: set obj. width to x max and obj. height to y max */40uint8_t y_inv :1; /*1: y == 0 will be on the bottom*/41} lv_line_ext_t;4243/**********************44* GLOBAL PROTOTYPES45**********************/464748/**49* Create a line objects50* @param par pointer to an object, it will be the parent of the new line51* @return pointer to the created line52*/53lv_obj_t * lv_line_create(lv_obj_t * par, const lv_obj_t * copy);5455/*=====================56* Setter functions57*====================*/5859/**60* Set an array of points. The line object will connect these points.61* @param line pointer to a line object62* @param point_a an array of points. Only the address is saved,63* so the array can NOT be a local variable which will be destroyed64* @param point_num number of points in 'point_a'65*/66void lv_line_set_points(lv_obj_t * line, const lv_point_t * point_a, uint16_t point_num);6768/**69* Enable (or disable) the auto-size option. The size of the object will fit to its points.70* (set width to x max and height to y max)71* @param line pointer to a line object72* @param en true: auto size is enabled, false: auto size is disabled73*/74void lv_line_set_auto_size(lv_obj_t * line, bool en);7576/**77* Enable (or disable) the y coordinate inversion.78* If enabled then y will be subtracted from the height of the object,79* therefore the y=0 coordinate will be on the bottom.80* @param line pointer to a line object81* @param en true: enable the y inversion, false:disable the y inversion82*/83void lv_line_set_y_invert(lv_obj_t * line, bool en);8485#define lv_line_set_y_inv lv_line_set_y_invert /*The name was inconsistent. In v.6.0 only `lv_line_set_y_invert`will work */8687/**88* Set the style of a line89* @param line pointer to a line object90* @param style pointer to a style91*/92static inline void lv_line_set_style(lv_obj_t *line, lv_style_t *style)93{94lv_obj_set_style(line, style);95}9697/**98* Obsolete since v5.1. Just for compatibility with v5.0. Will be removed in v6.099* @param line -100* @param upscale -101*/102static inline void lv_line_set_upscale(lv_obj_t * line, bool upcale)103{104(void) line;105(void) upcale;106}107/*=====================108* Getter functions109*====================*/110111/**112* Get the auto size attribute113* @param line pointer to a line object114* @return true: auto size is enabled, false: disabled115*/116bool lv_line_get_auto_size(const lv_obj_t * line);117118/**119* Get the y inversion attribute120* @param line pointer to a line object121* @return true: y inversion is enabled, false: disabled122*/123bool lv_line_get_y_invert(const lv_obj_t * line);124125/**126* Get the style of an line object127* @param line pointer to an line object128* @return pointer to the line's style129*/130static inline lv_style_t* lv_line_get_style(const lv_obj_t *line)131{132return lv_obj_get_style(line);133}134135/**136* Obsolete since v5.1. Just for compatibility with v5.0. Will be removed in v6.0137* @param line -138* @return false139*/140static inline bool lv_line_get_upscale(const lv_obj_t * line)141{142(void) line;143return false;144}145146147/**********************148* MACROS149**********************/150151#endif /*USE_LV_LINE*/152153#ifdef __cplusplus154} /* extern "C" */155#endif156157#endif /*LV_LINE_H*/158159160