diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-11-12 19:14:09 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-11-12 19:14:09 +1100 |
| commit | 8a0a167adbf3d9b6f8b6f16aaf20ca39ad5549de (patch) | |
| tree | 02b6cf23f591915747ec2994381854a79979c4a0 /lib/luavgl/simulator/widgets/lv_pointer.h | |
| parent | 8471046a95ab9e00f7d42b56dbbc9ce3e5b424b9 (diff) | |
| download | tangara-fw-8a0a167adbf3d9b6f8b6f16aaf20ca39ad5549de.tar.gz | |
Convert the main menu screen to lua lol
Diffstat (limited to 'lib/luavgl/simulator/widgets/lv_pointer.h')
| -rw-r--r-- | lib/luavgl/simulator/widgets/lv_pointer.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/lib/luavgl/simulator/widgets/lv_pointer.h b/lib/luavgl/simulator/widgets/lv_pointer.h new file mode 100644 index 00000000..76c273e4 --- /dev/null +++ b/lib/luavgl/simulator/widgets/lv_pointer.h @@ -0,0 +1,67 @@ +#ifndef LV_WIDGETS_POINTER_H_ +#define LV_WIDGETS_POINTER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +#include <lvgl.h> + +#if LV_USE_POINTER + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_img_t obj; + int value; + int value_start; + int value_range; + int angle_start; + int angle_range; +} lv_pointer_t; + +extern const lv_obj_class_t lv_pointer_class; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +lv_obj_t* lv_pointer_create(lv_obj_t* parent); + +/** + * Set range parameters for pointer + * @param value_start the value mapped to angle_start + * @param value_range the value range, could be negative + * @param angle_start the angle will be set then value equals to value_start + * @param angle_range the angle range, could be negative + */ +void lv_pointer_set_range(lv_obj_t* obj, int value_start, int value_range, + int angle_start, int angle_range); + +/** + * Set current value pointer points to + * @param value If value is out of range, then angle is also clampped to limits + */ +void lv_pointer_set_value(lv_obj_t* obj, int value); + +/********************** + * MACROS + **********************/ + +#endif /* */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* LV_WIDGETS_POINTER_H_ */ |
