Index: apps/plugins/text_editor.c =================================================================== --- apps/plugins/text_editor.c (Revision 20870) +++ apps/plugins/text_editor.c (Arbeitskopie) @@ -35,6 +35,7 @@ static int line_count = 0; static int last_action_line = 0; static int last_char_index = 0; +static struct viewport parent[NB_SCREENS]; #define ACTION_INSERT 0 #define ACTION_GET 1 @@ -209,7 +210,7 @@ void setup_lists(struct gui_synclist *lists, int sel) { - rb->gui_synclist_init(lists,list_get_name_cb,0, false, 1, NULL); + rb->gui_synclist_init(lists,list_get_name_cb,0, false, 1, parent); rb->gui_synclist_set_icon_callback(lists,NULL); rb->gui_synclist_set_nb_items(lists,line_count); rb->gui_synclist_limit_scroll(lists,true); @@ -327,11 +328,17 @@ #ifdef HAVE_LCD_COLOR bool edit_colors_file = false; #endif + int i; - copy_buffer[0]='\0'; prev_show_statusbar = rb->global_settings->statusbar; rb->global_settings->statusbar = false; + + rb->viewportmanager_set_custom_vp(false); + FOR_NB_SCREENS(i) + rb->viewport_set_defaults(&parent[i], i); + copy_buffer[0]='\0'; + #if LCD_DEPTH > 1 rb->lcd_set_backdrop(NULL); #endif @@ -512,6 +519,7 @@ } rb->gui_synclist_set_nb_items(&lists,line_count); } + rb->viewportmanager_set_custom_vp(true); rb->global_settings->statusbar = prev_show_statusbar; return PLUGIN_OK; } Index: apps/plugins/star.c =================================================================== --- apps/plugins/star.c (Revision 20870) +++ apps/plugins/star.c (Arbeitskopie) @@ -1043,6 +1043,7 @@ "Information","Keys","Quit"); FOR_NB_SCREENS(selection) { + rb->viewportmanager_set_custom_vp(false); rb->viewport_set_defaults(&vp[selection], selection); #if LCD_DEPTH > 1 if (rb->screens[selection]->depth > 1) @@ -1152,6 +1153,8 @@ level--; star_run_game(level); } + + rb->viewportmanager_set_custom_vp(false); return PLUGIN_OK; } Index: apps/plugins/pictureflow/pictureflow.c =================================================================== --- apps/plugins/pictureflow/pictureflow.c (Revision 20870) +++ apps/plugins/pictureflow/pictureflow.c (Arbeitskopie) @@ -395,6 +395,7 @@ static int track_list_h; static int track_scroll_index = 0; static int track_scroll_dir = 1; +static struct viewport vp[NB_SCREENS]; /* Proposals for transitions: @@ -1910,6 +1911,7 @@ (void) parameter; /* Turn on backlight timeout (revert to settings) */ backlight_use_settings(); /* backlight control in lib/helper.c */ + rb->viewportmanager_set_custom_vp(true); #ifdef USEGSLIB grey_release(); @@ -1951,7 +1953,7 @@ MENUITEM_STRINGLIST(album_name_menu,"Show album title",NULL, "Hide album title", "Show at the bottom", "Show at the top"); - rb->do_menu(&album_name_menu, &selection, NULL, false); + rb->do_menu(&album_name_menu, &selection, vp, false); show_album_name = selection; return GO_TO_PREVIOUS; @@ -1970,7 +1972,7 @@ "Show album title", "Resize Covers", "Rebuild cache"); do { - selection=rb->do_menu(&settings_menu,&selection, NULL, false); + selection=rb->do_menu(&settings_menu,&selection, vp, false); switch(selection) { case 0: rb->set_bool("Show FPS", &show_fps); @@ -2047,7 +2049,7 @@ MENUITEM_STRINGLIST(main_menu,"PictureFlow Main Menu",NULL, "Settings", "Return", "Quit"); while (1) { - switch (rb->do_menu(&main_menu,&selection, NULL, false)) { + switch (rb->do_menu(&main_menu,&selection, vp, false)) { case 0: result = settings_menu(); if ( result != 0 ) return result; @@ -2546,6 +2548,10 @@ #if LCD_DEPTH > 1 rb->lcd_set_backdrop(NULL); #endif + rb->viewportmanager_set_custom_vp(false); + int i; + FOR_NB_SCREENS(i) + rb->viewport_set_defaults(&vp[i], i); /* Turn off backlight timeout */ backlight_force_on(); /* backlight control in lib/helper.c */ #ifdef HAVE_ADJUSTABLE_CPU_FREQ Index: apps/settings.c =================================================================== --- apps/settings.c (Revision 20870) +++ apps/settings.c (Arbeitskopie) @@ -67,6 +67,7 @@ #include "filetypes.h" #include "option_select.h" #include "backdrop.h" +#include "viewport.h" #if CONFIG_TUNER #include "radio.h" @@ -897,6 +898,9 @@ read_color_theme_file(); #endif } +#ifdef HAVE_LCD_BITMAP + viewport_init_custom_vp(); +#endif #ifdef HAVE_LCD_COLOR screens[SCREEN_MAIN].set_foreground(global_settings.fg_color); @@ -972,7 +976,6 @@ #if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC enc_global_settings_apply(); #endif - list_init_viewports(NULL); } @@ -1094,7 +1097,8 @@ item.lang_id = -1; item.cfg_vals = (char*)string; item.setting = (void *)variable; - return option_screen(&item, NULL, false, NULL); + return option_screen(&item, + viewportmanager_get_current_vp(), false, NULL); } Index: apps/gui/splash.c =================================================================== --- apps/gui/splash.c (Revision 20870) +++ apps/gui/splash.c (Arbeitskopie) @@ -44,7 +44,7 @@ #define RECT_SPACING 2 -static void splash_internal(struct screen * screen, const char *fmt, va_list ap) +static void splash_internal(int ticks, struct screen * screen, const char *fmt, va_list ap) { char splash_buf[MAXBUFFER]; short widths[MAXLINES]; @@ -196,6 +196,14 @@ #undef W } screen->update_viewport(); + if (ticks) + { + sleep(ticks); + screens->clear_viewport(); + screens->update_viewport(); + } + else + root_menu_register_update(); screen->set_viewport(NULL); } @@ -210,11 +218,9 @@ FOR_NB_SCREENS(i) { va_start(ap, fmt); - splash_internal(&(screens[i]), fmt, ap); + splash_internal(ticks, &(screens[i]), fmt, ap); va_end(ap); } - if (ticks) - sleep(ticks); } void splash(int ticks, const char *str) Index: apps/gui/statusbar.c =================================================================== --- apps/gui/statusbar.c (Revision 20870) +++ apps/gui/statusbar.c (Arbeitskopie) @@ -263,7 +263,7 @@ memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info))) { struct viewport vp; - viewport_set_defaults(&vp, display->screen_type); + viewport_set_fullscreen(&vp, display->screen_type); vp.height = STATUSBAR_HEIGHT; vp.x = STATUSBAR_X_POS; vp.y = STATUSBAR_Y_POS; Index: apps/gui/list.c =================================================================== --- apps/gui/list.c (Revision 20870) +++ apps/gui/list.c (Arbeitskopie) @@ -28,6 +28,7 @@ #include "settings.h" #include "kernel.h" #include "system.h" +#include "debug.h" #include "action.h" #include "screen_access.h" @@ -64,19 +65,26 @@ void list_draw(struct screen *display, struct gui_synclist *list); #ifdef HAVE_LCD_BITMAP -static struct viewport parent[NB_SCREENS]; -void list_init_viewports(struct gui_synclist *list) +static void list_init_viewports(struct gui_synclist *list) { int i; - struct viewport *vp; + struct viewport* vp; + bool parent_used[NB_SCREENS]; FOR_NB_SCREENS(i) { - vp = &parent[i]; - if (!list || list->parent[i] == vp) - viewport_set_defaults(vp, i); + parent_used[i] = (list->parent[i]); } + vp = viewportmanager_get_current_vp(); + FOR_NB_SCREENS(i) + { + if (!parent_used[i]) + { + viewportmanager_set_custom_vp(true); + list->parent[i] = &vp[i]; + } + } #ifdef HAVE_BUTTONBAR - if (list && (list->parent[0] == &parent[0]) && global_settings.buttonbar) + if (list && !parent_used[SCREEN_MAIN] && global_settings.buttonbar) list->parent[0]->height -= BUTTONBAR_HEIGHT; #endif force_list_reinit = false; @@ -144,7 +152,7 @@ gui_list->parent[i] = &list_parent[i]; else { - gui_list->parent[i] = &parent[i]; + gui_list->parent[i] = NULL; } } list_init_viewports(gui_list); Index: apps/gui/viewport.c =================================================================== --- apps/gui/viewport.c (Revision 20870) +++ apps/gui/viewport.c (Arbeitskopie) @@ -38,6 +38,15 @@ static int statusbar_enabled = 0; +#ifdef HAVE_LCD_BITMAP +static struct { + struct viewport* vp; + int enabled; +} custom_vp_info; + +static struct viewport custom_vp[NB_SCREENS]; +#endif + int viewport_get_nb_lines(struct viewport *vp) { #ifdef HAVE_LCD_BITMAP @@ -58,10 +67,21 @@ return true; #endif return false; -} +} void viewport_set_defaults(struct viewport *vp, enum screen_type screen) { +#ifdef HAVE_LCD_BITMAP + if (custom_vp_info.enabled) + *vp = custom_vp[screen]; + else +#endif + viewport_set_fullscreen(vp, screen); +} + + +void viewport_set_fullscreen(struct viewport *vp, enum screen_type screen) +{ vp->x = 0; vp->width = screens[screen].lcdwidth; @@ -98,7 +118,25 @@ #endif } +void viewportmanager_set_vp(void* param) +{ + if (param != NULL) + custom_vp_info.vp = (struct viewport*) param; + else + custom_vp_info.vp = custom_vp; +} +void viewportmanager_init(void) +{ + viewportmanager_set_statusbar(VP_SB_ALLSCREENS); + custom_vp_info.enabled = viewport_init_custom_vp(); + add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, + viewportmanager_statusbar_changed); + add_event(GUI_EVENT_VIEWPORT_CHANGED, false, + viewportmanager_set_vp); + custom_vp_info.vp = custom_vp; +} + int viewportmanager_set_statusbar(int enabled) { int old = statusbar_enabled; @@ -111,16 +149,16 @@ if (showing_bars(i)) gui_statusbar_draw(&statusbars.statusbars[i], true); } - add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_draw_statusbars); + add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_redraw); } else { - remove_event(GUI_EVENT_ACTIONUPDATE, viewportmanager_draw_statusbars); + remove_event(GUI_EVENT_ACTIONUPDATE, viewportmanager_redraw); } return old; } -void viewportmanager_draw_statusbars(void* data) +void viewportmanager_redraw(void* data) { (void)data; int i; @@ -130,6 +168,9 @@ if (showing_bars(i)) gui_statusbar_draw(&statusbars.statusbars[i], false); } +#ifdef HAVE_LCD_BITMAP + viewportmanager_set_custom_vp(custom_vp_info.enabled); +#endif } void viewportmanager_statusbar_changed(void* data) @@ -137,3 +178,148 @@ (void)data; viewportmanager_set_statusbar(statusbar_enabled); } + +#ifdef HAVE_LCD_BITMAP +void viewportmanager_set_custom_vp(const bool enable) +{ + if (enable && !custom_vp_info.enabled) + { /* maybe we changed from "full screen" to a smaller custom vp, + * so we need to remove dead parts of the screen by refreshing the whole + * screen */ + int i; + FOR_NB_SCREENS(i) + { + screens[i].clear_display(); + screens[i].update(); + } + } + custom_vp_info.enabled = enable; +} + +struct viewport* viewportmanager_get_current_vp(void) +{ + return custom_vp_info.vp; +} + +/* Generic viewport parsing function to parse viewports structures like + * the %V tag; basically just a wrapper for parse_list, so improvements + * should aim parse_list */ +const char* viewport_parse_viewport(struct viewport *vp, + const char *bufptr, const char seperator, enum screen_type screen) +{ + /* parse the list to the viewport struct */ + const char *ptr = bufptr; + int depth; + uint32_t set = 0; + + enum { + PL_X = 0, + PL_Y, + PL_WIDTH, + PL_HEIGHT, + PL_FONT, + PL_FG, + PL_BG, + }; + + /* Work out the depth of this display */ + depth = screens[screen].depth; +#ifdef HAVE_LCD_COLOR + if (depth == 16) + { + if (!(ptr = parse_list("dddddcc", &set, seperator, ptr, &vp->x, &vp->y, &vp->width, + &vp->height, &vp->font, &vp->fg_pattern,&vp->bg_pattern))) + return VP_ERROR; + } + else +#endif +#if (LCD_DEPTH == 2) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH == 2) + if (depth == 2) { + if (!(ptr = parse_list("dddddgg", &set, seperator, ptr, &vp->x, &vp->y, &vp->width, + &vp->height, &vp->font, &vp->fg_pattern, &vp->bg_pattern))) + return VP_ERROR; + } + else +#endif +#if (LCD_DEPTH == 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH == 1) + if (depth == 1) + { + if (!(ptr = parse_list("ddddd", &set, seperator, ptr, &vp->x, &vp->y, &vp->width, + &vp->height, &vp->font))) + return VP_ERROR; + } + else +#endif + {} + + if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y)) + return VP_ERROR; + + /* fix defaults */ + if (!LIST_VALUE_PARSED(set, PL_WIDTH)) + vp->width = screens[screen].lcdwidth - vp->x; + if (!LIST_VALUE_PARSED(set, PL_HEIGHT)) + vp->height = screens[screen].lcdheight - vp->y; + +#if (LCD_DEPTH > 1) + if (!LIST_VALUE_PARSED(set, PL_FG)) + vp->fg_pattern = global_settings.fg_color; + if (!LIST_VALUE_PARSED(set, PL_BG)) + vp->bg_pattern = global_settings.bg_color; +#endif +#ifdef HAVE_LCD_COLOR + vp->lss_pattern = global_settings.lss_color; + vp->lse_pattern = global_settings.lse_color; + vp->lst_pattern = global_settings.lst_color; +#endif + /* Validate the viewport dimensions - we know that the numbers are + non-negative integers */ + if ((vp->x >= screens[screen].lcdwidth) || + ((vp->x + vp->width) > screens[screen].lcdwidth) || + (vp->y >= screens[screen].lcdheight) || + ((vp->y + vp->height) > screens[screen].lcdheight)) + { + return VP_ERROR; + } + + /* Default to using the user font if the font was an invalid number */ + if ((vp->font != FONT_SYSFIXED) && (vp->font != FONT_UI)) + vp->font = FONT_UI; + + vp->drawmode = DRMODE_SOLID; + + return ptr; +} + +/* returns 0 if defaults are used, due to viewport_parse_viewport failure */ +int viewport_init_custom_vp(void) +{ + int screen; + FOR_NB_SCREENS(screen) + { +#ifdef HAVE_REMOTE_LCD + if (screen= SCREEN_REMOTE) + { + if(!(viewport_parse_viewport(&custom_vp[screen], + global_settings.remote_list_vp_config, ',', screen))) + { + viewport_set_fullscreen(&custom_vp[screen], screen); + return 0; + } + } + else +#endif + { + if (!(viewport_parse_viewport(&custom_vp[screen], + global_settings.list_vp_config, ',', screen))) + { + viewport_set_fullscreen(&custom_vp[screen], screen); + return 0; + } + } + } + + return 1; +} + +#endif /* HAVE_LCD_BITMAP */ Index: apps/gui/list.h =================================================================== --- apps/gui/list.h (Revision 20870) +++ apps/gui/list.h (Arbeitskopie) @@ -139,8 +139,6 @@ extern void gui_list_screen_scroll_out_of_view(bool enable); #endif /* HAVE_LCD_BITMAP */ -void list_init_viewports(struct gui_synclist * lists); - extern void gui_synclist_init( struct gui_synclist * lists, list_get_name callback_get_item_name, Index: apps/gui/gwps.c =================================================================== --- apps/gui/gwps.c (Revision 20870) +++ apps/gui/gwps.c (Arbeitskopie) @@ -286,6 +286,7 @@ /* Play safe and unregister the hook */ lcd_activation_set_hook(NULL); #endif + viewportmanager_set_custom_vp(true); } void gwps_draw_statusbars(void) @@ -787,6 +788,7 @@ restore = false; restoretimer = RESTORE_WPS_INSTANTLY; gwps_fix_statusbars(); + viewportmanager_set_custom_vp(false); #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) lcd_activation_set_hook(wps_lcd_activation_hook); #endif Index: apps/gui/viewport.h =================================================================== --- apps/gui/viewport.h (Revision 20870) +++ apps/gui/viewport.h (Arbeitskopie) @@ -61,8 +61,21 @@ #define VP_SB_ONSCREEN(screen) (1u<remote_wps) - { - lcd_width = LCD_REMOTE_WIDTH; - lcd_height = LCD_REMOTE_HEIGHT; - } + wps_data->remote_wps ? SCREEN_REMOTE : #endif + SCREEN_MAIN; if (wps_data->num_viewports >= WPS_MAX_VIEWPORTS) return WPS_ERROR_INVALID_PARAM; @@ -637,88 +624,20 @@ return WPS_ERROR_INVALID_PARAM; ptr++; - vp = &wps_data->viewports[wps_data->num_viewports].vp; + struct viewport *vp = &wps_data->viewports[wps_data->num_viewports].vp; /* format: %V|x|y|width|height|font|fg_pattern|bg_pattern| */ /* Set the defaults for fields not user-specified */ vp->drawmode = DRMODE_SOLID; - /* Work out the depth of this display */ -#ifdef HAVE_REMOTE_LCD - depth = (wps_data->remote_wps ? LCD_REMOTE_DEPTH : LCD_DEPTH); -#else - depth = LCD_DEPTH; -#endif + if (!(ptr = viewport_parse_viewport(vp, ptr, '|', screen))) + return WPS_ERROR_INVALID_PARAM; -#ifdef HAVE_LCD_COLOR - if (depth == 16) - { - if (!(ptr = parse_list("dddddcc", &set, '|', ptr, &vp->x, &vp->y, &vp->width, - &vp->height, &vp->font, &vp->fg_pattern,&vp->bg_pattern))) - return WPS_ERROR_INVALID_PARAM; - } - else -#endif -#if (LCD_DEPTH == 2) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH == 2) - if (depth == 2) { - /* Default to black on white */ - vp->fg_pattern = 0; - vp->bg_pattern = 3; - if (!(ptr = parse_list("dddddgg", &set, '|', ptr, &vp->x, &vp->y, &vp->width, - &vp->height, &vp->font, &vp->fg_pattern, &vp->bg_pattern))) - return WPS_ERROR_INVALID_PARAM; - } - else -#endif -#if (LCD_DEPTH == 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH == 1) - if (depth == 1) - { - if (!(ptr = parse_list("ddddd", &set, '|', ptr, &vp->x, &vp->y, - &vp->width, &vp->height, &vp->font))) - return WPS_ERROR_INVALID_PARAM; - } - else -#endif - {} - /* Check for trailing | */ if (*ptr != '|') return WPS_ERROR_INVALID_PARAM; - if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y)) - return WPS_ERROR_INVALID_PARAM; - - /* fix defaults */ - if (!LIST_VALUE_PARSED(set, PL_WIDTH)) - vp->width = lcd_width - vp->x; - if (!LIST_VALUE_PARSED(set, PL_HEIGHT)) - vp->height = lcd_height - vp->y; - - /* Default to using the user font if the font was an invalid number */ - if (!LIST_VALUE_PARSED(set, PL_FONT) || - ((vp->font != FONT_SYSFIXED) && (vp->font != FONT_UI))) - vp->font = FONT_UI; - /* Validate the viewport dimensions - we know that the numbers are - non-negative integers */ - if ((vp->x >= lcd_width) || - ((vp->x + vp->width) > lcd_width) || - (vp->y >= lcd_height) || - ((vp->y + vp->height) > lcd_height)) - { - return WPS_ERROR_INVALID_PARAM; - } - -#ifdef HAVE_LCD_COLOR - if (depth == 16) - { - if (!LIST_VALUE_PARSED(set, PL_FG)) - vp->fg_pattern = global_settings.fg_color; - if (!LIST_VALUE_PARSED(set, PL_BG)) - vp->bg_pattern = global_settings.bg_color; - } -#endif - wps_data->viewports[wps_data->num_viewports-1].last_line = wps_data->num_lines - 1; wps_data->viewports[wps_data->num_viewports].first_line = wps_data->num_lines; Index: apps/menu.c =================================================================== --- apps/menu.c (Revision 20870) +++ apps/menu.c (Arbeitskopie) @@ -52,6 +52,7 @@ #include "audio.h" #include "viewport.h" #include "quickscreen.h" +#include "appevents.h" #ifdef HAVE_LCD_BITMAP #include "icons.h" @@ -359,6 +360,7 @@ gui_buttonbar_set(&buttonbar, "<<<", "", ""); #endif + send_event(GUI_EVENT_VIEWPORT_CHANGED, parent); menu_callback_type menu_callback = NULL; if (start_menu == NULL) menu = &main_menu_; Index: apps/settings.h =================================================================== --- apps/settings.h (Revision 20870) +++ apps/settings.h (Arbeitskopie) @@ -734,6 +734,13 @@ /* If values are just added to the end, no need to bump plugin API version. */ /* new stuff to be added at the end */ + +#ifdef HAVE_LCD_BITMAP + unsigned char list_vp_config[50]; /* viewport string for the lists */ +#endif +#ifdef HAVE_REMOTE_LCD + unsigned char remote_list_vp_config[50]; /* viewport file for the remote lists */ +#endif }; /** global variables **/ Index: apps/appevents.h =================================================================== --- apps/appevents.h (Revision 20870) +++ apps/appevents.h (Arbeitskopie) @@ -49,6 +49,7 @@ /** Generic GUI class events **/ enum { GUI_EVENT_THEME_CHANGED = (EVENT_CLASS_GUI|1), + GUI_EVENT_VIEWPORT_CHANGED, GUI_EVENT_STATUSBAR_TOGGLE, GUI_EVENT_ACTIONUPDATE, }; Index: apps/settings_list.c =================================================================== --- apps/settings_list.c (Revision 20870) +++ apps/settings_list.c (Arbeitskopie) @@ -177,6 +177,10 @@ {.custom = (void*)default}, name, NULL, \ {.custom_setting = (struct custom_setting[]){ \ {load_from_cfg, write_to_cfg, is_change, set_default}}}} + +#define VIEWPORT_SETTING(var,name,default) \ + TEXT_SETTING(0,var,name,default, NULL, NULL) + /* some sets of values which are used more than once, to save memory */ static const char off_on[] = "off,on"; static const char off_on_ask[] = "off,on,ask"; @@ -1468,6 +1472,14 @@ ID2P(LANG_TOUCHSCREEN_POINT), ID2P(LANG_TOUCHSCREEN_GRID)), #endif OFFON_SETTING(0, prevent_skip, LANG_PREVENT_SKIPPING, false, "prevent track skip", NULL), + + /* Customizable list */ +#ifdef HAVE_LCD_BITMAP + VIEWPORT_SETTING(list_vp_config, "list viewport", ""), +#endif +#ifdef HAVE_REMOTE_LCD + VIEWPORT_SETTING(remote_list_vp_config, "remote list viewport", ""), +#endif }; const int nb_settings = sizeof(settings)/sizeof(*settings); Index: apps/plugin.c =================================================================== --- apps/plugin.c (Revision 20870) +++ apps/plugin.c (Arbeitskopie) @@ -644,6 +644,10 @@ appsversion, /* new stuff at the end, sort into place next time the API gets incompatible */ + +#ifdef HAVE_LCD_BITMAP + viewportmanager_set_custom_vp, +#endif }; int plugin_load(const char* plugin, const void* parameter) Index: apps/plugin.h =================================================================== --- apps/plugin.h (Revision 20870) +++ apps/plugin.h (Arbeitskopie) @@ -807,6 +807,9 @@ const char *appsversion; /* new stuff at the end, sort into place next time the API gets incompatible */ +#ifdef HAVE_LCD_BITMAP + void (*viewportmanager_set_custom_vp)(const bool enable); +#endif }; /* plugin header */ Index: apps/root_menu.c =================================================================== --- apps/root_menu.c (Revision 20870) +++ apps/root_menu.c (Arbeitskopie) @@ -72,6 +72,12 @@ void* param; const struct menu_item_ex *context_menu; }; + +static bool registered_update = 0; +void root_menu_register_update(int screens) +{ + registered_update |= screens; +} static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume or goto current track based on previous screen */ @@ -532,6 +538,19 @@ while (true) { + if (registered_update) + { + int i; + FOR_NB_SCREENS(i) + { + if (registered_update & VP_SB_ONSCREEN(i)) + { + screens[i].update(); + registered_update &= ~VP_SB_ONSCREEN(i); + } + } + } + switch (next_screen) { case MENU_ATTACHED_USB: Index: apps/main.c =================================================================== --- apps/main.c (Revision 20870) +++ apps/main.c (Arbeitskopie) @@ -135,10 +135,8 @@ screens[i].clear_display(); screens[i].update(); } + viewportmanager_init(); tree_gui_init(); - viewportmanager_set_statusbar(VP_SB_ALLSCREENS); - add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, - viewportmanager_statusbar_changed); #ifdef HAVE_USBSTACK /* All threads should be created and public queues registered by now */ usb_start_monitoring(); Index: wps/WPSLIST =================================================================== --- wps/WPSLIST (Revision 20870) +++ wps/WPSLIST (Arbeitskopie) @@ -69,6 +69,8 @@ iconset: viewers iconset: selector type: bar (inverse) +list viewport: - +remote list viewport: - @@ -81,6 +83,8 @@ iconset: viewers iconset: selector type: bar (inverse) +list viewport: - +remote list viewport: - @@ -93,6 +97,8 @@ viewers iconset: selector type: bar (inverse) Statusbar: on +list viewport: - +remote list viewport: - @@ -105,6 +111,8 @@ iconset: viewers iconset: selector type: bar (inverse) +list viewport: +remote list viewport: @@ -152,6 +160,8 @@ iconset: viewers iconset: selector type: bar (inverse) +list viewport: - +remote list viewport: - @@ -159,6 +169,8 @@ Author: Mike Sobel Font: 13-Nimbus.fnt Statusbar: on +list viewport: - +remote list viewport: - @@ -173,6 +185,8 @@ iconset: viewers iconset: selector type: bar (inverse) +list viewport: - +remote list viewport: - @@ -206,6 +220,8 @@ iconset: viewers iconset: selector type: bar (inverse) +list viewport: - +remote list viewport: - @@ -228,6 +244,8 @@ iconset: viewers iconset: selector type: bar (inverse) +list viewport: - +remote list viewport: - @@ -261,6 +279,8 @@ iconset: viewers iconset: selector type: bar (inverse) +list viewport: - +remote list viewport: - @@ -352,6 +372,10 @@ # Whether the WPS is designed to have the statusbar on or off Statusbar: on + +# list & remote list viewports +list viewport: - +remote list viewport: - Index: wps/wpsbuild.pl =================================================================== --- wps/wpsbuild.pl (Revision 20870) +++ wps/wpsbuild.pl (Arbeitskopie) @@ -53,6 +53,8 @@ my $viewericon; my $lineselecttextcolor; my $filetylecolor; +my $listviewport; +my $remotelistviewport; # LCD sizes my ($main_height, $main_width, $main_depth); @@ -290,6 +292,12 @@ if($rwps && $has_remote ) { push @out, "rwps: /$rbdir/wps/$rwps\n"; } + if(defined($listviewport)) { + push @out, "list viewport: $listviewport\n"; + } + if(defined($remotelistviewport) && $has_remote) { + push @out, "remote list viewport: $listviewport\n"; + } if(-f "$rbdir/wps/$cfg") { print STDERR "wpsbuild warning: wps/$cfg already exists!\n"; } @@ -344,6 +352,8 @@ undef $viewericon; undef $lineselecttextcolor; undef $filetylecolor; + undef $listviewport; + undef $remotelistviewport; next; } @@ -510,6 +520,12 @@ elsif($l =~ /^filetype colours: *(.*)/i) { $filetylecolor = $1; } + elsif($l =~ /^list viewport: *(.*)/i) { + $listviewport = $1; + } + elsif($l =~ /^remote list viewport: *(.*)/i) { + $remotelistviewport = $1; + } else{ #print "Unknown line: $l!\n"; }