diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-12-17 02:37:21 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-12-17 02:37:21 +0000 |
commit | f5ec3e49e0687eda7b9059942c23321f9878becf (patch) | |
tree | 7961798bfa368d0e0d191317b24ff0918eb981ca /apps/gui/list.h | |
parent | f6039466fb275f55be16113bbbf46872f90862c8 (diff) | |
download | rockbox-f5ec3e49e0687eda7b9059942c23321f9878becf.tar.gz rockbox-f5ec3e49e0687eda7b9059942c23321f9878becf.zip |
remove the duplicated gui_list struct and only duplicate the members which are actually different on each screen. should translate to a smaller bin and easier code (users shouldnt notice any difference)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15947 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/list.h')
-rw-r--r-- | apps/gui/list.h | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/apps/gui/list.h b/apps/gui/list.h index 742e30dbaa..3bd3d25c49 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -82,7 +82,7 @@ typedef int list_speak_item(int selected_item, void * data); | |||
82 | typedef int list_get_color(int selected_item, void * data); | 82 | typedef int list_get_color(int selected_item, void * data); |
83 | #endif | 83 | #endif |
84 | 84 | ||
85 | struct gui_list | 85 | struct gui_synclist |
86 | { | 86 | { |
87 | /* defines wether the list should stop when reaching the top/bottom | 87 | /* defines wether the list should stop when reaching the top/bottom |
88 | * or should continue (by going to bottom/top) */ | 88 | * or should continue (by going to bottom/top) */ |
@@ -93,15 +93,15 @@ struct gui_list | |||
93 | 93 | ||
94 | int nb_items; | 94 | int nb_items; |
95 | int selected_item; | 95 | int selected_item; |
96 | int start_item; /* the item that is displayed at the top of the screen */ | 96 | int start_item[NB_SCREENS]; /* the item that is displayed at the top of the screen */ |
97 | /* the number of lines that are selected at the same time */ | 97 | /* the number of lines that are selected at the same time */ |
98 | int selected_size; | 98 | int selected_size; |
99 | /* These are used to calculate how much of the screen content we need | 99 | /* These are used to calculate how much of the screen content we need |
100 | to redraw. */ | 100 | to redraw. */ |
101 | int last_displayed_selected_item; | 101 | int last_displayed_selected_item; |
102 | int last_displayed_start_item; | 102 | int last_displayed_start_item[NB_SCREENS]; |
103 | #ifdef HAVE_LCD_BITMAP | 103 | #ifdef HAVE_LCD_BITMAP |
104 | int offset_position; /* the list's screen scroll placement in pixels */ | 104 | int offset_position[NB_SCREENS]; /* the list's screen scroll placement in pixels */ |
105 | #endif | 105 | #endif |
106 | /* Cache the width of the title string in pixels/characters */ | 106 | /* Cache the width of the title string in pixels/characters */ |
107 | int title_width; | 107 | int title_width; |
@@ -111,7 +111,6 @@ struct gui_list | |||
111 | list_get_name *callback_get_item_name; | 111 | list_get_name *callback_get_item_name; |
112 | list_speak_item *callback_speak_item; | 112 | list_speak_item *callback_speak_item; |
113 | 113 | ||
114 | struct screen * display; | ||
115 | /* The data that will be passed to the callback function YOU implement */ | 114 | /* The data that will be passed to the callback function YOU implement */ |
116 | void * data; | 115 | void * data; |
117 | /* The optional title, set to NULL for none */ | 116 | /* The optional title, set to NULL for none */ |
@@ -195,19 +194,6 @@ extern void gui_list_screen_scroll_out_of_view(bool enable); | |||
195 | #define gui_list_limit_scroll(gui_list, scroll) \ | 194 | #define gui_list_limit_scroll(gui_list, scroll) \ |
196 | (gui_list)->limit_scroll=scroll | 195 | (gui_list)->limit_scroll=scroll |
197 | 196 | ||
198 | /* | ||
199 | * This part handles as many lists as there are connected screens | ||
200 | * (the api is similar to the ones above) | ||
201 | * The lists on the screens are synchronized ; | ||
202 | * theirs items and selected items are the same, but of course, | ||
203 | * they can be displayed on screens with different sizes | ||
204 | * The final aim is to let the programmer handle many lists in one | ||
205 | * function call and make its code independant from the number of screens | ||
206 | */ | ||
207 | struct gui_synclist | ||
208 | { | ||
209 | struct gui_list gui_list[NB_SCREENS]; | ||
210 | }; | ||
211 | 197 | ||
212 | extern void gui_synclist_init( | 198 | extern void gui_synclist_init( |
213 | struct gui_synclist * lists, | 199 | struct gui_synclist * lists, |