User definable UI viewport, to be able to restrict the UI into a viewport for all bitmap displays.
Flyspray: FS#8799 This will allow for pretty themes, for example those with nice glass effects on their backdrops (some might argue they're wasting screen space but it's upto them), as well as allowing for future background WPS updates in the main UI. Plugins are not converted yet, they simply use the full screen. Ideally, any plugin that does *not* want the UI viewport, should take care of that itself (i.e. plugins should normally use the UI viewport). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22365 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c0897a8002
commit
4c48b59be8
22 changed files with 355 additions and 104 deletions
|
@ -48,9 +48,9 @@ enum {
|
||||||
|
|
||||||
/** Generic GUI class events **/
|
/** Generic GUI class events **/
|
||||||
enum {
|
enum {
|
||||||
GUI_EVENT_THEME_CHANGED = (EVENT_CLASS_GUI|1),
|
GUI_EVENT_STATUSBAR_TOGGLE = (EVENT_CLASS_GUI|1),
|
||||||
GUI_EVENT_STATUSBAR_TOGGLE,
|
|
||||||
GUI_EVENT_ACTIONUPDATE,
|
GUI_EVENT_ACTIONUPDATE,
|
||||||
|
GUI_EVENT_REFRESH,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -100,6 +100,7 @@
|
||||||
#if CONFIG_RTC == RTC_PCF50605
|
#if CONFIG_RTC == RTC_PCF50605
|
||||||
#include "pcf50605.h"
|
#include "pcf50605.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "appevents.h"
|
||||||
|
|
||||||
#if CONFIG_CPU == DM320 || CONFIG_CPU == S3C2440 || CONFIG_CPU == TCC7801 \
|
#if CONFIG_CPU == DM320 || CONFIG_CPU == S3C2440 || CONFIG_CPU == TCC7801 \
|
||||||
|| CONFIG_CPU == IMX31L || CONFIG_CPU == AS3525 || CONFIG_CPU == JZ4732
|
|| CONFIG_CPU == IMX31L || CONFIG_CPU == AS3525 || CONFIG_CPU == JZ4732
|
||||||
|
@ -2790,6 +2791,7 @@ static int menu_action_callback(int btn, struct gui_synclist *lists)
|
||||||
int oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
|
int oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
|
||||||
menuitems[gui_synclist_get_sel_pos(lists)].function();
|
menuitems[gui_synclist_get_sel_pos(lists)].function();
|
||||||
btn = ACTION_REDRAW;
|
btn = ACTION_REDRAW;
|
||||||
|
send_event(GUI_EVENT_REFRESH, NULL);
|
||||||
viewportmanager_set_statusbar(oldbars);
|
viewportmanager_set_statusbar(oldbars);
|
||||||
}
|
}
|
||||||
return btn;
|
return btn;
|
||||||
|
|
|
@ -181,6 +181,11 @@ static void check_file_thumbnails(struct tree_context* c)
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void filetree_drawlists(void)
|
||||||
|
{
|
||||||
|
gui_synclist_draw(&tree_lists);
|
||||||
|
}
|
||||||
|
|
||||||
/* support function for qsort() */
|
/* support function for qsort() */
|
||||||
static int compare(const void* p1, const void* p2)
|
static int compare(const void* p1, const void* p2)
|
||||||
{
|
{
|
||||||
|
@ -508,7 +513,13 @@ int ft_enter(struct tree_context* c)
|
||||||
splash(0, ID2P(LANG_WAIT));
|
splash(0, ID2P(LANG_WAIT));
|
||||||
if (!settings_load_config(buf,true))
|
if (!settings_load_config(buf,true))
|
||||||
break;
|
break;
|
||||||
gui_synclist_draw(&tree_lists);
|
/* do both steps seperately so that the redrawing after theme
|
||||||
|
* changing is independant of whether the theme has a custom ui
|
||||||
|
* vp or not */
|
||||||
|
send_event(GUI_EVENT_REFRESH, NULL);
|
||||||
|
/* for the statusbar */
|
||||||
|
send_event(GUI_EVENT_ACTIONUPDATE, (void*)true);
|
||||||
|
filetree_drawlists();
|
||||||
splash(HZ, ID2P(LANG_SETTINGS_LOADED));
|
splash(HZ, ID2P(LANG_SETTINGS_LOADED));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -618,6 +629,8 @@ int ft_enter(struct tree_context* c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
send_event(GUI_EVENT_REFRESH, filetree_drawlists);
|
||||||
|
|
||||||
if ( play ) {
|
if ( play ) {
|
||||||
/* the resume_index must always be the index in the
|
/* the resume_index must always be the index in the
|
||||||
shuffled list in case shuffle is enabled */
|
shuffled list in case shuffle is enabled */
|
||||||
|
|
|
@ -55,29 +55,37 @@ static int offset_step = 16; /* pixels per screen scroll step */
|
||||||
/* should lines scroll out of the screen */
|
/* should lines scroll out of the screen */
|
||||||
static bool offset_out_of_view = false;
|
static bool offset_out_of_view = false;
|
||||||
#endif
|
#endif
|
||||||
static int force_list_reinit = false;
|
|
||||||
|
|
||||||
static void gui_list_select_at_offset(struct gui_synclist * gui_list,
|
static void gui_list_select_at_offset(struct gui_synclist * gui_list,
|
||||||
int offset);
|
int offset);
|
||||||
void list_draw(struct screen *display, struct gui_synclist *list);
|
void list_draw(struct screen *display, struct gui_synclist *list);
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
static struct viewport parent[NB_SCREENS];
|
static void list_init_viewports(struct gui_synclist *list)
|
||||||
void list_init_viewports(struct gui_synclist *list)
|
|
||||||
{
|
{
|
||||||
|
struct viewport* vp;
|
||||||
int i;
|
int i;
|
||||||
struct viewport *vp;
|
bool parent_used = (*list->parent != NULL);
|
||||||
FOR_NB_SCREENS(i)
|
if (!parent_used)
|
||||||
{
|
{
|
||||||
vp = &parent[i];
|
vp = viewport_get_current_vp();
|
||||||
if (!list || list->parent[i] == vp)
|
FOR_NB_SCREENS(i)
|
||||||
viewport_set_defaults(vp, i);
|
list->parent[i] = &vp[i];
|
||||||
}
|
}
|
||||||
#ifdef HAVE_BUTTONBAR
|
#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;
|
list->parent[0]->height -= BUTTONBAR_HEIGHT;
|
||||||
#endif
|
#endif
|
||||||
force_list_reinit = false;
|
}
|
||||||
|
#else
|
||||||
|
#define list_init_viewports(a)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
bool list_display_title(struct gui_synclist *list, enum screen_type screen)
|
||||||
|
{
|
||||||
|
return list->title != NULL &&
|
||||||
|
viewport_get_nb_lines(list->parent[screen])>2;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static struct viewport parent[NB_SCREENS] =
|
static struct viewport parent[NB_SCREENS] =
|
||||||
|
@ -90,20 +98,6 @@ static struct viewport parent[NB_SCREENS] =
|
||||||
.height = LCD_HEIGHT
|
.height = LCD_HEIGHT
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
void list_init_viewports(struct gui_synclist *list)
|
|
||||||
{
|
|
||||||
(void)list;
|
|
||||||
force_list_reinit = false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
bool list_display_title(struct gui_synclist *list, enum screen_type screen)
|
|
||||||
{
|
|
||||||
return list->title != NULL &&
|
|
||||||
viewport_get_nb_lines(list->parent[screen])>2;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#define list_display_title(l, i) false
|
#define list_display_title(l, i) false
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -141,9 +135,12 @@ void gui_synclist_init(struct gui_synclist * gui_list,
|
||||||
if (list_parent)
|
if (list_parent)
|
||||||
gui_list->parent[i] = &list_parent[i];
|
gui_list->parent[i] = &list_parent[i];
|
||||||
else
|
else
|
||||||
{
|
gui_list->parent[i] =
|
||||||
gui_list->parent[i] = &parent[i];
|
#ifdef HAVE_LCD_BITMAP
|
||||||
}
|
NULL;
|
||||||
|
#else
|
||||||
|
&parent[i];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
list_init_viewports(gui_list);
|
list_init_viewports(gui_list);
|
||||||
gui_list->limit_scroll = false;
|
gui_list->limit_scroll = false;
|
||||||
|
@ -162,7 +159,6 @@ void gui_synclist_init(struct gui_synclist * gui_list,
|
||||||
gui_list->title_color = -1;
|
gui_list->title_color = -1;
|
||||||
gui_list->callback_get_item_color = NULL;
|
gui_list->callback_get_item_color = NULL;
|
||||||
#endif
|
#endif
|
||||||
force_list_reinit = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this toggles the selection bar or cursor */
|
/* this toggles the selection bar or cursor */
|
||||||
|
@ -218,7 +214,7 @@ void gui_synclist_draw(struct gui_synclist *gui_list)
|
||||||
#ifdef HAVE_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
static bool last_buttonbar = false;
|
static bool last_buttonbar = false;
|
||||||
#endif
|
#endif
|
||||||
if (force_list_reinit ||
|
if (
|
||||||
#ifdef HAVE_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
last_buttonbar != screens[SCREEN_MAIN].has_buttonbar ||
|
last_buttonbar != screens[SCREEN_MAIN].has_buttonbar ||
|
||||||
#endif
|
#endif
|
||||||
|
@ -436,7 +432,6 @@ void gui_synclist_set_title(struct gui_synclist * gui_list,
|
||||||
} else {
|
} else {
|
||||||
gui_list->title_width = 0;
|
gui_list->title_width = 0;
|
||||||
}
|
}
|
||||||
force_list_reinit = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -139,8 +139,6 @@ extern void gui_list_screen_scroll_step(int ofs);
|
||||||
extern void gui_list_screen_scroll_out_of_view(bool enable);
|
extern void gui_list_screen_scroll_out_of_view(bool enable);
|
||||||
#endif /* HAVE_LCD_BITMAP */
|
#endif /* HAVE_LCD_BITMAP */
|
||||||
|
|
||||||
void list_init_viewports(struct gui_synclist * lists);
|
|
||||||
|
|
||||||
extern void gui_synclist_init(
|
extern void gui_synclist_init(
|
||||||
struct gui_synclist * lists,
|
struct gui_synclist * lists,
|
||||||
list_get_name callback_get_item_name,
|
list_get_name callback_get_item_name,
|
||||||
|
|
|
@ -263,7 +263,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
|
||||||
memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info)))
|
memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info)))
|
||||||
{
|
{
|
||||||
struct viewport vp;
|
struct viewport vp;
|
||||||
viewport_set_defaults(&vp, display->screen_type);
|
viewport_set_fullscreen(&vp, display->screen_type);
|
||||||
vp.height = STATUSBAR_HEIGHT;
|
vp.height = STATUSBAR_HEIGHT;
|
||||||
vp.x = STATUSBAR_X_POS;
|
vp.x = STATUSBAR_X_POS;
|
||||||
if (statusbar_position(display->screen_type) != STATUSBAR_BOTTOM)
|
if (statusbar_position(display->screen_type) != STATUSBAR_BOTTOM)
|
||||||
|
|
|
@ -56,6 +56,22 @@
|
||||||
|
|
||||||
static int statusbar_enabled = 0;
|
static int statusbar_enabled = 0;
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
|
||||||
|
static struct {
|
||||||
|
struct viewport* vp;
|
||||||
|
int active;
|
||||||
|
} ui_vp_info;
|
||||||
|
|
||||||
|
static struct viewport custom_vp[NB_SCREENS];
|
||||||
|
|
||||||
|
/* callbacks for GUI_EVENT_* events */
|
||||||
|
static void viewportmanager_ui_vp_changed(void *param);
|
||||||
|
static void statusbar_toggled(void* param);
|
||||||
|
static int viewport_init_ui_vp(void);
|
||||||
|
#endif
|
||||||
|
static void viewportmanager_redraw(void* data);
|
||||||
|
|
||||||
int viewport_get_nb_lines(struct viewport *vp)
|
int viewport_get_nb_lines(struct viewport *vp)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
@ -78,9 +94,9 @@ static bool showing_bars(enum screen_type screen)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
|
void viewport_set_fullscreen(struct viewport *vp, enum screen_type screen)
|
||||||
{
|
{
|
||||||
vp->x = 0;
|
vp->x = 0;
|
||||||
vp->width = screens[screen].lcdwidth;
|
vp->width = screens[screen].lcdwidth;
|
||||||
|
@ -120,6 +136,30 @@ void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
if (ui_vp_info.active)
|
||||||
|
*vp = custom_vp[screen];
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
viewport_set_fullscreen(vp, screen);
|
||||||
|
}
|
||||||
|
|
||||||
|
void viewportmanager_init(void)
|
||||||
|
{
|
||||||
|
viewportmanager_set_statusbar(VP_SB_ALLSCREENS);
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, statusbar_toggled);
|
||||||
|
ui_vp_info.active = viewport_init_ui_vp();
|
||||||
|
ui_vp_info.vp = custom_vp;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int viewportmanager_get_statusbar(void)
|
||||||
|
{
|
||||||
|
return statusbar_enabled;
|
||||||
|
}
|
||||||
|
|
||||||
int viewportmanager_set_statusbar(int enabled)
|
int viewportmanager_set_statusbar(int enabled)
|
||||||
{
|
{
|
||||||
|
@ -133,37 +173,101 @@ int viewportmanager_set_statusbar(int enabled)
|
||||||
if (showing_bars(i))
|
if (showing_bars(i))
|
||||||
gui_statusbar_draw(&statusbars.statusbars[i], true);
|
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
|
else
|
||||||
{
|
{
|
||||||
remove_event(GUI_EVENT_ACTIONUPDATE, viewportmanager_draw_statusbars);
|
remove_event(GUI_EVENT_ACTIONUPDATE, viewportmanager_redraw);
|
||||||
}
|
}
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
void viewportmanager_draw_statusbars(void* data)
|
static void viewportmanager_redraw(void* data)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
{
|
{
|
||||||
if (showing_bars(i))
|
if (showing_bars(i))
|
||||||
gui_statusbar_draw(&statusbars.statusbars[i], (bool)data);
|
gui_statusbar_draw(&statusbars.statusbars[i], NULL != data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
|
||||||
|
static void statusbar_toggled(void* param)
|
||||||
|
{
|
||||||
|
(void)param;
|
||||||
|
/* update vp manager for the new setting and reposition vps
|
||||||
|
* if necessary */
|
||||||
|
viewportmanager_theme_changed(THEME_STATUSBAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
void viewportmanager_theme_changed(int which)
|
||||||
|
{
|
||||||
|
if (which & THEME_UI_VIEWPORT)
|
||||||
|
{
|
||||||
|
/* reset the ui viewport */
|
||||||
|
if ((ui_vp_info.active = viewport_init_ui_vp()))
|
||||||
|
add_event(GUI_EVENT_REFRESH, false, viewportmanager_ui_vp_changed);
|
||||||
|
else
|
||||||
|
remove_event(GUI_EVENT_REFRESH, viewportmanager_ui_vp_changed);
|
||||||
|
/* and point to it */
|
||||||
|
ui_vp_info.vp = custom_vp;
|
||||||
|
}
|
||||||
|
if (which & THEME_STATUSBAR)
|
||||||
|
{
|
||||||
|
statusbar_enabled = 0;
|
||||||
|
if (global_settings.statusbar != STATUSBAR_OFF)
|
||||||
|
statusbar_enabled = VP_SB_ONSCREEN(SCREEN_MAIN);
|
||||||
|
#ifdef HAVE_REMOTE_LCD
|
||||||
|
if (global_settings.remote_statusbar != STATUSBAR_OFF)
|
||||||
|
statusbar_enabled |= VP_SB_ONSCREEN(SCREEN_REMOTE);
|
||||||
|
#endif
|
||||||
|
if (statusbar_enabled)
|
||||||
|
add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_redraw);
|
||||||
|
else
|
||||||
|
remove_event(GUI_EVENT_ACTIONUPDATE, viewportmanager_redraw);
|
||||||
|
|
||||||
|
/* reposition viewport to fit statusbar, only if not using the ui vp */
|
||||||
|
if (!ui_vp_info.active)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
FOR_NB_SCREENS(i)
|
||||||
|
viewport_set_fullscreen(&custom_vp[i], i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void viewportmanager_statusbar_changed(void* data)
|
static void viewportmanager_ui_vp_changed(void *param)
|
||||||
{
|
{
|
||||||
(void)data;
|
/* if the user changed the theme, we need to initiate a full redraw */
|
||||||
statusbar_enabled = 0;
|
int i;
|
||||||
if (global_settings.statusbar != STATUSBAR_OFF)
|
/* cast param to a function */
|
||||||
statusbar_enabled = VP_SB_ONSCREEN(SCREEN_MAIN);
|
void (*draw_func)(void) = ((void(*)(void))param);
|
||||||
#ifdef HAVE_REMOTE_LCD
|
/* start with clearing the screen */
|
||||||
if (global_settings.remote_statusbar != STATUSBAR_OFF)
|
FOR_NB_SCREENS(i)
|
||||||
statusbar_enabled |= VP_SB_ONSCREEN(SCREEN_REMOTE);
|
screens[i].clear_display();
|
||||||
#endif
|
/* redraw the statusbar if it was enabled */
|
||||||
viewportmanager_set_statusbar(statusbar_enabled);
|
viewportmanager_set_statusbar(statusbar_enabled);
|
||||||
|
/* call the passed function which will redraw the content of
|
||||||
|
* the current screen */
|
||||||
|
if (param != NULL)
|
||||||
|
draw_func();
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
@ -172,7 +276,6 @@ void viewportmanager_statusbar_changed(void* data)
|
||||||
#define ARG_STRING(_depth) "dddddgg"
|
#define ARG_STRING(_depth) "dddddgg"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
const char* viewport_parse_viewport(struct viewport *vp,
|
const char* viewport_parse_viewport(struct viewport *vp,
|
||||||
enum screen_type screen,
|
enum screen_type screen,
|
||||||
const char *bufptr,
|
const char *bufptr,
|
||||||
|
@ -213,9 +316,9 @@ const char* viewport_parse_viewport(struct viewport *vp,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#undef ARG_STRING
|
|
||||||
#endif
|
#endif
|
||||||
{}
|
{}
|
||||||
|
#undef ARG_STRING
|
||||||
|
|
||||||
/* X and Y *must* be set */
|
/* X and Y *must* be set */
|
||||||
if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y))
|
if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y))
|
||||||
|
@ -259,4 +362,40 @@ const char* viewport_parse_viewport(struct viewport *vp,
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (re)parse the UI vp from the settings
|
||||||
|
* - Returns
|
||||||
|
* 0 if no UI vp is used
|
||||||
|
* >0 if it's used at least partly (on multiscreen targets)
|
||||||
|
* NB_SCREENS if all screens have a UI vp
|
||||||
|
*/
|
||||||
|
static 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], screen,
|
||||||
|
global_settings.remote_ui_vp_config, ',')))
|
||||||
|
{
|
||||||
|
viewport_set_fullscreen(&custom_vp[screen], screen);
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
if (!(viewport_parse_viewport(&custom_vp[screen], screen,
|
||||||
|
global_settings.ui_vp_config, ',')))
|
||||||
|
{
|
||||||
|
viewport_set_fullscreen(&custom_vp[screen], screen);
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* HAVE_LCD_BITMAP */
|
#endif /* HAVE_LCD_BITMAP */
|
||||||
|
|
|
@ -34,26 +34,6 @@ int viewport_get_nb_lines(struct viewport *vp);
|
||||||
|
|
||||||
void viewport_set_defaults(struct viewport *vp, enum screen_type screen);
|
void viewport_set_defaults(struct viewport *vp, enum screen_type screen);
|
||||||
|
|
||||||
/* Parse a viewport definition (vp_def), which looks like:
|
|
||||||
*
|
|
||||||
* Screens with depth > 1:
|
|
||||||
* X|Y|width|height|font|foregorund color|background color
|
|
||||||
* Screens with depth = 1:
|
|
||||||
* X|Y|width|height|font
|
|
||||||
*
|
|
||||||
* | is a separator and can be specified via the parameter
|
|
||||||
*
|
|
||||||
* Returns the pointer to the char after the last character parsed
|
|
||||||
* if everything went OK or NULL if an error happened (some values
|
|
||||||
* not specified in the definition)
|
|
||||||
*/
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
const char* viewport_parse_viewport(struct viewport *vp,
|
|
||||||
enum screen_type screen,
|
|
||||||
const char *vp_def,
|
|
||||||
const char separator);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Used to specify which screens the statusbar (SB) should be displayed on.
|
/* Used to specify which screens the statusbar (SB) should be displayed on.
|
||||||
*
|
*
|
||||||
* The parameter is a bit OR'ed combination of the following (screen is
|
* The parameter is a bit OR'ed combination of the following (screen is
|
||||||
|
@ -74,14 +54,70 @@ const char* viewport_parse_viewport(struct viewport *vp,
|
||||||
* Returns the status before the call. This value can be used to restore the
|
* Returns the status before the call. This value can be used to restore the
|
||||||
* SB "displaying rules".
|
* SB "displaying rules".
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define THEME_STATUSBAR (BIT_N(0))
|
||||||
|
#define THEME_UI_VIEWPORT (BIT_N(1))
|
||||||
|
#define THEME_ALL (~(0u))
|
||||||
|
|
||||||
#define VP_SB_HIDE_ALL 0
|
#define VP_SB_HIDE_ALL 0
|
||||||
#define VP_SB_ONSCREEN(screen) BIT_N(screen)
|
#define VP_SB_ONSCREEN(screen) BIT_N(screen)
|
||||||
#define VP_SB_IGNORE_SETTING(screen) BIT_N(4+screen)
|
#define VP_SB_IGNORE_SETTING(screen) BIT_N(4+screen)
|
||||||
#define VP_SB_ALLSCREENS (VP_SB_ONSCREEN(0)|VP_SB_ONSCREEN(1))
|
#define VP_SB_ALLSCREENS (VP_SB_ONSCREEN(0)|VP_SB_ONSCREEN(1))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Initialize the viewportmanager, which in turns initializes the UI vp and
|
||||||
|
* statusbar stuff
|
||||||
|
*/
|
||||||
|
void viewportmanager_init(void);
|
||||||
|
int viewportmanager_get_statusbar(void);
|
||||||
int viewportmanager_set_statusbar(int enabled);
|
int viewportmanager_set_statusbar(int enabled);
|
||||||
|
|
||||||
/* callbacks for GUI_EVENT_* events */
|
/* call this when a theme changed */
|
||||||
void viewportmanager_draw_statusbars(void*data);
|
void viewportmanager_theme_changed(int);
|
||||||
void viewportmanager_statusbar_changed(void* data);
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Initializes the given viewport with maximum dimensions minus status- and
|
||||||
|
* buttonbar
|
||||||
|
*/
|
||||||
|
void viewport_set_fullscreen(struct viewport *vp, enum screen_type screen);
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Parse a viewport definition (vp_def), which looks like:
|
||||||
|
*
|
||||||
|
* Screens with depth > 1:
|
||||||
|
* X|Y|width|height|font|foregorund color|background color
|
||||||
|
* Screens with depth = 1:
|
||||||
|
* X|Y|width|height|font
|
||||||
|
*
|
||||||
|
* | is a separator and can be specified via the parameter
|
||||||
|
*
|
||||||
|
* Returns the pointer to the char after the last character parsed
|
||||||
|
* if everything went OK or NULL if an error happened (some values
|
||||||
|
* not specified in the definition)
|
||||||
|
*/
|
||||||
|
const char* viewport_parse_viewport(struct viewport *vp,
|
||||||
|
enum screen_type screen,
|
||||||
|
const char *vp_def,
|
||||||
|
const char separator);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns a pointer to the current viewport
|
||||||
|
* - That could be the UI vp, or a viewport passed to do_menu() or the like
|
||||||
|
*/
|
||||||
|
struct viewport* viewport_get_current_vp(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set the UI vp pointer to a different one - NULL to reset to the UI vp
|
||||||
|
*
|
||||||
|
* This is needed since the UI viewport needs is kept in RAM.
|
||||||
|
*/
|
||||||
|
void viewport_set_current_vp(struct viewport* vp);
|
||||||
|
|
||||||
|
#else /* HAVE_LCD_CHARCELL */
|
||||||
|
#define viewport_set_current_vp(a)
|
||||||
|
#define viewport_get_current_vp() NULL
|
||||||
|
#endif
|
||||||
#endif /* __VIEWPORT_H__ */
|
#endif /* __VIEWPORT_H__ */
|
||||||
|
|
|
@ -565,6 +565,7 @@ static void gwps_leave_wps(void)
|
||||||
/* Play safe and unregister the hook */
|
/* Play safe and unregister the hook */
|
||||||
lcd_activation_set_hook(NULL);
|
lcd_activation_set_hook(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
send_event(GUI_EVENT_REFRESH, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwps_draw_statusbars(void)
|
void gwps_draw_statusbars(void)
|
||||||
|
|
11
apps/main.c
11
apps/main.c
|
@ -72,6 +72,7 @@
|
||||||
#include "eeprom_settings.h"
|
#include "eeprom_settings.h"
|
||||||
#include "scrobbler.h"
|
#include "scrobbler.h"
|
||||||
#include "icon.h"
|
#include "icon.h"
|
||||||
|
#include "viewport.h"
|
||||||
|
|
||||||
#ifdef IPOD_ACCESSORY_PROTOCOL
|
#ifdef IPOD_ACCESSORY_PROTOCOL
|
||||||
#include "iap.h"
|
#include "iap.h"
|
||||||
|
@ -135,9 +136,8 @@ static void app_main(void)
|
||||||
screens[i].update();
|
screens[i].update();
|
||||||
}
|
}
|
||||||
tree_gui_init();
|
tree_gui_init();
|
||||||
viewportmanager_set_statusbar(VP_SB_ALLSCREENS);
|
gui_syncstatusbar_init(&statusbars);
|
||||||
add_event(GUI_EVENT_STATUSBAR_TOGGLE, false,
|
viewportmanager_init();
|
||||||
viewportmanager_statusbar_changed);
|
|
||||||
#ifdef HAVE_USBSTACK
|
#ifdef HAVE_USBSTACK
|
||||||
/* All threads should be created and public queues registered by now */
|
/* All threads should be created and public queues registered by now */
|
||||||
usb_start_monitoring();
|
usb_start_monitoring();
|
||||||
|
@ -296,8 +296,6 @@ static void init(void)
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
debug_init();
|
debug_init();
|
||||||
#endif
|
#endif
|
||||||
/* Must be done before any code uses the multi-screen APi */
|
|
||||||
gui_syncstatusbar_init(&statusbars);
|
|
||||||
storage_init();
|
storage_init();
|
||||||
settings_reset();
|
settings_reset();
|
||||||
settings_load(SETTINGS_ALL);
|
settings_load(SETTINGS_ALL);
|
||||||
|
@ -419,9 +417,6 @@ static void init(void)
|
||||||
radio_init();
|
radio_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Must be done before any code uses the multi-screen APi */
|
|
||||||
gui_syncstatusbar_init(&statusbars);
|
|
||||||
|
|
||||||
#if CONFIG_CHARGING && (CONFIG_CPU == SH7034)
|
#if CONFIG_CHARGING && (CONFIG_CPU == SH7034)
|
||||||
/* charger_inserted() can't be used here because power_thread()
|
/* charger_inserted() can't be used here because power_thread()
|
||||||
hasn't checked power_input_status() yet */
|
hasn't checked power_input_status() yet */
|
||||||
|
|
|
@ -342,8 +342,8 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
|
||||||
const struct menu_item_ex *temp, *menu;
|
const struct menu_item_ex *temp, *menu;
|
||||||
int ret = 0, i;
|
int ret = 0, i;
|
||||||
bool redraw_lists;
|
bool redraw_lists;
|
||||||
int oldbars = viewportmanager_set_statusbar(
|
int oldbars = viewportmanager_get_statusbar();
|
||||||
hide_bars ? VP_SB_HIDE_ALL : VP_SB_ALLSCREENS);
|
viewportmanager_set_statusbar(hide_bars ? VP_SB_HIDE_ALL : oldbars);
|
||||||
|
|
||||||
const struct menu_item_ex *menu_stack[MAX_MENUS];
|
const struct menu_item_ex *menu_stack[MAX_MENUS];
|
||||||
int menu_stack_selected_item[MAX_MENUS];
|
int menu_stack_selected_item[MAX_MENUS];
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
#include "screens.h"
|
#include "screens.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "viewport.h"
|
||||||
|
|
||||||
#ifdef HAVE_BACKLIGHT
|
#ifdef HAVE_BACKLIGHT
|
||||||
static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item)
|
static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item)
|
||||||
|
@ -313,8 +314,7 @@ static int statusbar_callback(int action,const struct menu_item_ex *this_item)
|
||||||
{
|
{
|
||||||
case ACTION_EXIT_MENUITEM:
|
case ACTION_EXIT_MENUITEM:
|
||||||
send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL);
|
send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL);
|
||||||
/* this should be changed so only the viewports are reloaded */
|
send_event(GUI_EVENT_ACTIONUPDATE, (void*)true);
|
||||||
settings_apply(false);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return action;
|
return action;
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include "lcd-remote.h"
|
#include "lcd-remote.h"
|
||||||
#include "backdrop.h"
|
#include "backdrop.h"
|
||||||
#include "exported_menus.h"
|
#include "exported_menus.h"
|
||||||
|
#include "appevents.h"
|
||||||
|
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
/**
|
/**
|
||||||
|
@ -47,6 +48,7 @@ static int clear_main_backdrop(void)
|
||||||
global_settings.backdrop_file[0]=0;
|
global_settings.backdrop_file[0]=0;
|
||||||
backdrop_unload(BACKDROP_MAIN);
|
backdrop_unload(BACKDROP_MAIN);
|
||||||
backdrop_show(BACKDROP_MAIN);
|
backdrop_show(BACKDROP_MAIN);
|
||||||
|
send_event(GUI_EVENT_REFRESH, NULL);
|
||||||
settings_save();
|
settings_save();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -673,10 +673,10 @@ static const struct plugin_api rockbox_api = {
|
||||||
|
|
||||||
int plugin_load(const char* plugin, const void* parameter)
|
int plugin_load(const char* plugin, const void* parameter)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc, i;
|
||||||
int i;
|
|
||||||
int oldbars;
|
int oldbars;
|
||||||
struct plugin_header *hdr;
|
struct plugin_header *hdr;
|
||||||
|
struct viewport plugin_vp[NB_SCREENS];
|
||||||
#ifdef SIMULATOR
|
#ifdef SIMULATOR
|
||||||
void *pd;
|
void *pd;
|
||||||
#else /* !SIMULATOR */
|
#else /* !SIMULATOR */
|
||||||
|
@ -781,8 +781,14 @@ int plugin_load(const char* plugin, const void* parameter)
|
||||||
lcd_remote_update();
|
lcd_remote_update();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cpucache_invalidate();
|
|
||||||
oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
|
oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
|
||||||
|
|
||||||
|
FOR_NB_SCREENS(i)
|
||||||
|
viewport_set_fullscreen(&plugin_vp[i], i);
|
||||||
|
|
||||||
|
viewport_set_current_vp(plugin_vp);
|
||||||
|
|
||||||
|
cpucache_invalidate();
|
||||||
|
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
touchscreen_set_mode(TOUCHSCREEN_BUTTON);
|
touchscreen_set_mode(TOUCHSCREEN_BUTTON);
|
||||||
|
@ -826,14 +832,11 @@ int plugin_load(const char* plugin, const void* parameter)
|
||||||
|
|
||||||
if (rc != PLUGIN_GOTO_WPS)
|
if (rc != PLUGIN_GOTO_WPS)
|
||||||
{
|
{
|
||||||
FOR_NB_SCREENS(i)
|
send_event(GUI_EVENT_REFRESH, NULL);
|
||||||
{
|
|
||||||
screens[i].clear_display();
|
|
||||||
screens[i].update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
viewportmanager_set_statusbar(oldbars);
|
viewportmanager_set_statusbar(oldbars);
|
||||||
|
viewport_set_current_vp(NULL);
|
||||||
if (pfn_tsr_exit == NULL)
|
if (pfn_tsr_exit == NULL)
|
||||||
plugin_loaded = false;
|
plugin_loaded = false;
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include "viewport.h"
|
#include "viewport.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "splash.h"
|
#include "splash.h"
|
||||||
|
#include "appevents.h"
|
||||||
|
|
||||||
#ifndef O_BINARY
|
#ifndef O_BINARY
|
||||||
#define O_BINARY 0
|
#define O_BINARY 0
|
||||||
|
@ -1243,11 +1244,13 @@ int kbd_input(char* text, int buflen)
|
||||||
global_settings.buttonbar = buttonbar_config;
|
global_settings.buttonbar = buttonbar_config;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (ret < 0)
|
||||||
|
splash(HZ/2, ID2P(LANG_CANCEL));
|
||||||
|
|
||||||
FOR_NB_SCREENS(l)
|
FOR_NB_SCREENS(l)
|
||||||
screens[l].setfont(FONT_UI);
|
screens[l].setfont(FONT_UI);
|
||||||
viewportmanager_set_statusbar(oldbars);
|
viewportmanager_set_statusbar(oldbars);
|
||||||
|
send_event(GUI_EVENT_REFRESH, NULL);
|
||||||
|
|
||||||
if (ret < 0)
|
|
||||||
splash(HZ/2, ID2P(LANG_CANCEL));
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,7 @@
|
||||||
#include "viewport.h"
|
#include "viewport.h"
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
|
#include "appevents.h"
|
||||||
|
|
||||||
#ifdef HAVE_RECORDING
|
#ifdef HAVE_RECORDING
|
||||||
/* This array holds the record timer interval lengths, in seconds */
|
/* This array holds the record timer interval lengths, in seconds */
|
||||||
|
@ -1924,9 +1925,11 @@ rec_abort:
|
||||||
rec_status &= ~RCSTAT_IN_RECSCREEN;
|
rec_status &= ~RCSTAT_IN_RECSCREEN;
|
||||||
sound_settings_apply();
|
sound_settings_apply();
|
||||||
|
|
||||||
viewportmanager_set_statusbar(oldbars);
|
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
screens[i].setfont(FONT_UI);
|
screens[i].setfont(FONT_UI);
|
||||||
|
|
||||||
|
viewportmanager_set_statusbar(oldbars);
|
||||||
|
send_event(GUI_EVENT_REFRESH, NULL);
|
||||||
|
|
||||||
/* if the directory was created or recording happened, make sure the
|
/* if the directory was created or recording happened, make sure the
|
||||||
browser is updated */
|
browser is updated */
|
||||||
|
|
|
@ -192,6 +192,7 @@ static int browser(void* param)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
send_event(GUI_EVENT_REFRESH, NULL);
|
||||||
if (!tagcache_is_usable())
|
if (!tagcache_is_usable())
|
||||||
return GO_TO_PREVIOUS;
|
return GO_TO_PREVIOUS;
|
||||||
filter = SHOW_ID3DB;
|
filter = SHOW_ID3DB;
|
||||||
|
|
|
@ -65,12 +65,12 @@
|
||||||
#include "filetypes.h"
|
#include "filetypes.h"
|
||||||
#include "option_select.h"
|
#include "option_select.h"
|
||||||
#include "backdrop.h"
|
#include "backdrop.h"
|
||||||
#include "appevents.h"
|
|
||||||
#if CONFIG_TUNER
|
#if CONFIG_TUNER
|
||||||
#include "radio.h"
|
#include "radio.h"
|
||||||
#endif
|
#endif
|
||||||
#include "wps.h"
|
#include "wps.h"
|
||||||
#include "skin_engine/skin_engine.h"
|
#include "skin_engine/skin_engine.h"
|
||||||
|
#include "viewport.h"
|
||||||
|
|
||||||
#if CONFIG_CODEC == MAS3507D
|
#if CONFIG_CODEC == MAS3507D
|
||||||
void dac_line_in(bool enable);
|
void dac_line_in(bool enable);
|
||||||
|
@ -761,6 +761,7 @@ void settings_apply_skins(void)
|
||||||
|
|
||||||
void settings_apply(bool read_disk)
|
void settings_apply(bool read_disk)
|
||||||
{
|
{
|
||||||
|
|
||||||
char buf[64];
|
char buf[64];
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
int i;
|
int i;
|
||||||
|
@ -985,9 +986,9 @@ void settings_apply(bool read_disk)
|
||||||
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
|
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
|
||||||
enc_global_settings_apply();
|
enc_global_settings_apply();
|
||||||
#endif
|
#endif
|
||||||
send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL);
|
#ifdef HAVE_LCD_BITMAP
|
||||||
list_init_viewports(NULL);
|
viewportmanager_theme_changed(THEME_ALL);
|
||||||
send_event(GUI_EVENT_ACTIONUPDATE, (void*)true);
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1109,7 +1110,8 @@ bool set_int_ex(const unsigned char* string,
|
||||||
item.lang_id = -1;
|
item.lang_id = -1;
|
||||||
item.cfg_vals = (char*)string;
|
item.cfg_vals = (char*)string;
|
||||||
item.setting = (void *)variable;
|
item.setting = (void *)variable;
|
||||||
return option_screen(&item, NULL, false, NULL);
|
return option_screen(&item,
|
||||||
|
viewport_get_current_vp(), false, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -762,6 +762,13 @@ struct user_settings
|
||||||
/* If values are just added to the end, no need to bump plugin API
|
/* If values are just added to the end, no need to bump plugin API
|
||||||
version. */
|
version. */
|
||||||
/* new stuff to be added at the end */
|
/* new stuff to be added at the end */
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
unsigned char ui_vp_config[64]; /* viewport string for the lists */
|
||||||
|
#ifdef HAVE_REMOTE_LCD
|
||||||
|
unsigned char remote_ui_vp_config[64]; /* viewport string for the remote lists */
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/** global variables **/
|
/** global variables **/
|
||||||
|
|
|
@ -180,6 +180,10 @@
|
||||||
{.custom = (void*)default}, name, NULL, \
|
{.custom = (void*)default}, name, NULL, \
|
||||||
{.custom_setting = (struct custom_setting[]){ \
|
{.custom_setting = (struct custom_setting[]){ \
|
||||||
{load_from_cfg, write_to_cfg, is_change, set_default}}}}
|
{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 */
|
/* 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[] = "off,on";
|
||||||
static const char off_on_ask[] = "off,on,ask";
|
static const char off_on_ask[] = "off,on,ask";
|
||||||
|
@ -1539,6 +1543,13 @@ const struct settings_list settings[] = {
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* 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);
|
const int nb_settings = sizeof(settings)/sizeof(*settings);
|
||||||
|
|
24
wps/WPSLIST
24
wps/WPSLIST
|
@ -69,6 +69,8 @@ backdrop:
|
||||||
iconset:
|
iconset:
|
||||||
viewers iconset:
|
viewers iconset:
|
||||||
selector type: bar (inverse)
|
selector type: bar (inverse)
|
||||||
|
ui viewport: -
|
||||||
|
remote ui viewport: -
|
||||||
</wps>
|
</wps>
|
||||||
|
|
||||||
<wps>
|
<wps>
|
||||||
|
@ -81,6 +83,8 @@ backdrop:
|
||||||
iconset:
|
iconset:
|
||||||
viewers iconset:
|
viewers iconset:
|
||||||
selector type: bar (inverse)
|
selector type: bar (inverse)
|
||||||
|
ui viewport: -
|
||||||
|
remote ui viewport: -
|
||||||
</wps>
|
</wps>
|
||||||
|
|
||||||
<wps>
|
<wps>
|
||||||
|
@ -93,6 +97,8 @@ iconset:
|
||||||
viewers iconset:
|
viewers iconset:
|
||||||
selector type: bar (inverse)
|
selector type: bar (inverse)
|
||||||
Statusbar: top
|
Statusbar: top
|
||||||
|
ui viewport: -
|
||||||
|
remote ui viewport: -
|
||||||
</wps>
|
</wps>
|
||||||
|
|
||||||
<wps>
|
<wps>
|
||||||
|
@ -105,6 +111,8 @@ backdrop:
|
||||||
iconset:
|
iconset:
|
||||||
viewers iconset:
|
viewers iconset:
|
||||||
selector type: bar (inverse)
|
selector type: bar (inverse)
|
||||||
|
ui viewport:
|
||||||
|
remote ui viewport:
|
||||||
</wps>
|
</wps>
|
||||||
|
|
||||||
<rwps>
|
<rwps>
|
||||||
|
@ -152,6 +160,8 @@ backdrop:
|
||||||
iconset:
|
iconset:
|
||||||
viewers iconset:
|
viewers iconset:
|
||||||
selector type: bar (inverse)
|
selector type: bar (inverse)
|
||||||
|
ui viewport: -
|
||||||
|
remote ui viewport: -
|
||||||
</wps>
|
</wps>
|
||||||
|
|
||||||
<rwps>
|
<rwps>
|
||||||
|
@ -159,6 +169,8 @@ Name: marquee.rwps
|
||||||
Author: Mike Sobel
|
Author: Mike Sobel
|
||||||
Font: 13-Nimbus.fnt
|
Font: 13-Nimbus.fnt
|
||||||
Statusbar: top
|
Statusbar: top
|
||||||
|
ui viewport: -
|
||||||
|
remote ui viewport: -
|
||||||
</rwps>
|
</rwps>
|
||||||
|
|
||||||
<wps>
|
<wps>
|
||||||
|
@ -173,6 +185,8 @@ backdrop:
|
||||||
iconset:
|
iconset:
|
||||||
viewers iconset:
|
viewers iconset:
|
||||||
selector type: bar (inverse)
|
selector type: bar (inverse)
|
||||||
|
ui viewport: -
|
||||||
|
remote ui viewport: -
|
||||||
</wps>
|
</wps>
|
||||||
|
|
||||||
<rwps>
|
<rwps>
|
||||||
|
@ -206,6 +220,8 @@ backdrop:
|
||||||
iconset:
|
iconset:
|
||||||
viewers iconset:
|
viewers iconset:
|
||||||
selector type: bar (inverse)
|
selector type: bar (inverse)
|
||||||
|
ui viewport: -
|
||||||
|
remote ui viewport: -
|
||||||
</wps>
|
</wps>
|
||||||
|
|
||||||
<rwps>
|
<rwps>
|
||||||
|
@ -228,6 +244,8 @@ backdrop:
|
||||||
iconset:
|
iconset:
|
||||||
viewers iconset:
|
viewers iconset:
|
||||||
selector type: bar (inverse)
|
selector type: bar (inverse)
|
||||||
|
ui viewport: -
|
||||||
|
remote ui viewport: -
|
||||||
</wps>
|
</wps>
|
||||||
|
|
||||||
<rwps>
|
<rwps>
|
||||||
|
@ -261,6 +279,8 @@ backdrop:
|
||||||
iconset:
|
iconset:
|
||||||
viewers iconset:
|
viewers iconset:
|
||||||
selector type: bar (inverse)
|
selector type: bar (inverse)
|
||||||
|
ui viewport: -
|
||||||
|
remote ui viewport: -
|
||||||
</wps>
|
</wps>
|
||||||
|
|
||||||
<wps>
|
<wps>
|
||||||
|
@ -352,6 +372,10 @@ viewers iconset.240x400x16: /.rockbox/icons/tango_small_viewers.bmp
|
||||||
|
|
||||||
# Whether the WPS is designed to have the statusbar on or off
|
# Whether the WPS is designed to have the statusbar on or off
|
||||||
Statusbar: top
|
Statusbar: top
|
||||||
|
|
||||||
|
# list & remote ui viewports
|
||||||
|
ui viewport: -
|
||||||
|
remote ui viewport: -
|
||||||
</wps>
|
</wps>
|
||||||
|
|
||||||
<rwps>
|
<rwps>
|
||||||
|
|
|
@ -53,6 +53,8 @@ my $iconset;
|
||||||
my $viewericon;
|
my $viewericon;
|
||||||
my $lineselecttextcolor;
|
my $lineselecttextcolor;
|
||||||
my $filetylecolor;
|
my $filetylecolor;
|
||||||
|
my $listviewport;
|
||||||
|
my $remotelistviewport;
|
||||||
|
|
||||||
# LCD sizes
|
# LCD sizes
|
||||||
my ($main_height, $main_width, $main_depth);
|
my ($main_height, $main_width, $main_depth);
|
||||||
|
@ -293,6 +295,12 @@ MOO
|
||||||
if($rwps && $has_remote ) {
|
if($rwps && $has_remote ) {
|
||||||
push @out, "rwps: /$rbdir/wps/$rwps\n";
|
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") {
|
if(-f "$rbdir/wps/$cfg") {
|
||||||
print STDERR "wpsbuild warning: wps/$cfg already exists!\n";
|
print STDERR "wpsbuild warning: wps/$cfg already exists!\n";
|
||||||
}
|
}
|
||||||
|
@ -347,6 +355,8 @@ while(<WPS>) {
|
||||||
undef $viewericon;
|
undef $viewericon;
|
||||||
undef $lineselecttextcolor;
|
undef $lineselecttextcolor;
|
||||||
undef $filetylecolor;
|
undef $filetylecolor;
|
||||||
|
undef $listviewport;
|
||||||
|
undef $remotelistviewport;
|
||||||
|
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
@ -513,6 +523,12 @@ while(<WPS>) {
|
||||||
elsif($l =~ /^filetype colours: *(.*)/i) {
|
elsif($l =~ /^filetype colours: *(.*)/i) {
|
||||||
$filetylecolor = $1;
|
$filetylecolor = $1;
|
||||||
}
|
}
|
||||||
|
elsif($l =~ /^ui viewport: *(.*)/i) {
|
||||||
|
$listviewport = $1;
|
||||||
|
}
|
||||||
|
elsif($l =~ /^remote ui viewport: *(.*)/i) {
|
||||||
|
$remotelistviewport = $1;
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
#print "Unknown line: $l!\n";
|
#print "Unknown line: $l!\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue