summaryrefslogtreecommitdiff
path: root/apps/gui/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/list.h')
-rw-r--r--apps/gui/list.h65
1 files changed, 5 insertions, 60 deletions
diff --git a/apps/gui/list.h b/apps/gui/list.h
index 3bd3d25c49..48dd736d00 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -123,58 +123,9 @@ struct gui_synclist
123 int title_color; 123 int title_color;
124 list_get_color *callback_get_item_color; 124 list_get_color *callback_get_item_color;
125#endif 125#endif
126 struct viewport *parent[NB_SCREENS];
126}; 127};
127 128
128/*
129 * Sets the numbers of items the list can currently display
130 * note that the list's context like the currently pointed item is resetted
131 * - gui_list : the list structure
132 * - nb_items : the numbers of items you want
133 */
134#define gui_list_set_nb_items(gui_list, nb) \
135 (gui_list)->nb_items = nb
136
137/*
138 * Returns the numbers of items currently in the list
139 * - gui_list : the list structure
140 */
141#define gui_list_get_nb_items(gui_list) \
142 (gui_list)->nb_items
143
144/*
145 * Sets the icon callback function
146 * - gui_list : the list structure
147 * - _callback : the callback function
148 */
149#define gui_list_set_icon_callback(gui_list, _callback) \
150 (gui_list)->callback_get_item_icon=_callback
151
152/*
153 * Sets the voice callback function
154 * - gui_list : the list structure
155 * - _callback : the callback function
156 */
157#define gui_list_set_voice_callback(gui_list, _callback) \
158 (gui_list)->callback_speak_item=_callback
159
160#ifdef HAVE_LCD_COLOR
161/*
162 * Sets the color callback function
163 * - gui_list : the list structure
164 * - _callback : the callback function
165 */
166#define gui_list_set_color_callback(gui_list, _callback) \
167 (gui_list)->callback_get_item_color=_callback
168#endif
169
170/*
171 * Gives the position of the selected item
172 * - gui_list : the list structure
173 * Returns the position
174 */
175#define gui_list_get_sel_pos(gui_list) \
176 (gui_list)->selected_item
177
178 129
179#ifdef HAVE_LCD_BITMAP 130#ifdef HAVE_LCD_BITMAP
180/* parse global setting to static int */ 131/* parse global setting to static int */
@@ -183,17 +134,8 @@ extern void gui_list_screen_scroll_step(int ofs);
183/* parse global setting to static bool */ 134/* parse global setting to static bool */
184extern void gui_list_screen_scroll_out_of_view(bool enable); 135extern void gui_list_screen_scroll_out_of_view(bool enable);
185#endif /* HAVE_LCD_BITMAP */ 136#endif /* HAVE_LCD_BITMAP */
186/*
187 * Tells the list wether it should stop when reaching the top/bottom
188 * or should continue (by going to bottom/top)
189 * - gui_list : the list structure
190 * - scroll :
191 * - true : stops when reaching top/bottom
192 * - false : continues to go to bottom/top when reaching top/bottom
193 */
194#define gui_list_limit_scroll(gui_list, scroll) \
195 (gui_list)->limit_scroll=scroll
196 137
138void list_init_viewports(void);
197 139
198extern void gui_synclist_init( 140extern void gui_synclist_init(
199 struct gui_synclist * lists, 141 struct gui_synclist * lists,
@@ -205,6 +147,9 @@ extern void gui_synclist_init(
205extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items); 147extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items);
206extern void gui_synclist_set_icon_callback(struct gui_synclist * lists, list_get_icon icon_callback); 148extern void gui_synclist_set_icon_callback(struct gui_synclist * lists, list_get_icon icon_callback);
207extern void gui_synclist_set_voice_callback(struct gui_synclist * lists, list_speak_item voice_callback); 149extern void gui_synclist_set_voice_callback(struct gui_synclist * lists, list_speak_item voice_callback);
150#ifdef HAVE_LCD_COLOR
151extern void gui_synclist_set_color_callback(struct gui_synclist * lists, list_get_color color_callback);
152#endif
208extern void gui_synclist_speak_item(struct gui_synclist * lists); 153extern void gui_synclist_speak_item(struct gui_synclist * lists);
209extern int gui_synclist_get_nb_items(struct gui_synclist * lists); 154extern int gui_synclist_get_nb_items(struct gui_synclist * lists);
210 155