1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-21 06:53:01 +08:00
lvgl/src/lv_api_map.h

190 lines
4.1 KiB
C
Raw Normal View History

/**
* @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"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/*---------------------
* V6.0 COMPATIBILITY
*--------------------*/
#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-25 12:24:17 +01:00
#endif
#if LV_USE_DROPDOWN
2019-11-25 12:24:17 +01:00
static inline void lv_dropdown_set_draw_arrow(lv_obj_t * ddlist, bool en)
{
if(en) lv_dropdown_set_symbol(ddlist, LV_SYMBOL_DOWN);
else lv_dropdown_set_symbol(ddlist, NULL);
}
static inline bool lv_dropdown_get_draw_arrow(lv_obj_t * ddlist)
{
if(lv_dropdown_get_symbol(ddlist)) return true;
else return false;
}
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
#if LV_USE_PAGE
#define lv_scrlbar_mode_t lv_scrollbar_mode_t
#define LV_SCRLBAR_MODE_OFF LV_SCROLLBAR_MODE_OFF
#define LV_SCRLBAR_MODE_ON LV_SCRILLBAR_MODE_ON
#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)
{
return lv_page_get_scrllable(page);
}
#endif
#endif /*LV_USE_API_EXTENSION_V6*/
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_API_MAP_H*/