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 #define LV_NO_TASK_READY        LV_NO_TIMER_READY
23 #define LV_INDEV_STATE_REL      LV_INDEV_STATE_RELEASED
24 #define LV_INDEV_STATE_PR       LV_INDEV_STATE_PRESSED
25 #define LV_OBJ_FLAG_SNAPABLE    LV_OBJ_FLAG_SNAPPABLE   /*Fixed typo*/
26 
27 /**********************
28  *      TYPEDEFS
29  **********************/
30 
31 /**********************
32  * GLOBAL PROTOTYPES
33  **********************/
34 
lv_task_handler(void)35 static inline LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_task_handler(void)
36 {
37     return lv_timer_handler();
38 }
39 
40 /**********************
41  *      MACROS
42  **********************/
43 
44 /**********************
45  * INLINE FUNCTIONS
46  **********************/
47 
48 /**
49  * Move the object to the foreground.
50  * It will look like if it was created as the last child of its parent.
51  * It also means it can cover any of the siblings.
52  * @param obj       pointer to an object
53  */
lv_obj_move_foreground(lv_obj_t * obj)54 static inline void lv_obj_move_foreground(lv_obj_t * obj)
55 {
56     lv_obj_t * parent = lv_obj_get_parent(obj);
57     lv_obj_move_to_index(obj, lv_obj_get_child_cnt(parent) - 1);
58 }
59 
60 /**
61  * Move the object to the background.
62  * It will look like if it was created as the first child of its parent.
63  * It also means any of the siblings can cover the object.
64  * @param obj       pointer to an object
65  */
lv_obj_move_background(lv_obj_t * obj)66 static inline void lv_obj_move_background(lv_obj_t * obj)
67 {
68     lv_obj_move_to_index(obj, 0);
69 }
70 
71 /**********************
72  * DEPRECATED FUNCTIONS
73  **********************/
74 
lv_obj_get_child_id(const struct _lv_obj_t * obj)75 static inline uint32_t lv_obj_get_child_id(const struct _lv_obj_t * obj)
76 {
77     LV_LOG_WARN("lv_obj_get_child_id(obj) is deprecated, please use lv_obj_get_index(obj).");
78     return lv_obj_get_index(obj);
79 }
80 
81 #ifdef __cplusplus
82 } /*extern "C"*/
83 #endif
84 
85 #endif /*LV_API_MAP_H*/
86