diff options
Diffstat (limited to 'apps/gui/list.h')
-rw-r--r-- | apps/gui/list.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/apps/gui/list.h b/apps/gui/list.h index 42a8677637..3e5b38e5b1 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -136,9 +136,9 @@ struct gui_list | |||
136 | * to a given item number | 136 | * to a given item number |
137 | * - callback_get_item_name : pointer to a function that associates a label | 137 | * - callback_get_item_name : pointer to a function that associates a label |
138 | * to a given item number | 138 | * to a given item number |
139 | * - data : extra data passed to the list callback | ||
139 | */ | 140 | */ |
140 | extern void gui_list_init(struct gui_list * gui_list, | 141 | extern void gui_list_init(struct gui_list * gui_list, |
141 | list_get_icon callback_get_item_icon, | ||
142 | list_get_name callback_get_item_name, | 142 | list_get_name callback_get_item_name, |
143 | void * data | 143 | void * data |
144 | ); | 144 | ); |
@@ -146,7 +146,7 @@ extern void gui_list_init(struct gui_list * gui_list, | |||
146 | /* | 146 | /* |
147 | * Sets the numbers of items the list can currently display | 147 | * Sets the numbers of items the list can currently display |
148 | * note that the list's context like the currently pointed item is resetted | 148 | * note that the list's context like the currently pointed item is resetted |
149 | * - gui_list : the list structure to initialize | 149 | * - gui_list : the list structure |
150 | * - nb_items : the numbers of items you want | 150 | * - nb_items : the numbers of items you want |
151 | */ | 151 | */ |
152 | #define gui_list_set_nb_items(gui_list, nb) \ | 152 | #define gui_list_set_nb_items(gui_list, nb) \ |
@@ -154,7 +154,7 @@ extern void gui_list_init(struct gui_list * gui_list, | |||
154 | 154 | ||
155 | /* | 155 | /* |
156 | * Returns the numbers of items currently in the list | 156 | * Returns the numbers of items currently in the list |
157 | * - gui_list : the list structure to initialize | 157 | * - gui_list : the list structure |
158 | */ | 158 | */ |
159 | #define gui_list_get_nb_items(gui_list) \ | 159 | #define gui_list_get_nb_items(gui_list) \ |
160 | (gui_list)->nb_items | 160 | (gui_list)->nb_items |
@@ -170,6 +170,14 @@ extern void gui_list_put_selection_in_screen(struct gui_list * gui_list, | |||
170 | bool put_from_end); | 170 | bool put_from_end); |
171 | 171 | ||
172 | /* | 172 | /* |
173 | * Sets the icon callback function | ||
174 | * - gui_list : the list structure | ||
175 | * - _callback : the callback function | ||
176 | */ | ||
177 | #define gui_list_set_icon_callback(gui_list, _callback) \ | ||
178 | (gui_list)->callback_get_item_icon=_callback | ||
179 | |||
180 | /* | ||
173 | * Attach the scrolling list to a screen | 181 | * Attach the scrolling list to a screen |
174 | * (The previous screen attachement is lost) | 182 | * (The previous screen attachement is lost) |
175 | * - gui_list : the list structure | 183 | * - gui_list : the list structure |
@@ -277,14 +285,14 @@ struct gui_synclist | |||
277 | 285 | ||
278 | extern void gui_synclist_init( | 286 | extern void gui_synclist_init( |
279 | struct gui_synclist * lists, | 287 | struct gui_synclist * lists, |
280 | list_get_icon callback_get_item_icon, | ||
281 | list_get_name callback_get_item_name, | 288 | list_get_name callback_get_item_name, |
282 | void * data | 289 | void * data |
283 | ); | 290 | ); |
284 | extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items); | 291 | extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items); |
285 | 292 | extern void gui_synclist_set_icon_callback(struct gui_synclist * lists, list_get_icon icon_callback); | |
286 | #define gui_synclist_get_nb_items(lists) \ | 293 | #define gui_synclist_get_nb_items(lists) \ |
287 | gui_list_get_nb_items(&((lists)->gui_list[0])) | 294 | gui_list_get_nb_items(&((lists)->gui_list[0])) |
295 | |||
288 | extern int gui_synclist_get_sel_pos(struct gui_synclist * lists); | 296 | extern int gui_synclist_get_sel_pos(struct gui_synclist * lists); |
289 | 297 | ||
290 | #define gui_synclist_get_sel_pos(lists) \ | 298 | #define gui_synclist_get_sel_pos(lists) \ |