diff options
Diffstat (limited to 'apps/gui/list.h')
-rw-r--r-- | apps/gui/list.h | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/apps/gui/list.h b/apps/gui/list.h index fd553f381c..e47f260a1b 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2005 by Kévin FERRARE | 10 | * Copyright (C) 2005 by Kevin FERRARE |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
@@ -75,6 +75,9 @@ struct gui_list | |||
75 | 75 | ||
76 | struct screen * display; | 76 | struct screen * display; |
77 | int line_scroll_limit; | 77 | int line_scroll_limit; |
78 | /* defines wether the list should stop when reaching the top/bottom | ||
79 | * or should continue (by going to bottom/top) */ | ||
80 | bool limit_scroll; | ||
78 | }; | 81 | }; |
79 | 82 | ||
80 | /* | 83 | /* |
@@ -91,12 +94,12 @@ extern void gui_list_init(struct gui_list * gui_list, | |||
91 | ); | 94 | ); |
92 | 95 | ||
93 | /* | 96 | /* |
94 | * Sets the numburs of items the list can currently display | 97 | * Sets the numbers of items the list can currently display |
95 | * note that the list's context like the currently pointed item is resetted | 98 | * note that the list's context like the currently pointed item is resetted |
96 | * - gui_list : the list structure to initialize | 99 | * - gui_list : the list structure to initialize |
97 | * - nb_items : the numbers of items you want | 100 | * - nb_items : the numbers of items you want |
98 | */ | 101 | */ |
99 | extern void gui_list_set_nb_items(struct gui_list * gui_list, int nb_items); | 102 | extern inline void gui_list_set_nb_items(struct gui_list * gui_list, int nb_items); |
100 | 103 | ||
101 | /* | 104 | /* |
102 | * Puts the selection in the screen | 105 | * Puts the selection in the screen |
@@ -118,19 +121,11 @@ extern void gui_list_set_display(struct gui_list * gui_list, | |||
118 | struct screen * display); | 121 | struct screen * display); |
119 | 122 | ||
120 | /* | 123 | /* |
121 | * Gives the name of the selected object | ||
122 | * - gui_list : the list structure | ||
123 | * - buffer : a buffer which is filled with the name | ||
124 | */ | ||
125 | extern void gui_list_get_selected_item_name(struct gui_list * gui_list, | ||
126 | char *buffer); | ||
127 | |||
128 | /* | ||
129 | * Gives the position of the selected item | 124 | * Gives the position of the selected item |
130 | * - gui_list : the list structure | 125 | * - gui_list : the list structure |
131 | * Returns the position | 126 | * Returns the position |
132 | */ | 127 | */ |
133 | extern int gui_list_get_selected_item_position(struct gui_list * gui_list); | 128 | extern inline int gui_list_get_sel_pos(struct gui_list * gui_list); |
134 | 129 | ||
135 | /* | 130 | /* |
136 | * Selects an item in the list | 131 | * Selects an item in the list |
@@ -187,6 +182,15 @@ extern void gui_list_add_item(struct gui_list * gui_list); | |||
187 | */ | 182 | */ |
188 | extern void gui_list_del_item(struct gui_list * gui_list); | 183 | extern void gui_list_del_item(struct gui_list * gui_list); |
189 | 184 | ||
185 | /* | ||
186 | * Tells the list wether it should stop when reaching the top/bottom | ||
187 | * or should continue (by going to bottom/top) | ||
188 | * - gui_list : the list structure | ||
189 | * - scroll : | ||
190 | * - true : stops when reaching top/bottom | ||
191 | * - false : continues to go to bottom/top when reaching top/bottom | ||
192 | */ | ||
193 | extern inline void gui_list_limit_scroll(struct gui_list * gui_list, bool scroll); | ||
190 | 194 | ||
191 | /* | 195 | /* |
192 | * This part handles as many lists as there are connected screens | 196 | * This part handles as many lists as there are connected screens |
@@ -207,9 +211,8 @@ extern void gui_synclist_init(struct gui_synclist * lists, | |||
207 | char * (*callback_get_item_name)(int selected_item, char *buffer) | 211 | char * (*callback_get_item_name)(int selected_item, char *buffer) |
208 | ); | 212 | ); |
209 | extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items); | 213 | extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items); |
210 | extern void gui_synclist_get_selected_item_name(struct gui_synclist * lists, | 214 | |
211 | char *buffer); | 215 | extern int gui_synclist_get_sel_pos(struct gui_synclist * lists); |
212 | extern int gui_synclist_get_selected_item_position(struct gui_synclist * lists); | ||
213 | extern void gui_synclist_draw(struct gui_synclist * lists); | 216 | extern void gui_synclist_draw(struct gui_synclist * lists); |
214 | extern void gui_synclist_select_item(struct gui_synclist * lists, | 217 | extern void gui_synclist_select_item(struct gui_synclist * lists, |
215 | int item_number); | 218 | int item_number); |
@@ -221,6 +224,8 @@ extern void gui_synclist_select_previous_page(struct gui_synclist * lists, | |||
221 | enum screen_type screen); | 224 | enum screen_type screen); |
222 | extern void gui_synclist_add_item(struct gui_synclist * lists); | 225 | extern void gui_synclist_add_item(struct gui_synclist * lists); |
223 | extern void gui_synclist_del_item(struct gui_synclist * lists); | 226 | extern void gui_synclist_del_item(struct gui_synclist * lists); |
227 | extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll); | ||
228 | |||
224 | /* | 229 | /* |
225 | * Do the action implied by the given button, | 230 | * Do the action implied by the given button, |
226 | * returns true if something has been done, false otherwise | 231 | * returns true if something has been done, false otherwise |