summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-09-19 11:10:54 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-10-02 09:21:25 -0400
commit9ce5b2a2eda5c7101898476adaa3533e0ba5db82 (patch)
treefacbfe9721d907b1a92f2b113b262374c6e2917e
parentc1d75a6bcb30260eba288f643261c4a57959f45f (diff)
downloadrockbox-9ce5b2a2eda5c7101898476adaa3533e0ba5db82.tar.gz
rockbox-9ce5b2a2eda5c7101898476adaa3533e0ba5db82.zip
gui: Remove show/hide selection option in lists
The implementation of the "show_selection_marker" option in lists isn't great. It's a cosmetic option used to hide the selection, but it causes the list to do funny things to the selected_item and doesn't play nice with voiced menus, since these rely on the selection to determine what item is spoken. There are only two user-facing lists that use the option, the "Rockbox Info" screen and a menu in the superdom plugin. The rest are debug screens, and cosmetics don't matter much there. Given how little used the option is, and its issues, removing it seems reasonable. Change-Id: I2c70b3e4c74ff3cc6dbac46366a371d271dd2d58
-rw-r--r--apps/debug_menu.c13
-rw-r--r--apps/gui/bitmap/list-skinned.c3
-rw-r--r--apps/gui/bitmap/list.c8
-rw-r--r--apps/gui/list.c45
-rw-r--r--apps/gui/list.h5
-rw-r--r--apps/menus/main_menu.c3
-rw-r--r--apps/plugin.c27
-rw-r--r--apps/plugin.h33
-rw-r--r--apps/plugins/lrcplayer.c1
-rw-r--r--apps/plugins/superdom.c1
10 files changed, 38 insertions, 101 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 1abeac2622..b034f25df0 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -227,7 +227,6 @@ static bool dbg_os(void)
227 227
228 simplelist_info_init(&info, IF_COP("Core and ") "Stack usage:", 228 simplelist_info_init(&info, IF_COP("Core and ") "Stack usage:",
229 MAXTHREADS IF_COP( + NUM_CORES ), &xoffset); 229 MAXTHREADS IF_COP( + NUM_CORES ), &xoffset);
230 info.hide_selection = true;
231 info.scroll_all = false; 230 info.scroll_all = false;
232 info.action_callback = dbg_threads_action_callback; 231 info.action_callback = dbg_threads_action_callback;
233 info.get_name = threads_getname; 232 info.get_name = threads_getname;
@@ -341,7 +340,6 @@ static bool dbg_cpuinfo(void)
341 info.get_name = get_cpuinfo; 340 info.get_name = get_cpuinfo;
342 info.action_callback = cpuinfo_cb; 341 info.action_callback = cpuinfo_cb;
343 info.timeout = HZ; 342 info.timeout = HZ;
344 info.hide_selection = true;
345 info.scroll_all = true; 343 info.scroll_all = true;
346 return simplelist_show_list(&info); 344 return simplelist_show_list(&info);
347} 345}
@@ -568,7 +566,6 @@ static bool dbg_partitions(void)
568 struct simplelist_info info; 566 struct simplelist_info info;
569 simplelist_info_init(&info, "Partition Info", NUM_DRIVES * 4, NULL); 567 simplelist_info_init(&info, "Partition Info", NUM_DRIVES * 4, NULL);
570 info.selection_size = 2; 568 info.selection_size = 2;
571 info.hide_selection = true;
572 info.scroll_all = true; 569 info.scroll_all = true;
573 info.get_name = dbg_partitions_getname; 570 info.get_name = dbg_partitions_getname;
574 return simplelist_show_list(&info); 571 return simplelist_show_list(&info);
@@ -1722,7 +1719,6 @@ static bool dbg_ata_smart(void)
1722 struct simplelist_info info; 1719 struct simplelist_info info;
1723 simplelist_info_init(&info, "S.M.A.R.T. Data [CONTEXT to dump]", 1, NULL); 1720 simplelist_info_init(&info, "S.M.A.R.T. Data [CONTEXT to dump]", 1, NULL);
1724 info.action_callback = ata_smart_callback; 1721 info.action_callback = ata_smart_callback;
1725 info.hide_selection = true;
1726 info.scroll_all = true; 1722 info.scroll_all = true;
1727 return simplelist_show_list(&info); 1723 return simplelist_show_list(&info);
1728} 1724}
@@ -1776,7 +1772,6 @@ static bool dbg_disk_info(void)
1776 info.title = title; 1772 info.title = title;
1777#endif 1773#endif
1778 info.action_callback = disk_callback; 1774 info.action_callback = disk_callback;
1779 info.hide_selection = true;
1780 info.scroll_all = true; 1775 info.scroll_all = true;
1781 return simplelist_show_list(&info); 1776 return simplelist_show_list(&info);
1782} 1777}
@@ -1845,7 +1840,6 @@ static bool dbg_dircache_info(void)
1845 int syncbuild = 0; 1840 int syncbuild = 0;
1846 simplelist_info_init(&info, "Dircache Info", 8, &syncbuild); 1841 simplelist_info_init(&info, "Dircache Info", 8, &syncbuild);
1847 info.action_callback = dircache_callback; 1842 info.action_callback = dircache_callback;
1848 info.hide_selection = true;
1849 info.scroll_all = true; 1843 info.scroll_all = true;
1850 return simplelist_show_list(&info); 1844 return simplelist_show_list(&info);
1851} 1845}
@@ -1903,7 +1897,6 @@ static bool dbg_tagcache_info(void)
1903 struct simplelist_info info; 1897 struct simplelist_info info;
1904 simplelist_info_init(&info, "Database Info", 8, NULL); 1898 simplelist_info_init(&info, "Database Info", 8, NULL);
1905 info.action_callback = database_callback; 1899 info.action_callback = database_callback;
1906 info.hide_selection = true;
1907 info.scroll_all = true; 1900 info.scroll_all = true;
1908 1901
1909 /* Don't do nonblock here, must give enough processing time 1902 /* Don't do nonblock here, must give enough processing time
@@ -2176,7 +2169,6 @@ static bool dbg_fm_radio(void)
2176 radio_hardware_present() ? "yes" : "no"); 2169 radio_hardware_present() ? "yes" : "no");
2177 2170
2178 info.action_callback = radio_hardware_present()?radio_callback : NULL; 2171 info.action_callback = radio_hardware_present()?radio_callback : NULL;
2179 info.hide_selection = true;
2180 return simplelist_show_list(&info); 2172 return simplelist_show_list(&info);
2181} 2173}
2182#endif /* CONFIG_TUNER */ 2174#endif /* CONFIG_TUNER */
@@ -2448,7 +2440,6 @@ static bool dbg_talk(void)
2448 else 2440 else
2449 simplelist_info_init(&list, "Voice Information:", 2, &data); 2441 simplelist_info_init(&list, "Voice Information:", 2, &data);
2450 list.scroll_all = true; 2442 list.scroll_all = true;
2451 list.hide_selection = true;
2452 list.timeout = HZ; 2443 list.timeout = HZ;
2453 list.get_name = dbg_talk_get_name; 2444 list.get_name = dbg_talk_get_name;
2454 2445
@@ -2488,7 +2479,6 @@ static bool dbg_isp1583(void)
2488 isp1583.scroll_all = true; 2479 isp1583.scroll_all = true;
2489 simplelist_info_init(&isp1583, "ISP1583", dbg_usb_num_items(), NULL); 2480 simplelist_info_init(&isp1583, "ISP1583", dbg_usb_num_items(), NULL);
2490 isp1583.timeout = HZ/100; 2481 isp1583.timeout = HZ/100;
2491 isp1583.hide_selection = true;
2492 isp1583.get_name = dbg_usb_item; 2482 isp1583.get_name = dbg_usb_item;
2493 isp1583.action_callback = isp1583_action_callback; 2483 isp1583.action_callback = isp1583_action_callback;
2494 return simplelist_show_list(&isp1583); 2484 return simplelist_show_list(&isp1583);
@@ -2514,7 +2504,6 @@ static bool dbg_pic(void)
2514 pic.scroll_all = true; 2504 pic.scroll_all = true;
2515 simplelist_info_init(&pic, "PIC", pic_dbg_num_items(), NULL); 2505 simplelist_info_init(&pic, "PIC", pic_dbg_num_items(), NULL);
2516 pic.timeout = HZ/100; 2506 pic.timeout = HZ/100;
2517 pic.hide_selection = true;
2518 pic.get_name = pic_dbg_item; 2507 pic.get_name = pic_dbg_item;
2519 pic.action_callback = pic_action_callback; 2508 pic.action_callback = pic_action_callback;
2520 return simplelist_show_list(&pic); 2509 return simplelist_show_list(&pic);
@@ -2533,7 +2522,6 @@ static bool dbg_skin_engine(void)
2533#endif 2522#endif
2534 simplelist_info_init(&info, "Skin engine usage", 0, NULL); 2523 simplelist_info_init(&info, "Skin engine usage", 0, NULL);
2535 simplelist_set_line_count(0); 2524 simplelist_set_line_count(0);
2536 info.hide_selection = true;
2537 FOR_NB_SCREENS(j) { 2525 FOR_NB_SCREENS(j) {
2538#if NB_SCREENS > 1 2526#if NB_SCREENS > 1
2539 simplelist_addline("%s display:", 2527 simplelist_addline("%s display:",
@@ -2612,7 +2600,6 @@ static bool dbg_boot_data(void)
2612 boot_data.payload[i+1], boot_data.payload[i+2], boot_data.payload[i+3]); 2600 boot_data.payload[i+1], boot_data.payload[i+2], boot_data.payload[i+3]);
2613 } 2601 }
2614 2602
2615 info.hide_selection = true;
2616 return simplelist_show_list(&info); 2603 return simplelist_show_list(&info);
2617} 2604}
2618#endif /* defined(HAVE_BOOTDATA) && !defined(SIMULATOR) */ 2605#endif /* defined(HAVE_BOOTDATA) && !defined(SIMULATOR) */
diff --git a/apps/gui/bitmap/list-skinned.c b/apps/gui/bitmap/list-skinned.c
index a67ac8cb0a..bebff821f8 100644
--- a/apps/gui/bitmap/list-skinned.c
+++ b/apps/gui/bitmap/list-skinned.c
@@ -213,8 +213,7 @@ bool skinlist_draw(struct screen *display, struct gui_synclist *list)
213 if (list_start_item+cur_line+1 > list->nb_items) 213 if (list_start_item+cur_line+1 > list->nb_items)
214 break; 214 break;
215 current_drawing_line = list_start_item+cur_line; 215 current_drawing_line = list_start_item+cur_line;
216 is_selected = list->show_selection_marker && 216 is_selected = list_start_item+cur_line == list->selected_item;
217 list_start_item+cur_line == list->selected_item;
218 217
219 for (viewport = SKINOFFSETTOPTR(get_skin_buffer(wps.data), listcfg[screen]->data->tree); 218 for (viewport = SKINOFFSETTOPTR(get_skin_buffer(wps.data), listcfg[screen]->data->tree);
220 viewport; 219 viewport;
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index b2987e9853..ca58d713d0 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -196,10 +196,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
196 const int list_start_item = list->start_item[screen]; 196 const int list_start_item = list->start_item[screen];
197 const bool scrollbar_in_left = (list->scrollbar == SCROLLBAR_LEFT); 197 const bool scrollbar_in_left = (list->scrollbar == SCROLLBAR_LEFT);
198 const bool scrollbar_in_right = (list->scrollbar == SCROLLBAR_RIGHT); 198 const bool scrollbar_in_right = (list->scrollbar == SCROLLBAR_RIGHT);
199 199 const bool show_cursor = (list->cursor_style == SYNCLIST_CURSOR_NOSTYLE);
200 const bool show_cursor = list->show_selection_marker &&
201 (list->cursor_style == SYNCLIST_CURSOR_NOSTYLE);
202
203 const bool have_icons = list->callback_get_item_icon && list->show_icons; 200 const bool have_icons = list->callback_get_item_icon && list->show_icons;
204 201
205 struct viewport *parent = (list->parent[screen]); 202 struct viewport *parent = (list->parent[screen]);
@@ -365,8 +362,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
365 !hide_selection && 362 !hide_selection &&
366#endif 363#endif
367 i >= list->selected_item 364 i >= list->selected_item
368 && i < list->selected_item + list->selected_size 365 && i < list->selected_item + list->selected_size)
369 && list->show_selection_marker)
370 {/* The selected item must be displayed scrolling */ 366 {/* The selected item must be displayed scrolling */
371#ifdef HAVE_LCD_COLOR 367#ifdef HAVE_LCD_COLOR
372 if (list->selection_color) 368 if (list->selection_color)
diff --git a/apps/gui/list.c b/apps/gui/list.c
index df5df22ca1..98e9fe0ada 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -191,7 +191,6 @@ void gui_synclist_init(struct gui_synclist * gui_list,
191 191
192 gui_list->scheduled_talk_tick = gui_list->last_talked_tick = 0; 192 gui_list->scheduled_talk_tick = gui_list->last_talked_tick = 0;
193 gui_list->dirty_tick = current_tick; 193 gui_list->dirty_tick = current_tick;
194 gui_list->show_selection_marker = true;
195 194
196#ifdef HAVE_LCD_COLOR 195#ifdef HAVE_LCD_COLOR
197 gui_list->title_color = -1; 196 gui_list->title_color = -1;
@@ -200,13 +199,6 @@ void gui_synclist_init(struct gui_synclist * gui_list,
200#endif 199#endif
201} 200}
202 201
203/* this toggles the selection bar or cursor */
204void gui_synclist_hide_selection_marker(struct gui_synclist * lists, bool hide)
205{
206 lists->show_selection_marker = !hide;
207}
208
209
210int gui_list_get_item_offset(struct gui_synclist * gui_list, 202int gui_list_get_item_offset(struct gui_synclist * gui_list,
211 int item_width, 203 int item_width,
212 int text_pos, 204 int text_pos,
@@ -269,11 +261,7 @@ static void gui_list_put_selection_on_screen(struct gui_synclist * gui_list,
269 const int scroll_limit_up = (nb_lines < gui_list->selected_size+2 ? 0:1); 261 const int scroll_limit_up = (nb_lines < gui_list->selected_size+2 ? 0:1);
270 const int scroll_limit_down = (scroll_limit_up+gui_list->selected_size); 262 const int scroll_limit_down = (scroll_limit_up+gui_list->selected_size);
271 263
272 if (gui_list->show_selection_marker == false) 264 if (gui_list->selected_size >= nb_lines)
273 {
274 new_start_item = gui_list->selected_item;
275 }
276 else if (gui_list->selected_size >= nb_lines)
277 { 265 {
278 new_start_item = gui_list->selected_item; 266 new_start_item = gui_list->selected_item;
279 } 267 }
@@ -420,31 +408,7 @@ static void gui_list_select_at_offset(struct gui_synclist * gui_list,
420 0 : gui_list->nb_items - gui_list->selected_size; 408 0 : gui_list->nb_items - gui_list->selected_size;
421 edge_beep(gui_list, !gui_list->limit_scroll); 409 edge_beep(gui_list, !gui_list->limit_scroll);
422 } 410 }
423 else if (gui_list->show_selection_marker == false)
424 {
425 FOR_NB_SCREENS(i)
426 {
427 int nb_lines = list_get_nb_lines(gui_list, i);
428 if (offset > 0)
429 {
430 int screen_top = MAX(0, gui_list->nb_items - nb_lines);
431 gui_list->start_item[i] = MIN(screen_top, gui_list->start_item[i] +
432 gui_list->selected_size);
433 gui_list->selected_item = gui_list->start_item[i];
434 }
435 else
436 {
437 gui_list->start_item[i] = MAX(0, gui_list->start_item[i] -
438 gui_list->selected_size);
439 gui_list->selected_item = gui_list->start_item[i] + nb_lines;
440 }
441 411
442#ifdef HAVE_TOUCHSCREEN
443 gui_list->y_pos = gui_list->start_item[SCREEN_MAIN] * gui_list->line_height[SCREEN_MAIN];
444#endif
445 }
446 return;
447 }
448 gui_synclist_select_item(gui_list, new_selection); 412 gui_synclist_select_item(gui_list, new_selection);
449} 413}
450 414
@@ -950,12 +914,6 @@ bool simplelist_show_list(struct simplelist_info *info)
950 gui_synclist_set_sel_color(&lists, info->selection_color); 914 gui_synclist_set_sel_color(&lists, info->selection_color);
951#endif 915#endif
952 916
953 if (info->hide_selection)
954 {
955 gui_synclist_hide_selection_marker(&lists, true);
956 wrap = LIST_WRAP_OFF;
957 }
958
959 if (info->action_callback) 917 if (info->action_callback)
960 info->action_callback(ACTION_REDRAW, &lists); 918 info->action_callback(ACTION_REDRAW, &lists);
961 919
@@ -1039,7 +997,6 @@ void simplelist_info_init(struct simplelist_info *info, char* title,
1039 info->title = title; 997 info->title = title;
1040 info->count = count; 998 info->count = count;
1041 info->selection_size = 1; 999 info->selection_size = 1;
1042 info->hide_selection = false;
1043 info->scroll_all = false; 1000 info->scroll_all = false;
1044 info->hide_theme = false; 1001 info->hide_theme = false;
1045 info->speak_onshow = true; 1002 info->speak_onshow = true;
diff --git a/apps/gui/list.h b/apps/gui/list.h
index 2df33b7541..388e3d2006 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -161,7 +161,6 @@ struct gui_synclist
161 /* whether the text of the whole items of the list have to be 161 /* whether the text of the whole items of the list have to be
162 * scrolled or only for the selected item */ 162 * scrolled or only for the selected item */
163 bool scroll_all; 163 bool scroll_all;
164 bool show_selection_marker; /* set to true by default */
165 int nb_items; 164 int nb_items;
166 int selected_item; 165 int selected_item;
167 166
@@ -235,8 +234,6 @@ extern void gui_synclist_del_item(struct gui_synclist * lists);
235extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll); 234extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll);
236extern void gui_synclist_set_title(struct gui_synclist * lists, const char * title, 235extern void gui_synclist_set_title(struct gui_synclist * lists, const char * title,
237 enum themable_icons icon); 236 enum themable_icons icon);
238extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists,
239 bool hide);
240extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists, 237extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists,
241 enum screen_type screen, int item); 238 enum screen_type screen, int item);
242 239
@@ -304,7 +301,6 @@ struct simplelist_info {
304 const char *title; /* title to show on the list */ 301 const char *title; /* title to show on the list */
305 int count; /* number of items in the list, each item is selection_size high */ 302 int count; /* number of items in the list, each item is selection_size high */
306 int selection_size; /* list selection size, usually 1 */ 303 int selection_size; /* list selection size, usually 1 */
307 bool hide_selection;
308 bool scroll_all; 304 bool scroll_all;
309 bool hide_theme; 305 bool hide_theme;
310 bool speak_onshow; /* list speaks first item or 'empty list' */ 306 bool speak_onshow; /* list speaks first item or 'empty list' */
@@ -350,7 +346,6 @@ void simplelist_addline(const char *fmt, ...);
350/* setup the info struct. members not setup in this function need to be assigned manually 346/* setup the info struct. members not setup in this function need to be assigned manually
351 members set in this function: 347 members set in this function:
352 info.selection_size = 1; 348 info.selection_size = 1;
353 info.hide_selection = false;
354 info.scroll_all = false; 349 info.scroll_all = false;
355 info.hide_theme = false; 350 info.hide_theme = false;
356 info.speak_onshow = true; 351 info.speak_onshow = true;
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 321f2cdec4..2814c44fe6 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -458,9 +458,6 @@ static int show_info(void)
458 struct simplelist_info info; 458 struct simplelist_info info;
459 int count = INFO_COUNT + refresh_data(&data) - 1; 459 int count = INFO_COUNT + refresh_data(&data) - 1;
460 simplelist_info_init(&info, str(LANG_ROCKBOX_INFO), count, (void*)&data); 460 simplelist_info_init(&info, str(LANG_ROCKBOX_INFO), count, (void*)&data);
461 info.hide_selection = !global_settings.talk_menu;
462 if (info.hide_selection)
463 info.scroll_all = true;
464 info.get_name = info_getname; 461 info.get_name = info_getname;
465 if(global_settings.talk_menu) 462 if(global_settings.talk_menu)
466 info.get_talk = info_speak_item; 463 info.get_talk = info_speak_item;
diff --git a/apps/plugin.c b/apps/plugin.c
index eb76eb7753..42965bc581 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -357,6 +357,7 @@ static const struct plugin_api rockbox_api = {
357 action_get_touchscreen_press_in_vp, 357 action_get_touchscreen_press_in_vp,
358#endif 358#endif
359 action_userabort, 359 action_userabort,
360 core_set_keyremap,
360 361
361 /* button */ 362 /* button */
362 button_get, 363 button_get,
@@ -436,6 +437,8 @@ static const struct plugin_api rockbox_api = {
436 tree_get_entry_at, 437 tree_get_entry_at,
437 set_current_file, 438 set_current_file,
438 set_dirfilter, 439 set_dirfilter,
440 onplay_show_playlist_menu,
441 browse_id3,
439 442
440 /* talking */ 443 /* talking */
441 talk_id, 444 talk_id,
@@ -519,6 +522,7 @@ static const struct plugin_api rockbox_api = {
519 queue_wait, 522 queue_wait,
520 queue_send, 523 queue_send,
521 queue_reply, 524 queue_reply,
525 queue_remove_from_head,
522 526
523#ifdef RB_PROFILE 527#ifdef RB_PROFILE
524 profile_thread, 528 profile_thread,
@@ -688,7 +692,9 @@ static const struct plugin_api rockbox_api = {
688 playlist_create, 692 playlist_create,
689 playlist_insert_track, 693 playlist_insert_track,
690 playlist_insert_directory, 694 playlist_insert_directory,
695 playlist_insert_playlist,
691 playlist_shuffle, 696 playlist_shuffle,
697 warn_on_pl_erase,
692 audio_play, 698 audio_play,
693 audio_stop, 699 audio_stop,
694 audio_pause, 700 audio_pause,
@@ -731,6 +737,7 @@ static const struct plugin_api rockbox_api = {
731 battery_level_safe, 737 battery_level_safe,
732 battery_time, 738 battery_time,
733 battery_voltage, 739 battery_voltage,
740 battery_current,
734#if CONFIG_CHARGING 741#if CONFIG_CHARGING
735 charger_inserted, 742 charger_inserted,
736# if CONFIG_CHARGING >= CHARGING_MONITOR 743# if CONFIG_CHARGING >= CHARGING_MONITOR
@@ -801,21 +808,19 @@ static const struct plugin_api rockbox_api = {
801 plugin_release_audio_buffer, /* defined in plugin.c */ 808 plugin_release_audio_buffer, /* defined in plugin.c */
802 plugin_tsr, /* defined in plugin.c */ 809 plugin_tsr, /* defined in plugin.c */
803 plugin_get_current_filename, 810 plugin_get_current_filename,
804 /* new stuff at the end, sort into place next time
805 the API gets incompatible */
806 warn_on_pl_erase,
807 playlist_insert_playlist,
808 battery_current,
809 onplay_show_playlist_menu,
810 queue_remove_from_head,
811 core_set_keyremap,
812 plugin_reserve_buffer, 811 plugin_reserve_buffer,
812
813 /* reboot and poweroff */
814 sys_poweroff,
815 sys_reboot,
816
817 /* pathfuncs */
813#ifdef HAVE_MULTIVOLUME 818#ifdef HAVE_MULTIVOLUME
814 path_strip_volume, 819 path_strip_volume,
815#endif 820#endif
816 sys_poweroff, 821
817 sys_reboot, 822 /* new stuff at the end, sort into place next time
818 browse_id3, 823 the API gets incompatible */
819}; 824};
820 825
821static int plugin_buffer_handle; 826static int plugin_buffer_handle;
diff --git a/apps/plugin.h b/apps/plugin.h
index e35909f409..984555fdf2 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -157,12 +157,12 @@ int plugin_open(const char *plugin, const char *parameter);
157#define PLUGIN_MAGIC 0x526F634B /* RocK */ 157#define PLUGIN_MAGIC 0x526F634B /* RocK */
158 158
159/* increase this every time the api struct changes */ 159/* increase this every time the api struct changes */
160#define PLUGIN_API_VERSION 251 160#define PLUGIN_API_VERSION 252
161 161
162/* update this to latest version if a change to the api struct breaks 162/* update this to latest version if a change to the api struct breaks
163 backwards compatibility (and please take the opportunity to sort in any 163 backwards compatibility (and please take the opportunity to sort in any
164 new function which are "waiting" at the end of the function table) */ 164 new function which are "waiting" at the end of the function table) */
165#define PLUGIN_MIN_API_VERSION 245 165#define PLUGIN_MIN_API_VERSION 252
166 166
167/* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ 167/* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */
168 168
@@ -406,6 +406,7 @@ struct plugin_api {
406 int (*action_get_touchscreen_press_in_vp)(short *x1, short *y1, struct viewport *vp); 406 int (*action_get_touchscreen_press_in_vp)(short *x1, short *y1, struct viewport *vp);
407#endif 407#endif
408 bool (*action_userabort)(int timeout); 408 bool (*action_userabort)(int timeout);
409 int (*core_set_keyremap)(struct button_mapping* core_keymap, int count);
409 410
410 /* button */ 411 /* button */
411 long (*button_get)(bool block); 412 long (*button_get)(bool block);
@@ -492,6 +493,10 @@ struct plugin_api {
492 void (*set_current_file)(const char* path); 493 void (*set_current_file)(const char* path);
493 void (*set_dirfilter)(int l_dirfilter); 494 void (*set_dirfilter)(int l_dirfilter);
494 495
496 void (*onplay_show_playlist_menu)(const char* path, void (*playlist_insert_cb));
497 bool (*browse_id3)(struct mp3entry *id3,
498 int playlist_display_index, int playlist_amount);
499
495 /* talking */ 500 /* talking */
496 int (*talk_id)(int32_t id, bool enqueue); 501 int (*talk_id)(int32_t id, bool enqueue);
497 int (*talk_file)(const char *root, const char *dir, const char *file, 502 int (*talk_file)(const char *root, const char *dir, const char *file,
@@ -588,6 +593,7 @@ struct plugin_api {
588 intptr_t (*queue_send)(struct event_queue *q, long id, 593 intptr_t (*queue_send)(struct event_queue *q, long id,
589 intptr_t data); 594 intptr_t data);
590 void (*queue_reply)(struct event_queue *q, intptr_t retval); 595 void (*queue_reply)(struct event_queue *q, intptr_t retval);
596 void (*queue_remove_from_head)(struct event_queue *q, long id);
591 597
592#ifdef RB_PROFILE 598#ifdef RB_PROFILE
593 void (*profile_thread)(void); 599 void (*profile_thread)(void);
@@ -790,7 +796,10 @@ struct plugin_api {
790 int (*playlist_insert_directory)(struct playlist_info* playlist, 796 int (*playlist_insert_directory)(struct playlist_info* playlist,
791 const char *dirname, int position, bool queue, 797 const char *dirname, int position, bool queue,
792 bool recurse); 798 bool recurse);
799 int (*playlist_insert_playlist)(struct playlist_info* playlist,
800 const char *filename, int position, bool queue);
793 int (*playlist_shuffle)(int random_seed, int start_index); 801 int (*playlist_shuffle)(int random_seed, int start_index);
802 bool (*warn_on_pl_erase)(void);
794 void (*audio_play)(unsigned long elapsed, unsigned long offset); 803 void (*audio_play)(unsigned long elapsed, unsigned long offset);
795 void (*audio_stop)(void); 804 void (*audio_stop)(void);
796 void (*audio_pause)(void); 805 void (*audio_pause)(void);
@@ -850,6 +859,7 @@ struct plugin_api {
850 bool (*battery_level_safe)(void); 859 bool (*battery_level_safe)(void);
851 int (*battery_time)(void); 860 int (*battery_time)(void);
852 int (*battery_voltage)(void); 861 int (*battery_voltage)(void);
862 int (*battery_current)(void);
853#if CONFIG_CHARGING 863#if CONFIG_CHARGING
854 bool (*charger_inserted)(void); 864 bool (*charger_inserted)(void);
855# if CONFIG_CHARGING >= CHARGING_MONITOR 865# if CONFIG_CHARGING >= CHARGING_MONITOR
@@ -928,23 +938,16 @@ struct plugin_api {
928 void (*plugin_release_audio_buffer)(void); 938 void (*plugin_release_audio_buffer)(void);
929 void (*plugin_tsr)(bool (*exit_callback)(bool reenter)); 939 void (*plugin_tsr)(bool (*exit_callback)(bool reenter));
930 char* (*plugin_get_current_filename)(void); 940 char* (*plugin_get_current_filename)(void);
931 /* new stuff at the end, sort into place next time
932 the API gets incompatible */
933 bool (*warn_on_pl_erase)(void);
934 int (*playlist_insert_playlist)(struct playlist_info* playlist,
935 const char *filename, int position, bool queue);
936 int (*battery_current)(void);
937 void (*onplay_show_playlist_menu)(const char* path, void (*playlist_insert_cb));
938 void (*queue_remove_from_head)(struct event_queue *q, long id);
939 int (*core_set_keyremap)(struct button_mapping* core_keymap, int count);
940 size_t (*plugin_reserve_buffer)(size_t buffer_size); 941 size_t (*plugin_reserve_buffer)(size_t buffer_size);
942 /* reboot and poweroff */
943 void (*sys_poweroff)(void);
944 void (*sys_reboot)(void);
945 /* pathfuncs */
941#ifdef HAVE_MULTIVOLUME 946#ifdef HAVE_MULTIVOLUME
942 int (*path_strip_volume)(const char *name, const char **nameptr, bool greedy); 947 int (*path_strip_volume)(const char *name, const char **nameptr, bool greedy);
943#endif 948#endif
944 void (*sys_poweroff)(void); 949 /* new stuff at the end, sort into place next time
945 void (*sys_reboot)(void); 950 the API gets incompatible */
946 bool (*browse_id3)(struct mp3entry *id3,
947 int playlist_display_index, int playlist_amount);
948}; 951};
949 952
950/* plugin header */ 953/* plugin header */
diff --git a/apps/plugins/lrcplayer.c b/apps/plugins/lrcplayer.c
index f42b96b5b3..6c26db7a33 100644
--- a/apps/plugins/lrcplayer.c
+++ b/apps/plugins/lrcplayer.c
@@ -2437,7 +2437,6 @@ static bool lrc_debug_menu(void)
2437{ 2437{
2438 struct simplelist_info info; 2438 struct simplelist_info info;
2439 rb->simplelist_info_init(&info, "Debug Menu", 6, NULL); 2439 rb->simplelist_info_init(&info, "Debug Menu", 6, NULL);
2440 info.hide_selection = true;
2441 info.scroll_all = true; 2440 info.scroll_all = true;
2442 info.get_name = lrc_debug_data; 2441 info.get_name = lrc_debug_data;
2443 return rb->simplelist_show_list(&info); 2442 return rb->simplelist_show_list(&info);
diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c
index 50027a30c6..6969f76165 100644
--- a/apps/plugins/superdom.c
+++ b/apps/plugins/superdom.c
@@ -1450,7 +1450,6 @@ static int show_inventory(void)
1450{ 1450{
1451 struct simplelist_info info; 1451 struct simplelist_info info;
1452 rb->simplelist_info_init(&info, "Inventory", 9, NULL); 1452 rb->simplelist_info_init(&info, "Inventory", 9, NULL);
1453 info.hide_selection = true;
1454 info.get_name = inventory_data; 1453 info.get_name = inventory_data;
1455 if(rb->simplelist_show_list(&info)) 1454 if(rb->simplelist_show_list(&info))
1456 { 1455 {