summaryrefslogtreecommitdiff
path: root/apps/gui/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r--apps/gui/list.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c
index b1120aa794..ee4684233f 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -47,17 +47,14 @@
47 */ 47 */
48#define FRAMEDROP_TRIGGER 6 48#define FRAMEDROP_TRIGGER 6
49 49
50#ifdef HAVE_LCD_BITMAP
51static int offset_step = 16; /* pixels per screen scroll step */ 50static int offset_step = 16; /* pixels per screen scroll step */
52/* should lines scroll out of the screen */ 51/* should lines scroll out of the screen */
53static bool offset_out_of_view = false; 52static bool offset_out_of_view = false;
54#endif
55 53
56static void gui_list_select_at_offset(struct gui_synclist * gui_list, 54static void gui_list_select_at_offset(struct gui_synclist * gui_list,
57 int offset); 55 int offset);
58void list_draw(struct screen *display, struct gui_synclist *list); 56void list_draw(struct screen *display, struct gui_synclist *list);
59 57
60#ifdef HAVE_LCD_BITMAP
61static long last_dirty_tick; 58static long last_dirty_tick;
62static struct viewport parent[NB_SCREENS]; 59static struct viewport parent[NB_SCREENS];
63 60
@@ -92,23 +89,7 @@ static void list_init_viewports(struct gui_synclist *list)
92 } 89 }
93 list->dirty_tick = current_tick; 90 list->dirty_tick = current_tick;
94} 91}
95#else
96static struct viewport parent[NB_SCREENS] =
97{
98 [SCREEN_MAIN] =
99 {
100 .x = 0,
101 .y = 0,
102 .width = LCD_WIDTH,
103 .height = LCD_HEIGHT
104 },
105};
106
107#define list_init_viewports(a)
108#define list_is_dirty(a) false
109#endif
110 92
111#ifdef HAVE_LCD_BITMAP
112static int list_nb_lines(struct gui_synclist *list, enum screen_type screen) 93static int list_nb_lines(struct gui_synclist *list, enum screen_type screen)
113{ 94{
114 struct viewport *vp = list->parent[screen]; 95 struct viewport *vp = list->parent[screen];
@@ -148,13 +129,6 @@ void list_init_item_height(struct gui_synclist *list, enum screen_type screen)
148#endif 129#endif
149} 130}
150 131
151#else
152#define list_display_title(l, i) false
153#define list_get_nb_lines(list, screen) \
154 viewport_get_nb_lines((list)->parent[(screen)]);
155#define list_init_item_height(l, i)
156#endif
157
158/* 132/*
159 * Initializes a scrolling list 133 * Initializes a scrolling list
160 * - gui_list : the list structure to initialize 134 * - gui_list : the list structure to initialize
@@ -181,9 +155,7 @@ void gui_synclist_init(struct gui_synclist * gui_list,
181 FOR_NB_SCREENS(i) 155 FOR_NB_SCREENS(i)
182 { 156 {
183 gui_list->start_item[i] = 0; 157 gui_list->start_item[i] = 0;
184#ifdef HAVE_LCD_BITMAP
185 gui_list->offset_position[i] = 0; 158 gui_list->offset_position[i] = 0;
186#endif
187 if (list_parent) 159 if (list_parent)
188 gui_list->parent[i] = &list_parent[i]; 160 gui_list->parent[i] = &list_parent[i];
189 else 161 else
@@ -216,7 +188,6 @@ void gui_synclist_hide_selection_marker(struct gui_synclist * lists, bool hide)
216} 188}
217 189
218 190
219#ifdef HAVE_LCD_BITMAP
220int gui_list_get_item_offset(struct gui_synclist * gui_list, 191int gui_list_get_item_offset(struct gui_synclist * gui_list,
221 int item_width, 192 int item_width,
222 int text_pos, 193 int text_pos,
@@ -248,7 +219,6 @@ int gui_list_get_item_offset(struct gui_synclist * gui_list,
248 219
249 return item_offset; 220 return item_offset;
250} 221}
251#endif
252 222
253/* 223/*
254 * Force a full screen update. 224 * Force a full screen update.
@@ -264,9 +234,7 @@ void gui_synclist_draw(struct gui_synclist *gui_list)
264 } 234 }
265 FOR_NB_SCREENS(i) 235 FOR_NB_SCREENS(i)
266 { 236 {
267#ifdef HAVE_LCD_BITMAP
268 if (!skinlist_draw(&screens[i], gui_list)) 237 if (!skinlist_draw(&screens[i], gui_list))
269#endif
270 list_draw(&screens[i], gui_list); 238 list_draw(&screens[i], gui_list);
271 } 239 }
272} 240}
@@ -481,7 +449,6 @@ void gui_synclist_del_item(struct gui_synclist * gui_list)
481 } 449 }
482} 450}
483 451
484#ifdef HAVE_LCD_BITMAP
485void gui_list_screen_scroll_step(int ofs) 452void gui_list_screen_scroll_step(int ofs)
486{ 453{
487 offset_step = ofs; 454 offset_step = ofs;
@@ -491,7 +458,6 @@ void gui_list_screen_scroll_out_of_view(bool enable)
491{ 458{
492 offset_out_of_view = enable; 459 offset_out_of_view = enable;
493} 460}
494#endif /* HAVE_LCD_BITMAP */
495 461
496/* 462/*
497 * Set the title and title icon of the list. Setting title to NULL disables 463 * Set the title and title icon of the list. Setting title to NULL disables
@@ -502,22 +468,18 @@ void gui_synclist_set_title(struct gui_synclist * gui_list,
502{ 468{
503 gui_list->title = title; 469 gui_list->title = title;
504 gui_list->title_icon = icon; 470 gui_list->title_icon = icon;
505#ifdef HAVE_LCD_BITMAP
506 FOR_NB_SCREENS(i) 471 FOR_NB_SCREENS(i)
507 sb_set_title_text(title, icon, i); 472 sb_set_title_text(title, icon, i);
508#endif
509 send_event(GUI_EVENT_ACTIONUPDATE, (void*)1); 473 send_event(GUI_EVENT_ACTIONUPDATE, (void*)1);
510} 474}
511 475
512void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items) 476void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items)
513{ 477{
514 lists->nb_items = nb_items; 478 lists->nb_items = nb_items;
515#ifdef HAVE_LCD_BITMAP
516 FOR_NB_SCREENS(i) 479 FOR_NB_SCREENS(i)
517 { 480 {
518 lists->offset_position[i] = 0; 481 lists->offset_position[i] = 0;
519 } 482 }
520#endif
521} 483}
522int gui_synclist_get_nb_items(struct gui_synclist * lists) 484int gui_synclist_get_nb_items(struct gui_synclist * lists)
523{ 485{
@@ -576,7 +538,6 @@ void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll)
576 lists->limit_scroll = scroll; 538 lists->limit_scroll = scroll;
577} 539}
578 540
579#ifdef HAVE_LCD_BITMAP
580/* 541/*
581 * Makes all the item in the list scroll by one step to the right. 542 * Makes all the item in the list scroll by one step to the right.
582 * Should stop increasing the value when reaching the widest item value 543 * Should stop increasing the value when reaching the widest item value
@@ -608,7 +569,6 @@ static void gui_synclist_scroll_left(struct gui_synclist * lists)
608 lists->offset_position[i] = 0; 569 lists->offset_position[i] = 0;
609 } 570 }
610} 571}
611#endif /* HAVE_LCD_BITMAP */
612 572
613bool gui_synclist_keyclick_callback(int action, void* data) 573bool gui_synclist_keyclick_callback(int action, void* data)
614{ 574{
@@ -652,9 +612,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists,
652 int *actionptr, enum list_wrap wrap) 612 int *actionptr, enum list_wrap wrap)
653{ 613{
654 int action = *actionptr; 614 int action = *actionptr;
655#ifdef HAVE_LCD_BITMAP
656 static bool pgleft_allow_cancel = false; 615 static bool pgleft_allow_cancel = false;
657#endif
658 616
659#ifdef HAVE_WHEEL_ACCELERATION 617#ifdef HAVE_WHEEL_ACCELERATION
660 int next_item_modifier = button_apply_acceleration(get_action_data()); 618 int next_item_modifier = button_apply_acceleration(get_action_data());
@@ -753,7 +711,6 @@ bool gui_synclist_do_button(struct gui_synclist * lists,
753 *actionptr = ACTION_STD_NEXT; 711 *actionptr = ACTION_STD_NEXT;
754 return true; 712 return true;
755 713
756#ifdef HAVE_LCD_BITMAP
757 case ACTION_TREE_PGRIGHT: 714 case ACTION_TREE_PGRIGHT:
758 gui_synclist_scroll_right(lists); 715 gui_synclist_scroll_right(lists);
759 gui_synclist_draw(lists); 716 gui_synclist_draw(lists);
@@ -784,7 +741,6 @@ bool gui_synclist_do_button(struct gui_synclist * lists,
784 pgleft_allow_cancel = false; /* stop ACTION_TREE_PAGE_LEFT 741 pgleft_allow_cancel = false; /* stop ACTION_TREE_PAGE_LEFT
785 skipping to root */ 742 skipping to root */
786 return true; 743 return true;
787#endif
788/* for pgup / pgdown, we are obliged to have a different behaviour depending 744/* for pgup / pgdown, we are obliged to have a different behaviour depending
789 * on the screen for which the user pressed the key since for example, remote 745 * on the screen for which the user pressed the key since for example, remote
790 * and main screen doesn't have the same number of lines */ 746 * and main screen doesn't have the same number of lines */