2019-11-01 11:09:56 +01:00
|
|
|
/**
|
|
|
|
* @file lv_api_map.h
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LV_API_MAP_H
|
|
|
|
#define LV_API_MAP_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* INCLUDES
|
|
|
|
*********************/
|
2019-12-21 20:36:19 +01:00
|
|
|
#include "../lvgl.h"
|
2019-11-01 11:09:56 +01:00
|
|
|
|
|
|
|
/*********************
|
|
|
|
* DEFINES
|
|
|
|
*********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* TYPEDEFS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* GLOBAL PROTOTYPES
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
/*---------------------
|
|
|
|
* V6.0 COMPATIBILITY
|
|
|
|
*--------------------*/
|
2020-05-12 21:29:16 +02:00
|
|
|
#if LV_USE_API_EXTENSION_V6
|
2019-11-25 12:24:17 +01:00
|
|
|
|
2020-05-01 11:17:43 +02:00
|
|
|
static inline void lv_task_once(lv_task_t * task)
|
2020-04-15 17:57:06 -04:00
|
|
|
{
|
|
|
|
lv_task_set_repeat_count(task, 1);
|
|
|
|
}
|
|
|
|
|
2020-05-02 18:36:52 -04:00
|
|
|
#if LV_USE_CHECKBOX
|
|
|
|
|
|
|
|
#define lv_checkbox_set_static_text lv_checkbox_set_text_static
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2019-11-25 12:24:17 +01:00
|
|
|
#if LV_USE_CHART
|
|
|
|
|
2019-11-04 16:56:57 +01:00
|
|
|
#define lv_chart_get_point_cnt lv_chart_get_point_count
|
2019-11-01 11:09:56 +01:00
|
|
|
|
2019-11-25 12:24:17 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
#if LV_USE_DROPDOWN
|
2019-11-25 12:24:17 +01:00
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
static inline void lv_dropdown_set_draw_arrow(lv_obj_t * ddlist, bool en)
|
2019-11-20 16:18:56 +01:00
|
|
|
{
|
2020-02-14 12:36:44 +01:00
|
|
|
if(en) lv_dropdown_set_symbol(ddlist, LV_SYMBOL_DOWN);
|
|
|
|
else lv_dropdown_set_symbol(ddlist, NULL);
|
2019-11-20 16:18:56 +01:00
|
|
|
}
|
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
static inline bool lv_dropdown_get_draw_arrow(lv_obj_t * ddlist)
|
2019-11-20 16:18:56 +01:00
|
|
|
{
|
2020-02-14 12:36:44 +01:00
|
|
|
if(lv_dropdown_get_symbol(ddlist)) return true;
|
2019-11-20 16:18:56 +01:00
|
|
|
else return false;
|
|
|
|
}
|
2019-11-01 11:09:56 +01:00
|
|
|
|
2020-05-02 18:36:52 -04:00
|
|
|
#define lv_dropdown_set_static_options lv_dropdown_set_options_static
|
|
|
|
|
2019-11-25 12:24:17 +01:00
|
|
|
#endif
|
|
|
|
|
2019-12-02 16:09:35 +01:00
|
|
|
#if LV_USE_BAR
|
2019-12-02 07:37:33 -05:00
|
|
|
|
|
|
|
/**
|
2019-12-02 16:09:35 +01:00
|
|
|
* Make the bar symmetric to zero. The indicator will grow from zero instead of the minimum
|
2019-12-02 07:37:33 -05:00
|
|
|
* position.
|
2019-12-02 16:09:35 +01:00
|
|
|
* @param bar pointer to a bar object
|
2019-12-02 07:37:33 -05:00
|
|
|
* @param en true: enable disable symmetric behavior; false: disable
|
2019-12-02 16:09:35 +01:00
|
|
|
* @deprecated As of v7.0, you should use `lv_bar_set_type` instead.
|
2019-12-02 07:37:33 -05:00
|
|
|
*/
|
2019-12-02 16:09:35 +01:00
|
|
|
static inline void lv_bar_set_sym(lv_obj_t * bar, bool en)
|
2019-12-02 07:37:33 -05:00
|
|
|
{
|
2019-12-02 16:09:35 +01:00
|
|
|
if(en)
|
2020-03-04 16:29:21 +01:00
|
|
|
lv_bar_set_type(bar, LV_BAR_TYPE_SYMMETRICAL);
|
2019-12-02 16:09:35 +01:00
|
|
|
else
|
|
|
|
lv_bar_set_type(bar, LV_BAR_TYPE_NORMAL);
|
2019-12-02 07:37:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-12-02 16:09:35 +01:00
|
|
|
* Get whether the bar is symmetric or not.
|
|
|
|
* @param bar pointer to a bar object
|
2019-12-02 07:37:33 -05:00
|
|
|
* @return true: symmetric is enabled; false: disable
|
2019-12-02 16:09:35 +01:00
|
|
|
* @deprecated As of v7.0, you should use `lv_bar_get_type` instead.
|
2019-12-02 07:37:33 -05:00
|
|
|
*/
|
2020-02-26 19:48:27 +01:00
|
|
|
static inline bool lv_bar_get_sym(lv_obj_t * bar)
|
|
|
|
{
|
2020-03-04 16:29:21 +01:00
|
|
|
return lv_bar_get_type(bar) == LV_BAR_TYPE_SYMMETRICAL;
|
2019-12-02 07:37:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2020-05-02 18:36:52 -04:00
|
|
|
#if LV_USE_LABEL
|
|
|
|
|
|
|
|
#define lv_label_set_static_text lv_label_set_text_static
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2019-12-02 16:09:35 +01:00
|
|
|
#if LV_USE_SLIDER
|
2019-12-02 07:37:33 -05:00
|
|
|
|
|
|
|
/**
|
2019-12-02 16:09:35 +01:00
|
|
|
* Make the slider symmetric to zero. The indicator will grow from zero instead of the minimum
|
2019-12-02 07:37:33 -05:00
|
|
|
* position.
|
2019-12-02 16:09:35 +01:00
|
|
|
* @param slider pointer to a bar object
|
2019-12-02 07:37:33 -05:00
|
|
|
* @param en true: enable disable symmetric behavior; false: disable
|
2019-12-02 16:09:35 +01:00
|
|
|
* @deprecated As of v7.0, you should use `lv_slider_set_type` instead.
|
2019-12-02 07:37:33 -05:00
|
|
|
*/
|
2019-12-02 16:09:35 +01:00
|
|
|
static inline void lv_slider_set_sym(lv_obj_t * slider, bool en)
|
2019-12-02 07:37:33 -05:00
|
|
|
{
|
2020-02-26 19:48:27 +01:00
|
|
|
lv_bar_set_sym(slider, en);
|
2019-12-02 07:37:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-12-02 16:09:35 +01:00
|
|
|
* Get whether the slider is symmetric or not.
|
|
|
|
* @param slider pointer to a slider object
|
2019-12-02 07:37:33 -05:00
|
|
|
* @return true: symmetric is enabled; false: disable
|
2019-12-02 16:09:35 +01:00
|
|
|
* @deprecated As of v7.0, you should use `lv_slider_get_type` instead.
|
2019-12-02 07:37:33 -05:00
|
|
|
*/
|
2020-02-26 19:48:27 +01:00
|
|
|
static inline bool lv_slider_get_sym(lv_obj_t * slider)
|
|
|
|
{
|
|
|
|
return lv_bar_get_sym(slider);
|
2019-12-02 07:37:33 -05:00
|
|
|
}
|
|
|
|
|
2020-05-07 16:36:51 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if LV_USE_ROLLER
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set a fixed width for the roller.
|
|
|
|
* @param roller pointer to a roller object
|
|
|
|
* @param w width
|
|
|
|
* @deprecated As of v7.0, you should use `lv_roller_set_auto_fit` and set the width normally instead.
|
|
|
|
*/
|
|
|
|
static inline void lv_roller_set_fix_width(lv_obj_t * roller, lv_coord_t w)
|
|
|
|
{
|
|
|
|
lv_roller_set_auto_fit(roller, false);
|
|
|
|
lv_obj_set_width(roller, w);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-12-02 07:37:33 -05:00
|
|
|
#endif
|
|
|
|
|
2020-05-12 21:29:16 +02:00
|
|
|
|
|
|
|
#if LV_USE_PAGE
|
|
|
|
#define lv_scrlbar_mode_t lv_scrollbar_mode_t
|
|
|
|
|
|
|
|
#define LV_SCRLBAR_MODE_OFF LV_SCROLLBAR_MODE_OFF
|
2020-06-19 10:13:53 -04:00
|
|
|
#define LV_SCRLBAR_MODE_ON LV_SCROLLBAR_MODE_ON
|
2020-05-12 21:29:16 +02:00
|
|
|
#define LV_SCRLBAR_MODE_DRAG LV_SCROLLBAR_MODE_DRAG
|
|
|
|
#define LV_SCRLBAR_MODE_AUTO LV_SCROLLBAR_MODE_AUTO
|
|
|
|
#define LV_SCRLBAR_MODE_HIDE LV_SCROLLBAR_MODE_HIDE
|
|
|
|
#define LV_SCRLBAR_MODE_UNHIDE LV_SCROLLBAR_MODE_UNHIDE
|
|
|
|
|
|
|
|
|
|
|
|
static inline void lv_page_set_scrlbar_mode(lv_obj_t * page, lv_scrlbar_mode_t sb_mode)
|
|
|
|
{
|
|
|
|
lv_page_set_scrollbar_mode(page, sb_mode);
|
|
|
|
}
|
|
|
|
static inline lv_scrollbar_mode_t lv_page_get_scrlbar_mode(lv_obj_t * page)
|
|
|
|
{
|
|
|
|
return lv_page_get_scrollbar_mode(page);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline lv_obj_t * lv_page_get_scrl(lv_obj_t * page)
|
|
|
|
{
|
2020-06-16 12:03:32 +02:00
|
|
|
return lv_page_get_scrollable(page);
|
2020-05-12 21:29:16 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-06-26 20:31:20 +02:00
|
|
|
|
|
|
|
#endif /*LV_USE_API_EXTENSION_V6*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*---------------------
|
|
|
|
* V7.0 COMPATIBILITY
|
|
|
|
*--------------------*/
|
|
|
|
#if LV_USE_API_EXTENSION_V7
|
2020-06-12 06:26:59 -05:00
|
|
|
#if LV_USE_WIN
|
|
|
|
|
|
|
|
static inline lv_obj_t * lv_win_add_btn(lv_obj_t * win, const void * img_src)
|
|
|
|
{
|
2020-06-26 20:31:20 +02:00
|
|
|
return lv_win_add_btn_right(win, img_src);
|
2020-06-12 06:26:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2020-06-26 20:31:20 +02:00
|
|
|
#if LV_USE_CHART
|
|
|
|
static inline void lv_chart_set_range(lv_obj_t * chart, lv_coord_t ymin, lv_coord_t ymax)
|
|
|
|
{
|
|
|
|
lv_chart_set_y_range(chart, LV_CHART_AXIS_PRIMARY_Y, ymin, ymax);
|
|
|
|
}
|
|
|
|
#endif
|
2020-05-12 21:29:16 +02:00
|
|
|
|
2020-06-26 20:31:20 +02:00
|
|
|
#endif /*LV_USE_API_EXTENSION_V6*/
|
2019-11-01 11:09:56 +01:00
|
|
|
/**********************
|
|
|
|
* MACROS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /*LV_API_MAP_H*/
|