mikroSDK Reference Manual
lv_fragment.h
Go to the documentation of this file.
1
6#ifndef LV_FRAGMENT_H
7#define LV_FRAGMENT_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
17
18#if LV_USE_FRAGMENT
19
21
22/*********************
23 * DEFINES
24 *********************/
25
26/**********************
27 * TYPEDEFS
28 **********************/
29
30typedef struct _lv_fragment_manager_t lv_fragment_manager_t;
31
32typedef struct _lv_fragment_t lv_fragment_t;
33typedef struct _lv_fragment_class_t lv_fragment_class_t;
34typedef struct _lv_fragment_managed_states_t lv_fragment_managed_states_t;
35
36struct _lv_fragment_t {
40 const lv_fragment_class_t * cls;
46 lv_fragment_managed_states_t * managed;
50 lv_fragment_manager_t * child_manager;
54 lv_obj_t * obj;
55
56};
57
58struct _lv_fragment_class_t {
64 void (*constructor_cb)(lv_fragment_t * self, void * args);
65
70 void (*destructor_cb)(lv_fragment_t * self);
71
76 void (*attached_cb)(lv_fragment_t * self);
77
82 void (*detached_cb)(lv_fragment_t * self);
83
90 lv_obj_t * (*create_obj_cb)(lv_fragment_t * self, lv_obj_t * container);
91
97 void (*obj_created_cb)(lv_fragment_t * self, lv_obj_t * obj);
98
105 void (*obj_will_delete_cb)(lv_fragment_t * self, lv_obj_t * obj);
106
112 void (*obj_deleted_cb)(lv_fragment_t * self, lv_obj_t * obj);
113
121 bool (*event_cb)(lv_fragment_t * self, int code, void * userdata);
122
126 size_t instance_size;
127};
128
132typedef struct _lv_fragment_managed_states_t {
136 const lv_fragment_class_t * cls;
140 lv_fragment_manager_t * manager;
144 lv_obj_t * const * container;
148 lv_fragment_t * instance;
152 bool obj_created;
156 bool destroying_obj;
160 bool in_stack;
161} lv_fragment_managed_states_t;
162
163/**********************
164 * GLOBAL PROTOTYPES
165 **********************/
166
172lv_fragment_manager_t * lv_fragment_manager_create(lv_fragment_t * parent);
173
178void lv_fragment_manager_del(lv_fragment_manager_t * manager);
179
184void lv_fragment_manager_create_obj(lv_fragment_manager_t * manager);
185
190void lv_fragment_manager_del_obj(lv_fragment_manager_t * manager);
191
198void lv_fragment_manager_add(lv_fragment_manager_t * manager, lv_fragment_t * fragment, lv_obj_t * const * container);
199
205void lv_fragment_manager_remove(lv_fragment_manager_t * manager, lv_fragment_t * fragment);
206
213void lv_fragment_manager_push(lv_fragment_manager_t * manager, lv_fragment_t * fragment, lv_obj_t * const * container);
214
220bool lv_fragment_manager_pop(lv_fragment_manager_t * manager);
221
228void lv_fragment_manager_replace(lv_fragment_manager_t * manager, lv_fragment_t * fragment,
229 lv_obj_t * const * container);
230
238bool lv_fragment_manager_send_event(lv_fragment_manager_t * manager, int code, void * userdata);
239
245size_t lv_fragment_manager_get_stack_size(lv_fragment_manager_t * manager);
246
252lv_fragment_t * lv_fragment_manager_get_top(lv_fragment_manager_t * manager);
253
260lv_fragment_t * lv_fragment_manager_find_by_container(lv_fragment_manager_t * manager, const lv_obj_t * container);
261
267lv_fragment_t * lv_fragment_manager_get_parent_fragment(lv_fragment_manager_t * manager);
268
269
277lv_fragment_t * lv_fragment_create(const lv_fragment_class_t * cls, void * args);
278
283void lv_fragment_del(lv_fragment_t * fragment);
284
290lv_fragment_manager_t * lv_fragment_get_manager(lv_fragment_t * fragment);
291
297lv_obj_t * const * lv_fragment_get_container(lv_fragment_t * fragment);
298
304lv_fragment_t * lv_fragment_get_parent(lv_fragment_t * fragment);
305
313lv_obj_t * lv_fragment_create_obj(lv_fragment_t * fragment, lv_obj_t * container);
314
320void lv_fragment_del_obj(lv_fragment_t * fragment);
321
326void lv_fragment_recreate_obj(lv_fragment_t * fragment);
327
328
329/**********************
330 * MACROS
331 **********************/
332
333#endif /*LV_USE_FRAGMENT*/
334
335#ifdef __cplusplus
336} /*extern "C"*/
337#endif
338
339#endif /*LV_FRAGMENT_H*/
Definition lv_obj.h:174