1 /**
2 * @file lv_api_map.h
3 *
4 */
5
6 #ifndef LV_API_MAP_H
7 #define LV_API_MAP_H
8
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12
13 /*********************
14 * INCLUDES
15 *********************/
16 #include "../lvgl.h"
17
18 /*********************
19 * DEFINES
20 *********************/
21
22 /**********************
23 * TYPEDEFS
24 **********************/
25
26 /**********************
27 * GLOBAL PROTOTYPES
28 **********************/
29
30 /*---------------------
31 * V6.0 COMPATIBILITY
32 *--------------------*/
33 #if LV_USE_API_EXTENSION_V6
34
lv_task_once(lv_task_t * task)35 static inline void lv_task_once(lv_task_t * task)
36 {
37 lv_task_set_repeat_count(task, 1);
38 }
39
40 #if LV_USE_CHECKBOX
41
42 #define lv_checkbox_set_static_text lv_checkbox_set_text_static
43
44 #endif
45
46 #if LV_USE_CHART
47
48 #define lv_chart_get_point_cnt lv_chart_get_point_count
49
50 #endif
51
52
53 #if LV_USE_DROPDOWN
54
lv_dropdown_set_draw_arrow(lv_obj_t * ddlist,bool en)55 static inline void lv_dropdown_set_draw_arrow(lv_obj_t * ddlist, bool en)
56 {
57 if(en) lv_dropdown_set_symbol(ddlist, LV_SYMBOL_DOWN);
58 else lv_dropdown_set_symbol(ddlist, NULL);
59 }
60
lv_dropdown_get_draw_arrow(lv_obj_t * ddlist)61 static inline bool lv_dropdown_get_draw_arrow(lv_obj_t * ddlist)
62 {
63 if(lv_dropdown_get_symbol(ddlist)) return true;
64 else return false;
65 }
66
67 #define lv_dropdown_set_static_options lv_dropdown_set_options_static
68
69 #endif
70
71 #if LV_USE_BAR
72
73 /**
74 * Make the bar symmetric to zero. The indicator will grow from zero instead of the minimum
75 * position.
76 * @param bar pointer to a bar object
77 * @param en true: enable disable symmetric behavior; false: disable
78 * @deprecated As of v7.0, you should use `lv_bar_set_type` instead.
79 */
lv_bar_set_sym(lv_obj_t * bar,bool en)80 static inline void lv_bar_set_sym(lv_obj_t * bar, bool en)
81 {
82 if(en)
83 lv_bar_set_type(bar, LV_BAR_TYPE_SYMMETRICAL);
84 else
85 lv_bar_set_type(bar, LV_BAR_TYPE_NORMAL);
86 }
87
88 /**
89 * Get whether the bar is symmetric or not.
90 * @param bar pointer to a bar object
91 * @return true: symmetric is enabled; false: disable
92 * @deprecated As of v7.0, you should use `lv_bar_get_type` instead.
93 */
lv_bar_get_sym(lv_obj_t * bar)94 static inline bool lv_bar_get_sym(lv_obj_t * bar)
95 {
96 return lv_bar_get_type(bar) == LV_BAR_TYPE_SYMMETRICAL;
97 }
98
99 #endif
100
101 #if LV_USE_LABEL
102
103 #define lv_label_set_static_text lv_label_set_text_static
104
105 #endif
106
107 #if LV_USE_SLIDER
108
109 /**
110 * Make the slider symmetric to zero. The indicator will grow from zero instead of the minimum
111 * position.
112 * @param slider pointer to a bar object
113 * @param en true: enable disable symmetric behavior; false: disable
114 * @deprecated As of v7.0, you should use `lv_slider_set_type` instead.
115 */
lv_slider_set_sym(lv_obj_t * slider,bool en)116 static inline void lv_slider_set_sym(lv_obj_t * slider, bool en)
117 {
118 lv_bar_set_sym(slider, en);
119 }
120
121 /**
122 * Get whether the slider is symmetric or not.
123 * @param slider pointer to a slider object
124 * @return true: symmetric is enabled; false: disable
125 * @deprecated As of v7.0, you should use `lv_slider_get_type` instead.
126 */
lv_slider_get_sym(lv_obj_t * slider)127 static inline bool lv_slider_get_sym(lv_obj_t * slider)
128 {
129 return lv_bar_get_sym(slider);
130 }
131
132 #endif
133
134 #if LV_USE_ROLLER
135
136 /**
137 * Set a fixed width for the roller.
138 * @param roller pointer to a roller object
139 * @param w width
140 * @deprecated As of v7.0, you should use `lv_roller_set_auto_fit` and set the width normally instead.
141 */
lv_roller_set_fix_width(lv_obj_t * roller,lv_coord_t w)142 static inline void lv_roller_set_fix_width(lv_obj_t * roller, lv_coord_t w)
143 {
144 lv_roller_set_auto_fit(roller, false);
145 lv_obj_set_width(roller, w);
146 }
147
148
149 #endif
150
151
152 #if LV_USE_PAGE
153 #define lv_scrlbar_mode_t lv_scrollbar_mode_t
154
155 #define LV_SCRLBAR_MODE_OFF LV_SCROLLBAR_MODE_OFF
156 #define LV_SCRLBAR_MODE_ON LV_SCROLLBAR_MODE_ON
157 #define LV_SCRLBAR_MODE_DRAG LV_SCROLLBAR_MODE_DRAG
158 #define LV_SCRLBAR_MODE_AUTO LV_SCROLLBAR_MODE_AUTO
159 #define LV_SCRLBAR_MODE_HIDE LV_SCROLLBAR_MODE_HIDE
160 #define LV_SCRLBAR_MODE_UNHIDE LV_SCROLLBAR_MODE_UNHIDE
161
162
lv_page_set_scrlbar_mode(lv_obj_t * page,lv_scrlbar_mode_t sb_mode)163 static inline void lv_page_set_scrlbar_mode(lv_obj_t * page, lv_scrlbar_mode_t sb_mode)
164 {
165 lv_page_set_scrollbar_mode(page, sb_mode);
166 }
lv_page_get_scrlbar_mode(lv_obj_t * page)167 static inline lv_scrollbar_mode_t lv_page_get_scrlbar_mode(lv_obj_t * page)
168 {
169 return lv_page_get_scrollbar_mode(page);
170 }
171
172
lv_page_get_scrl(lv_obj_t * page)173 static inline lv_obj_t * lv_page_get_scrl(lv_obj_t * page)
174 {
175 return lv_page_get_scrollable(page);
176 }
177 #endif
178
179
180 #endif /*LV_USE_API_EXTENSION_V6*/
181
182
183
184
185 /*---------------------
186 * V7.0 COMPATIBILITY
187 *--------------------*/
188 #if LV_USE_API_EXTENSION_V7
189 #if LV_USE_WIN
190
lv_win_add_btn(lv_obj_t * win,const void * img_src)191 static inline lv_obj_t * lv_win_add_btn(lv_obj_t * win, const void * img_src)
192 {
193 return lv_win_add_btn_right(win, img_src);
194 }
195
196 #endif
197
198 #if LV_USE_CHART
lv_chart_set_range(lv_obj_t * chart,lv_coord_t ymin,lv_coord_t ymax)199 static inline void lv_chart_set_range(lv_obj_t * chart, lv_coord_t ymin, lv_coord_t ymax)
200 {
201 lv_chart_set_y_range(chart, LV_CHART_AXIS_PRIMARY_Y, ymin, ymax);
202 }
203
204
lv_chart_clear_serie(lv_obj_t * chart,lv_chart_series_t * series)205 static inline void lv_chart_clear_serie(lv_obj_t * chart, lv_chart_series_t * series)
206 {
207 lv_chart_clear_series(chart, series);
208 }
209
210 #endif
211
lv_obj_align_origo(lv_obj_t * obj,const lv_obj_t * base,lv_align_t align,lv_coord_t x_ofs,lv_coord_t y_ofs)212 static inline void lv_obj_align_origo(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs,
213 lv_coord_t y_ofs)
214 {
215 lv_obj_align_mid(obj, base, align, x_ofs, y_ofs);
216 }
217
lv_obj_align_origo_x(lv_obj_t * obj,const lv_obj_t * base,lv_align_t align,lv_coord_t x_ofs)218 static inline void lv_obj_align_origo_x(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs)
219 {
220 lv_obj_align_mid_y(obj, base, align, x_ofs);
221 }
222
lv_obj_align_origo_y(lv_obj_t * obj,const lv_obj_t * base,lv_align_t align,lv_coord_t y_ofs)223 static inline void lv_obj_align_origo_y(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t y_ofs)
224 {
225 lv_obj_align_mid_y(obj, base, align, y_ofs);
226 }
227
228 #endif /*LV_USE_API_EXTENSION_V6*/
229 /**********************
230 * MACROS
231 **********************/
232
233 #ifdef __cplusplus
234 } /* extern "C" */
235 #endif
236
237 #endif /*LV_API_MAP_H*/
238