Index: apps/recorder/keyboard.c
===================================================================
--- apps/recorder/keyboard.c (Revision 21540)
+++ apps/recorder/keyboard.c (Arbeitskopie)
@@ -304,6 +304,7 @@
char buf[2];
#endif
int oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
+ viewportmanager_set_ui_vp(false);
FOR_NB_SCREENS(l)
{
struct keyboard_parameters *pm = ¶m[l];
@@ -1248,6 +1249,7 @@
FOR_NB_SCREENS(l)
screens[l].setfont(FONT_UI);
viewportmanager_set_statusbar(oldbars);
+ viewportmanager_set_ui_vp(true);
return 0;
}
Index: apps/settings.c
===================================================================
--- apps/settings.c (Revision 21540)
+++ apps/settings.c (Arbeitskopie)
@@ -66,6 +66,7 @@
#include "filetypes.h"
#include "option_select.h"
#include "backdrop.h"
+#include "viewport.h"
#include "appevents.h"
#if CONFIG_TUNER
#include "radio.h"
@@ -973,7 +974,9 @@
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
enc_global_settings_apply();
#endif
- list_init_viewports(NULL);
+#ifdef HAVE_LCD_BITMAP
+ viewport_init_ui_vp();
+#endif
send_event(GUI_EVENT_ACTIONUPDATE, (void*)true);
}
@@ -1096,7 +1099,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,
+ viewport_get_current_vp(), false, NULL);
}
Index: apps/gui/statusbar.c
===================================================================
--- apps/gui/statusbar.c (Revision 21540)
+++ 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 21540)
+++ apps/gui/list.c (Arbeitskopie)
@@ -55,29 +55,35 @@
/* should lines scroll out of the screen */
static bool offset_out_of_view = false;
#endif
-static int force_list_reinit = false;
static void gui_list_select_at_offset(struct gui_synclist * gui_list,
int offset);
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 = viewport_get_current_vp();
+ FOR_NB_SCREENS(i)
+ {
+ if (!parent_used[i])
+ {
+ viewportmanager_set_ui_vp(true);
+ list->parent[i] = &vp[i];
+ }
+ }
+ viewport_set_current_vp(*list->parent);
#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;
}
#else
static struct viewport parent[NB_SCREENS] =
@@ -90,11 +96,7 @@
.height = LCD_HEIGHT
},
};
-void list_init_viewports(struct gui_synclist *list)
-{
- (void)list;
- force_list_reinit = false;
-}
+#define list_init_viewports(a)
#endif
#ifdef HAVE_LCD_BITMAP
@@ -142,7 +144,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);
@@ -162,7 +164,6 @@
gui_list->title_color = -1;
gui_list->callback_get_item_color = NULL;
#endif
- force_list_reinit = true;
}
/* this toggles the selection bar or cursor */
@@ -218,7 +219,7 @@
#ifdef HAVE_BUTTONBAR
static bool last_buttonbar = false;
#endif
- if (force_list_reinit ||
+ if (
#ifdef HAVE_BUTTONBAR
last_buttonbar != screens[SCREEN_MAIN].has_buttonbar ||
#endif
@@ -436,7 +437,6 @@
} else {
gui_list->title_width = 0;
}
- force_list_reinit = true;
}
Index: apps/gui/viewport.c
===================================================================
--- apps/gui/viewport.c (Revision 21540)
+++ apps/gui/viewport.c (Arbeitskopie)
@@ -37,6 +37,20 @@
static int statusbar_enabled = 0;
+#ifdef HAVE_LCD_BITMAP
+static struct {
+ struct viewport* vp;
+ int enabled;
+} ui_vp_info;
+
+static struct viewport custom_vp[NB_SCREENS];
+
+/* callbacks for GUI_EVENT_* events */
+static void viewportmanager_ui_vp_changed(void (*param)(void));
+#endif
+static void viewportmanager_redraw(void* data);
+static void viewportmanager_statusbar_changed(void* data);
+
int viewport_get_nb_lines(struct viewport *vp)
{
#ifdef HAVE_LCD_BITMAP
@@ -57,10 +71,21 @@
return true;
#endif
return false;
-}
+}
void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
{
+#ifdef HAVE_LCD_BITMAP
+ if (ui_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;
@@ -100,7 +125,20 @@
#endif
}
+void viewportmanager_init(void)
+{
+ viewportmanager_set_statusbar(VP_SB_ALLSCREENS);
+ ui_vp_info.enabled = viewport_init_ui_vp();
+ add_event(GUI_EVENT_STATUSBAR_TOGGLE, false,
+ viewportmanager_statusbar_changed);
+ ui_vp_info.vp = custom_vp;
+}
+int viewportmanager_get_statusbar()
+{
+ return statusbar_enabled;
+}
+
int viewportmanager_set_statusbar(int enabled)
{
int old = statusbar_enabled;
@@ -113,16 +151,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)
+static void viewportmanager_redraw(void* data)
{
int i;
@@ -133,8 +171,175 @@
}
}
-void viewportmanager_statusbar_changed(void* data)
+static void viewportmanager_statusbar_changed(void* data)
{
(void)data;
viewportmanager_set_statusbar(statusbar_enabled);
}
+
+#ifdef HAVE_LCD_BITMAP
+void viewportmanager_set_ui_vp(const bool enable)
+{
+ if (enable && !ui_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 */
+ viewportmanager_ui_vp_changed(NULL);
+ }
+ ui_vp_info.enabled = enable;
+}
+
+static void viewportmanager_ui_vp_changed(void (*param)(void))
+{
+ /* if the user changed the theme, we need to initiate a full redraw */
+ int i;
+ /* start with clearing the screen */
+ FOR_NB_SCREENS(i)
+ screens[i].clear_display();
+ /* redraw the statusbar if it got enabled */
+ viewportmanager_set_statusbar(statusbar_enabled);
+ /* call the passed function which will redraw the content of
+ * the current screen */
+ if (param != NULL)
+ param();
+ FOR_NB_SCREENS(i)
+ screens[i].update();
+}
+
+void viewport_set_current_vp(struct viewport* vp)
+{
+ if (vp != NULL)
+ ui_vp_info.vp = vp;
+ else
+ ui_vp_info.vp = custom_vp;
+}
+
+struct viewport* viewport_get_current_vp(void)
+{
+ return ui_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_ui_vp(void)
+{
+ int screen, ret = NB_SCREENS;
+ FOR_NB_SCREENS(screen)
+ {
+#ifdef HAVE_REMOTE_LCD
+ if (screen= SCREEN_REMOTE)
+ {
+ if(!(viewport_parse_viewport(&custom_vp[screen],
+ global_settings.remote_ui_vp_config, ',', screen)))
+ {
+ viewport_set_fullscreen(&custom_vp[screen], screen);
+ ret--;
+ }
+ }
+ else
+#endif
+ {
+ if (!(viewport_parse_viewport(&custom_vp[screen],
+ global_settings.ui_vp_config, ',', screen)))
+ {
+ viewport_set_fullscreen(&custom_vp[screen], screen);
+ ret--;
+ }
+ }
+ }
+ if (ret)
+ add_event(GUI_EVENT_THEME_CHANGED, true,
+ viewportmanager_ui_vp_changed);
+ return ret;
+}
+
+#endif /* HAVE_LCD_BITMAP */
Index: apps/gui/gwps.c
===================================================================
--- apps/gui/gwps.c (Revision 21540)
+++ apps/gui/gwps.c (Arbeitskopie)
@@ -287,6 +287,7 @@
/* Play safe and unregister the hook */
lcd_activation_set_hook(NULL);
#endif
+ viewportmanager_set_ui_vp(true);
}
void gwps_draw_statusbars(void)
@@ -821,6 +822,7 @@
restore = false;
restoretimer = RESTORE_WPS_INSTANTLY;
gwps_fix_statusbars();
+ viewportmanager_set_ui_vp(false);
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
lcd_activation_set_hook(wps_lcd_activation_hook);
#endif
Index: apps/gui/list.h
===================================================================
--- apps/gui/list.h (Revision 21540)
+++ 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/viewport.h
===================================================================
--- apps/gui/viewport.h (Revision 21540)
+++ apps/gui/viewport.h (Arbeitskopie)
@@ -62,8 +62,20 @@
#define VP_SB_ONSCREEN(screen) BIT_N(screen)
#define VP_SB_IGNORE_SETTING(screen) BIT_N(4+screen)
#define VP_SB_ALLSCREENS (VP_SB_ONSCREEN(0)|VP_SB_ONSCREEN(1))
+
+int viewportmanager_get_statusbar(void);
int viewportmanager_set_statusbar(int enabled);
-/* callbacks for GUI_EVENT_* events */
-void viewportmanager_draw_statusbars(void*data);
-void viewportmanager_statusbar_changed(void* data);
+void viewport_set_fullscreen(struct viewport *vp, enum screen_type screen);
+
+#ifdef HAVE_LCD_BITMAP
+const char* viewport_parse_viewport(struct viewport *vp,
+ const char *bufptr, const char seperator, enum screen_type screen);
+void viewportmanager_set_ui_vp(const bool enable);
+int viewport_init_ui_vp(void);
+struct viewport* viewport_get_current_vp(void);
+void viewport_set_current_vp(struct viewport* vp);
+void viewportmanager_init(void);
+#else
+#define viewportmanager_set_ui_vp(a)
+#endif
Index: apps/gui/wps_parser.c
===================================================================
--- apps/gui/wps_parser.c (Revision 21540)
+++ apps/gui/wps_parser.c (Arbeitskopie)
@@ -25,6 +25,7 @@
#include "file.h"
#include "misc.h"
#include "plugin.h"
+#include "viewport.h"
#ifdef __PCTOOL__
#ifdef WPSEDITOR
@@ -586,26 +587,12 @@
{
(void)token; /* Kill warnings */
const char *ptr = wps_bufptr;
- struct viewport* vp;
- int depth;
- uint32_t set = 0;
- enum {
- PL_X = 0,
- PL_Y,
- PL_WIDTH,
- PL_HEIGHT,
- PL_FONT,
- PL_FG,
- PL_BG,
- };
- int lcd_width = LCD_WIDTH, lcd_height = LCD_HEIGHT;
+
+ const int screen =
#ifdef HAVE_REMOTE_LCD
- if (wps_data->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;
@@ -634,88 +621,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 21540)
+++ apps/menu.c (Arbeitskopie)
@@ -344,8 +344,8 @@
const struct menu_item_ex *temp, *menu;
int ret = 0, i;
bool redraw_lists;
- int oldbars = viewportmanager_set_statusbar(
- hide_bars ? VP_SB_HIDE_ALL : VP_SB_ALLSCREENS);
+ int oldbars = viewportmanager_get_statusbar();
+ viewportmanager_set_statusbar(hide_bars ? VP_SB_HIDE_ALL : oldbars);
const struct menu_item_ex *menu_stack[MAX_MENUS];
int menu_stack_selected_item[MAX_MENUS];
Index: apps/settings.h
===================================================================
--- apps/settings.h (Revision 21540)
+++ apps/settings.h (Arbeitskopie)
@@ -736,6 +736,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 ui_vp_config[50]; /* viewport string for the lists */
+#ifdef HAVE_REMOTE_LCD
+ unsigned char remote_ui_vp_config[50]; /* viewport file for the remote lists */
+#endif
+#endif
};
/** global variables **/
Index: apps/appevents.h
===================================================================
--- apps/appevents.h (Revision 21540)
+++ apps/appevents.h (Arbeitskopie)
@@ -49,8 +49,10 @@
/** Generic GUI class events **/
enum {
GUI_EVENT_THEME_CHANGED = (EVENT_CLASS_GUI|1),
+ GUI_EVENT_VIEWPORT_CHANGED,
GUI_EVENT_STATUSBAR_TOGGLE,
GUI_EVENT_ACTIONUPDATE,
+ GUI_EVENT_SPLASH_CLEANUP,
};
#endif
Index: apps/settings_list.c
===================================================================
--- apps/settings_list.c (Revision 21540)
+++ apps/settings_list.c (Arbeitskopie)
@@ -181,6 +181,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";
@@ -1520,6 +1524,14 @@
tsc_is_changed, tsc_set_default),
#endif
OFFON_SETTING(0, prevent_skip, LANG_PREVENT_SKIPPING, false, "prevent track skip", NULL),
+
+ /* Customizable list */
+#ifdef HAVE_LCD_BITMAP
+ VIEWPORT_SETTING(ui_vp_config, "ui viewport", ""),
+#ifdef HAVE_REMOTE_LCD
+ VIEWPORT_SETTING(remote_ui_vp_config, "remote ui viewport", ""),
+#endif
+#endif
};
const int nb_settings = sizeof(settings)/sizeof(*settings);
Index: apps/filetree.c
===================================================================
--- apps/filetree.c (Revision 21540)
+++ apps/filetree.c (Arbeitskopie)
@@ -507,6 +507,7 @@
splash(0, ID2P(LANG_WAIT));
if (!settings_load_config(buf,true))
break;
+ send_event(GUI_EVENT_THEME_CHANGED, NULL);
gui_synclist_draw(&tree_lists);
splash(HZ, ID2P(LANG_SETTINGS_LOADED));
break;
@@ -591,6 +592,8 @@
}
}
+ send_event(GUI_EVENT_SPLASH_CLEANUP, NULL);
+
if ( play ) {
/* the resume_index must always be the index in the
shuffled list in case shuffle is enabled */
Index: apps/plugin.c
===================================================================
--- apps/plugin.c (Revision 21540)
+++ apps/plugin.c (Arbeitskopie)
@@ -662,9 +662,10 @@
int plugin_load(const char* plugin, const void* parameter)
{
- int rc;
+ int rc, i;
int oldbars;
struct plugin_header *hdr;
+ struct viewport plugin_vp[NB_SCREENS];
#ifdef SIMULATOR
void *pd;
#else /* !SIMULATOR */
@@ -769,8 +770,15 @@
lcd_remote_update();
#endif
+ oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
+ viewportmanager_set_ui_vp(false);
+
+ FOR_NB_SCREENS(i)
+ viewport_set_defaults(&plugin_vp[i], i);
+
+ viewport_set_current_vp(plugin_vp);
+
cpucache_invalidate();
- oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
#ifdef HAVE_TOUCHSCREEN
enum touchscreen_mode old_mode = touchscreen_get_mode();
@@ -821,6 +829,8 @@
#endif
viewportmanager_set_statusbar(oldbars);
+ viewportmanager_set_ui_vp(true);
+ viewport_set_current_vp(NULL);
if (pfn_tsr_exit == NULL)
plugin_loaded = false;
Index: apps/root_menu.c
===================================================================
--- apps/root_menu.c (Revision 21540)
+++ apps/root_menu.c (Arbeitskopie)
@@ -193,6 +193,7 @@
}
}
}
+ send_event(GUI_EVENT_SPLASH_CLEANUP, NULL);
if (!tagcache_is_usable())
return GO_TO_PREVIOUS;
filter = SHOW_ID3DB;
Index: apps/debug_menu.c
===================================================================
--- apps/debug_menu.c (Revision 21540)
+++ apps/debug_menu.c (Arbeitskopie)
@@ -398,7 +398,6 @@
lcd_update();
}
-
tick_remove_task(dbg_audio_task);
lcd_setfont(FONT_UI);
@@ -2814,9 +2813,11 @@
if (btn == ACTION_STD_OK)
{
int oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
+ viewportmanager_set_ui_vp(false);
menuitems[gui_synclist_get_sel_pos(lists)].function();
btn = ACTION_REDRAW;
viewportmanager_set_statusbar(oldbars);
+ viewportmanager_set_ui_vp(true);
}
return btn;
}
Index: apps/main.c
===================================================================
--- apps/main.c (Revision 21540)
+++ apps/main.c (Arbeitskopie)
@@ -72,6 +72,7 @@
#include "eeprom_settings.h"
#include "scrobbler.h"
#include "icon.h"
+#include "viewport.h"
#ifdef IPOD_ACCESSORY_PROTOCOL
#include "iap.h"
@@ -136,10 +137,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 21540)
+++ wps/WPSLIST (Arbeitskopie)
@@ -69,6 +69,8 @@
iconset:
viewers iconset:
selector type: bar (inverse)
+ui viewport: -
+remote ui viewport: -
@@ -81,6 +83,8 @@
iconset:
viewers iconset:
selector type: bar (inverse)
+ui viewport: -
+remote ui viewport: -
@@ -93,6 +97,8 @@
viewers iconset:
selector type: bar (inverse)
Statusbar: on
+ui viewport: -
+remote ui viewport: -
@@ -105,6 +111,8 @@
iconset:
viewers iconset:
selector type: bar (inverse)
+ui viewport:
+remote ui viewport:
@@ -152,6 +160,8 @@
iconset:
viewers iconset:
selector type: bar (inverse)
+ui viewport: -
+remote ui viewport: -
@@ -159,6 +169,8 @@
Author: Mike Sobel
Font: 13-Nimbus.fnt
Statusbar: on
+ui viewport: -
+remote ui viewport: -
@@ -173,6 +185,8 @@
iconset:
viewers iconset:
selector type: bar (inverse)
+ui viewport: -
+remote ui viewport: -
@@ -206,6 +220,8 @@
iconset:
viewers iconset:
selector type: bar (inverse)
+ui viewport: -
+remote ui viewport: -
@@ -228,6 +244,8 @@
iconset:
viewers iconset:
selector type: bar (inverse)
+ui viewport: -
+remote ui viewport: -
@@ -261,6 +279,8 @@
iconset:
viewers iconset:
selector type: bar (inverse)
+ui viewport: -
+remote ui viewport: -
@@ -352,6 +372,10 @@
# Whether the WPS is designed to have the statusbar on or off
Statusbar: on
+
+# list & remote ui viewports
+ui viewport: -
+remote ui viewport: -
Index: wps/wpsbuild.pl
===================================================================
--- wps/wpsbuild.pl (Revision 21540)
+++ 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, "ui viewport: $listviewport\n";
+ }
+ if(defined($remotelistviewport) && $has_remote) {
+ push @out, "remote ui 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 =~ /^ui viewport: *(.*)/i) {
+ $listviewport = $1;
+ }
+ elsif($l =~ /^remote ui viewport: *(.*)/i) {
+ $remotelistviewport = $1;
+ }
else{
#print "Unknown line: $l!\n";
}