1 /**
2  * @file lv_observer_private.h
3  *
4  */
5 
6 #ifndef LV_OBSERVER_PRIVATE_H
7 #define LV_OBSERVER_PRIVATE_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 
17 #include "lv_observer.h"
18 
19 #if LV_USE_OBSERVER
20 
21 /*********************
22  *      DEFINES
23  *********************/
24 
25 /**********************
26  *      TYPEDEFS
27  **********************/
28 
29 /**
30  * The observer object: a descriptor returned when subscribing LVGL widgets to subjects
31  */
32 struct _lv_observer_t {
33     lv_subject_t * subject;             /**< The observed value */
34     lv_observer_cb_t cb;                /**< Callback that should be called when the value changes*/
35     void * target;                      /**< A target for the observer, e.g. a widget or style*/
36     void * user_data;                   /**< Additional parameter supplied when subscribing*/
37     uint32_t auto_free_user_data : 1;   /**< Automatically free user data when the observer is removed */
38     uint32_t notified : 1;              /**< Mark if this observer was already notified*/
39     uint32_t for_obj : 1;               /**< `target` is an `lv_obj_t *`*/
40 };
41 
42 
43 /**********************
44  * GLOBAL PROTOTYPES
45  **********************/
46 
47 /**********************
48  *      MACROS
49  **********************/
50 
51 #endif /* LV_USE_OBSERVER */
52 
53 #ifdef __cplusplus
54 } /*extern "C"*/
55 #endif
56 
57 #endif /*LV_OBSERVER_PRIVATE_H*/
58