Initial custom statusbar commit.

The custom statusbar can be used as a WPS for the main UI, using .(r)sbs files. It's using the skin engine and knows all tags the WPS also knows.
The default folder for .sbs is the wps folder to reuse images used in the WPS.
As it can be shown in the WPS also, it's useful to move shared parts to the custom statusbar in order to save skin buffer space.
There are a few restrictions/TODOs:
*) Peak meter doesn't redraw nicely(not frequent enough), as very frequent updates would slow the UI down as hell (some targets fight with it in the WPS already: FS#10686)
*) No touchregion support as the statusbar doesn't have any action handling (it won't fail to parse though).
*) Drawing stuff into the default VP is forbidden (loading images in it is not). You *need* to use viewports for the displaying stuff (parsing fails if no viewport is used).
*) Themes that don't use a custom ui viewport can be fixed up using the new %Vi tag to avoid nasty redraw effectts (you must not draw into it as well, it's used to fix up the ui viewport). %Vi describes the viewport that the lists can use without getting in the way of the statusbar.

Otherwise, it behaves like the classic statusbar, it can be configured in the theme settings, and can be turned off in the wps using %wd.

Note to translaters: When translating LANG_STATUSBAR_CUSTOM, please consider using the same translation as for LANG_CHANNEL_CUSTOM if it's compatible. They could be combined later then.

Flyspray: FS#10566
Author: myself

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23258 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-10-19 15:28:15 +00:00
parent 00695baac0
commit 1016ee4e80
25 changed files with 585 additions and 147 deletions

View file

@ -81,6 +81,9 @@ gui/wps.c
gui/scrollbar.c
gui/splash.c
gui/statusbar.c
#ifdef HAVE_LCD_BITMAP
gui/statusbar-skinned.c
#endif
gui/yesno.c
gui/viewport.c

View file

@ -477,7 +477,26 @@ int ft_enter(struct tree_context* c)
break;
#endif
#ifdef HAVE_LCD_BITMAP
case FILE_ATTR_SBS:
splash(0, ID2P(LANG_WAIT));
set_file(buf, (char *)global_settings.sbs_file,
MAX_FILENAME);
global_settings.statusbar = STATUSBAR_CUSTOM;
settings_apply_skins();
viewportmanager_theme_changed(THEME_STATUSBAR);
break;
#endif
#ifdef HAVE_REMOTE_LCD
case FILE_ATTR_RSBS:
splash(0, ID2P(LANG_WAIT));
set_file(buf, (char *)global_settings.rsbs_file,
MAX_FILENAME);
global_settings.remote_statusbar = STATUSBAR_CUSTOM;
settings_apply_skins();
viewportmanager_theme_changed(THEME_STATUSBAR);
break;
#endif
/* wps config file */
case FILE_ATTR_WPS:
splash(0, ID2P(LANG_WAIT));

View file

@ -108,6 +108,12 @@ static const struct filetype inbuilt_filetypes[] = {
#endif
{ "bmark",FILE_ATTR_BMARK, Icon_Bookmark, VOICE_EXT_BMARK },
{ "cue", FILE_ATTR_CUE, Icon_Bookmark, VOICE_EXT_CUESHEET },
#ifdef HAVE_LCD_BITMAP
{ "sbs", FILE_ATTR_SBS, Icon_Wps, VOICE_EXT_SBS },
#endif
#ifdef HAVE_REMOTE_LCD
{ "rsbs", FILE_ATTR_RSBS, Icon_Wps, VOICE_EXT_RSBS },
#endif
#ifdef BOOTFILE_EXT
{ BOOTFILE_EXT, FILE_ATTR_MOD, Icon_Firmware, VOICE_EXT_AJZ },
#endif

View file

@ -41,6 +41,8 @@
#define FILE_ATTR_KBD 0x0C00 /* keyboard file */
#define FILE_ATTR_FMR 0x0D00 /* preset file */
#define FILE_ATTR_CUE 0x0E00 /* cuesheet file */
#define FILE_ATTR_SBS 0x0F00 /* statusbar file */
#define FILE_ATTR_RSBS 0x1000 /* remote statusbar file */
#define FILE_ATTR_MASK 0xFF00 /* which bits tree.c uses for file types */
struct filetype {

View file

@ -64,6 +64,7 @@
#include "wps_internals.h"
#include "skin_engine.h"
#include "statusbar-skinned.h"
static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode);
@ -83,7 +84,6 @@ bool gui_wps_display(struct gui_wps *gwps)
vp->bg_pattern = display->get_background();
}
#endif
display->clear_display();
display->backdrop_show(BACKDROP_SKIN_WPS);
return skin_redraw(gwps, WPS_REFRESH_ALL);
}
@ -115,28 +115,30 @@ void skin_statusbar_changed(struct gui_wps *skin)
return;
struct wps_data *data = skin->data;
const struct screen *display = skin->display;
const int screen = display->screen_type;
struct viewport *vp = &find_viewport(VP_DEFAULT_LABEL, data)->vp;
viewport_set_fullscreen(vp, display->screen_type);
viewport_set_fullscreen(vp, screen);
if (data->wps_sb_tag)
{ /* fix up the default viewport */
if (data->show_sb_on_wps)
{
bool bar_at_top =
statusbar_position(display->screen_type) != STATUSBAR_BOTTOM;
if (statusbar_position(screen) != STATUSBAR_OFF)
return; /* vp is fixed already */
vp->y = bar_at_top?STATUSBAR_HEIGHT:0;
vp->y = STATUSBAR_HEIGHT;
vp->height = display->lcdheight - STATUSBAR_HEIGHT;
}
else
{
vp->y = 0;
if (statusbar_position(screen) == STATUSBAR_OFF)
return; /* vp is fixed already */
vp->y = vp->x = 0;
vp->height = display->lcdheight;
vp->width = display->lcdwidth;
}
}
}
static void draw_progressbar(struct gui_wps *gwps,
@ -168,7 +170,7 @@ static void draw_progressbar(struct gui_wps *gwps,
elapsed = 0;
length = 0;
}
if (pb->have_bitmap_pb)
gui_bitmap_scrollbar_draw(display, pb->bm,
pb->x, y, pb->width, pb->bm.height,
@ -256,7 +258,7 @@ static void wps_display_images(struct gui_wps *gwps, struct viewport* vp)
}
#ifdef HAVE_ALBUMART
/* now draw the AA */
if (data->albumart && data->albumart->vp == vp
if (data->albumart && data->albumart->vp == vp
&& data->albumart->draw)
{
draw_album_art(gwps, playback_current_aa_hid(data->playback_aa_slot),
@ -496,6 +498,7 @@ static bool evaluate_conditional(struct gui_wps *gwps, int *token_index)
return true;
}
#ifdef HAVE_LCD_BITMAP
struct gui_img* find_image(char label, struct wps_data *data)
{
@ -946,15 +949,19 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
if (refresh_mode == WPS_REFRESH_ALL)
{
struct skin_line *line;
struct skin_viewport *skin_viewport = find_viewport(VP_DEFAULT_LABEL, data);
display->set_viewport(&find_viewport(VP_DEFAULT_LABEL, data)->vp);
display->clear_viewport();
if (!(skin_viewport->hidden_flags & VP_NEVER_VISIBLE))
{
display->set_viewport(&skin_viewport->vp);
display->clear_viewport();
}
for (viewport_list = data->viewports;
viewport_list; viewport_list = viewport_list->next)
{
struct skin_viewport *skin_viewport =
(struct skin_viewport *)viewport_list->token->value.data;
skin_viewport =
(struct skin_viewport *)viewport_list->token->value.data;
for(line = skin_viewport->lines; line; line = line->next)
{
line->curr_subline = NULL;
@ -977,6 +984,10 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
{
struct skin_viewport *skin_viewport =
(struct skin_viewport *)viewport_list->token->value.data;
if (skin_viewport->hidden_flags&VP_NEVER_VISIBLE)
{
continue;
}
if (skin_viewport->hidden_flags&VP_DRAW_HIDEABLE)
{
if (skin_viewport->hidden_flags&VP_DRAW_HIDDEN)
@ -992,8 +1003,11 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
struct skin_viewport *skin_viewport =
(struct skin_viewport *)viewport_list->token->value.data;
unsigned vp_refresh_mode = refresh_mode;
display->set_viewport(&skin_viewport->vp);
int hidden_vp = 0;
#ifdef HAVE_LCD_BITMAP
/* Set images to not to be displayed */
struct skin_token_list *imglist = data->images;
@ -1005,7 +1019,11 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
}
#endif
/* dont redraw the viewport if its disabled */
if ((skin_viewport->hidden_flags&VP_DRAW_HIDDEN))
if (skin_viewport->hidden_flags&VP_NEVER_VISIBLE)
{ /* don't draw anything into this one */
vp_refresh_mode = 0; hidden_vp = true;
}
else if ((skin_viewport->hidden_flags&VP_DRAW_HIDDEN))
{
if (!(skin_viewport->hidden_flags&VP_DRAW_WASHIDDEN))
display->scroll_stop(&skin_viewport->vp);
@ -1019,6 +1037,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
vp_refresh_mode = WPS_REFRESH_ALL;
skin_viewport->hidden_flags = VP_DRAW_HIDEABLE;
}
if (vp_refresh_mode == WPS_REFRESH_ALL)
{
display->clear_viewport();
@ -1040,7 +1059,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
flags = line->curr_subline->line_type;
if (vp_refresh_mode == WPS_REFRESH_ALL || (flags & vp_refresh_mode)
|| new_subline_refresh)
|| new_subline_refresh || hidden_vp)
{
/* get_line tells us if we need to update the line */
update_line = get_line(gwps, subline,
@ -1086,7 +1105,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
}
#endif
if (update_line &&
if (update_line && !hidden_vp &&
/* conditionals clear the line which means if the %Vd is put into the default
viewport there will be a blank line.
To get around this we dont allow any actual drawing to happen in the
@ -1105,7 +1124,6 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
write_line(display, &align, line_count, false);
}
}
#ifdef HAVE_LCD_BITMAP
/* progressbar */
if (vp_refresh_mode & WPS_REFRESH_PLAYER_PROGRESS)
@ -1116,7 +1134,8 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
}
}
/* Now display any images in this viewport */
wps_display_images(gwps, &skin_viewport->vp);
if (!hidden_vp)
wps_display_images(gwps, &skin_viewport->vp);
#endif
}

View file

@ -27,7 +27,6 @@
#include "wps_internals.h" /* TODO: remove this line.. shoudlnt be needed */
#ifdef HAVE_TOUCHSCREEN
int wps_get_touchaction(struct wps_data *data);
#endif
@ -44,7 +43,6 @@ bool skin_update(struct gui_wps *gwps, unsigned int update_type);
* or from a skinfile (isfile = true)
*/
bool skin_data_load(struct wps_data *wps_data,
struct screen *display,
const char *buf,
bool isfile);

View file

@ -683,8 +683,15 @@ static int parse_viewport(const char *wps_bufptr,
curr_line = NULL;
if (!skin_start_new_line(skin_vp, wps_data->num_tokens))
return WPS_ERROR_INVALID_PARAM;
if (*ptr == 'l')
if (*ptr == 'i')
{
skin_vp->label = VP_INFO_LABEL;
skin_vp->hidden_flags = VP_NEVER_VISIBLE;
++ptr;
}
else if (*ptr == 'l')
{
if (*(ptr+1) == '|')
{
@ -1674,7 +1681,6 @@ static bool load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char
else
{
/* Abort if we can't load an image */
DEBUGF("ERR: Failed to load image - %s\n",img_path);
loaded = false;
}
return loaded;
@ -1733,7 +1739,6 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir)
/* to setup up the wps-data from a format-buffer (isfile = false)
from a (wps-)file (isfile = true)*/
bool skin_data_load(struct wps_data *wps_data,
struct screen *display,
const char *buf,
bool isfile)
{
@ -1755,6 +1760,7 @@ bool skin_data_load(struct wps_data *wps_data,
skin_data_reset(wps_data);
/* alloc default viewport, will be fixed up later */
curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport));
if (!curr_vp)
return false;
@ -1766,9 +1772,6 @@ bool skin_data_load(struct wps_data *wps_data,
/* Initialise the first (default) viewport */
curr_vp->label = VP_DEFAULT_LABEL;
curr_vp->vp.x = 0;
curr_vp->vp.width = display->getwidth();
curr_vp->vp.height = display->getheight();
curr_vp->pb = NULL;
curr_vp->hidden_flags = 0;
curr_vp->lines = NULL;
@ -1777,31 +1780,6 @@ bool skin_data_load(struct wps_data *wps_data,
if (!skin_start_new_line(curr_vp, 0))
return false;
switch (statusbar_position(display->screen_type))
{
case STATUSBAR_OFF:
curr_vp->vp.y = 0;
break;
case STATUSBAR_TOP:
curr_vp->vp.y = STATUSBAR_HEIGHT;
curr_vp->vp.height -= STATUSBAR_HEIGHT;
break;
case STATUSBAR_BOTTOM:
curr_vp->vp.y = 0;
curr_vp->vp.height -= STATUSBAR_HEIGHT;
break;
}
#ifdef HAVE_LCD_BITMAP
curr_vp->vp.font = FONT_UI;
curr_vp->vp.drawmode = DRMODE_SOLID;
#endif
#if LCD_DEPTH > 1
if (display->depth > 1)
{
curr_vp->vp.fg_pattern = display->get_foreground();
curr_vp->vp.bg_pattern = display->get_background();
}
#endif
if (!isfile)
{
return wps_parse(wps_data, buf, false);

View file

@ -191,11 +191,14 @@ struct skin_line {
struct skin_line *next;
};
#define VP_DRAW_HIDEABLE 0x1
#define VP_DRAW_HIDDEN 0x2
#define VP_DRAW_WASHIDDEN 0x4
#define VP_DEFAULT_LABEL '|'
#define VP_NO_LABEL '-'
#define VP_DRAW_HIDEABLE 0x1
#define VP_DRAW_HIDDEN 0x2
#define VP_DRAW_WASHIDDEN 0x4
/* these are never drawn, nor cleared, i.e. just ignored */
#define VP_NEVER_VISIBLE 0x8
#define VP_DEFAULT_LABEL '|'
#define VP_NO_LABEL '-'
#define VP_INFO_LABEL '_'
struct skin_viewport {
struct viewport vp; /* The LCD viewport struct */
struct progressbar *pb;

View file

@ -0,0 +1,152 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2009 Thomas Martitz
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "config.h"
#include "system.h"
#include "settings.h"
#include "appevents.h"
#include "screens.h"
#include "screen_access.h"
#include "skin_engine/skin_engine.h"
#include "skin_engine/wps_internals.h"
#include "viewport.h"
#include "statusbar.h"
#include "statusbar-skinned.h"
#include "debug.h"
/* currently only one wps_state is needed */
extern struct wps_state wps_state; /* from wps.c */
static struct gui_wps sb_skin[NB_SCREENS] = {{ .data = NULL }};
static struct wps_data sb_skin_data[NB_SCREENS] = {{ .wps_loaded = 0 }};
/* initial setup of wps_data */
static void sb_skin_update(void*);
static bool loaded_ok[NB_SCREENS] = { false };
static int skinbars = 0;
static int update_delay = DEFAULT_UPDATE_DELAY;
void sb_skin_data_load(enum screen_type screen, const char *buf, bool isfile)
{
struct wps_data *data = sb_skin[screen].data;
int success;
success = buf && skin_data_load(data, buf, isfile);
if (success)
{ /* hide the sb's default viewport because it has nasty effect with stuff
* not part of the statusbar,
* hence .sbs's without any other vps are unsupported*/
struct skin_viewport *vp = find_viewport(VP_DEFAULT_LABEL, data);
struct skin_token_list *next_vp = data->viewports->next;
if (!next_vp)
{ /* no second viewport, let parsing fail */
success = false;
}
/* hide this viewport, forever */
vp->hidden_flags = VP_NEVER_VISIBLE;
}
if (!success)
remove_event(GUI_EVENT_ACTIONUPDATE, sb_skin_update);
#ifdef HAVE_REMOVE_LCD
data->remote_wps = !(screen == SCREEN_MAIN);
#endif
loaded_ok[screen] = success;
}
struct viewport *sb_skin_get_info_vp(enum screen_type screen)
{
return &find_viewport(VP_INFO_LABEL, sb_skin[screen].data)->vp;
}
inline bool sb_skin_get_state(enum screen_type screen)
{
return loaded_ok[screen] && (skinbars & VP_SB_ONSCREEN(screen));
}
void sb_skin_set_state(int state, enum screen_type screen)
{
sb_skin[screen].state->do_full_update = true;
if (state)
{
skinbars |= VP_SB_ONSCREEN(screen);
}
else
{
skinbars &= ~VP_SB_ONSCREEN(screen);
}
if (skinbars)
add_event(GUI_EVENT_ACTIONUPDATE, false, sb_skin_update);
else
remove_event(GUI_EVENT_ACTIONUPDATE, sb_skin_update);
}
static void sb_skin_update(void* param)
{
static long next_update = 0;
int i;
int forced_draw = param || sb_skin[SCREEN_MAIN].state->do_full_update;
if (TIME_AFTER(current_tick, next_update) || forced_draw)
{
FOR_NB_SCREENS(i)
{
if (sb_skin_get_state(i))
{
skin_update(&sb_skin[i], forced_draw?
WPS_REFRESH_ALL : WPS_REFRESH_NON_STATIC);
}
}
next_update = current_tick + update_delay; /* don't update too often */
sb_skin[SCREEN_MAIN].state->do_full_update = false;
}
}
void sb_skin_set_update_delay(int delay)
{
update_delay = delay;
}
void sb_skin_init(void)
{
int i;
FOR_NB_SCREENS(i)
{
#ifdef HAVE_ALBUMART
sb_skin_data[i].albumart = NULL;
sb_skin_data[i].playback_aa_slot = -1;
#endif
#ifdef HAVE_REMOTE_LCD
sb_skin_data[i].remote_wps = (i == SCREEN_REMOTE);
#endif
sb_skin[i].data = &sb_skin_data[i];
sb_skin[i].display = &screens[i];
/* Currently no seperate wps_state needed/possible
so use the only available ( "global" ) one */
sb_skin[i].state = &wps_state;
sb_skin[i].statusbars = &skinbars;
}
}

View file

@ -0,0 +1,51 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2009 Thomas Martitz
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef __STATUSBAR_SKINNED_H__
#define __STATUSBAR_SKINNED_H__
#define DEFAULT_UPDATE_DELAY (HZ/7)
#ifdef HAVE_LCD_BITMAP
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "config.h"
void sb_skin_data_load(enum screen_type screen, const char *buf, bool isfile);
/* probably temporary, to shut the classic statusbar up */
bool sb_skin_get_state(enum screen_type screen);
void sb_skin_set_state(int state, enum screen_type screen);
void sb_skin_init(void);
struct viewport *sb_skin_get_info_vp(enum screen_type screen);
void sb_skin_set_update_delay(int delay);
#else /* CHARCELL */
#define sb_skin_init()
#define sb_skin_data_load(a,b,c)
#define sb_skin_set_update_delay(a)
#define sb_skin_set_state(a,b)
#define sb_skin_get_state(a)
#endif
#endif /* __STATUSBAR_SKINNED_H__ */

View file

@ -188,6 +188,9 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
{
struct screen * display = bar->display;
if (!display)
return;
#ifdef HAVE_LCD_CHARCELLS
int val;
(void)force_redraw; /* The Player always has "redraw" */

View file

@ -55,7 +55,8 @@ struct status_info {
};
/* statusbar visibility/position, used for settings also */
enum statusbar_values { STATUSBAR_OFF = 0, STATUSBAR_TOP, STATUSBAR_BOTTOM };
enum statusbar_values { STATUSBAR_OFF = 0, STATUSBAR_TOP, STATUSBAR_BOTTOM,
STATUSBAR_CUSTOM };
struct gui_statusbar
{

View file

@ -58,6 +58,9 @@
#ifdef HAVE_LCD_BITMAP
#include "language.h"
#endif
#include "statusbar-skinned.h"
#include "debug.h"
static int statusbar_enabled = 0;
@ -93,8 +96,9 @@ static bool showing_bars(enum screen_type screen)
if (statusbar_enabled & VP_SB_ONSCREEN(screen))
{
#ifdef HAVE_LCD_BITMAP
bool ignore = statusbar_enabled & VP_SB_IGNORE_SETTING(screen);
return ignore || (statusbar_position(screen));
int ignore;
ignore = statusbar_enabled & VP_SB_IGNORE_SETTING(screen);
return ignore || (statusbar_position(screen) != STATUSBAR_OFF);
#else
return true;
#endif
@ -109,22 +113,30 @@ void viewport_set_fullscreen(struct viewport *vp,
vp->width = screens[screen].lcdwidth;
#ifdef HAVE_LCD_BITMAP
set_default_align_flags(vp);
vp->drawmode = DRMODE_SOLID;
vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */
vp->height = screens[screen].lcdheight;
if (statusbar_position(screen) != STATUSBAR_BOTTOM
&& showing_bars(screen))
vp->y = STATUSBAR_HEIGHT;
else
vp->y = 0;
struct viewport *sb_skin_vp = sb_skin_get_info_vp(screen);
if (sb_skin_vp && sb_skin_get_state(screen)
&& statusbar_enabled & VP_SB_ONSCREEN(screen))
{
*vp = *sb_skin_vp;
}
else
{
if (statusbar_position(screen) != STATUSBAR_BOTTOM && showing_bars(screen))
vp->y = STATUSBAR_HEIGHT;
else
vp->y = 0;
#else
vp->y = 0;
{
vp->y = 0;
#endif
vp->height = screens[screen].lcdheight
- (showing_bars(screen)?STATUSBAR_HEIGHT:0);
vp->height = screens[screen].lcdheight
- (showing_bars(screen)?STATUSBAR_HEIGHT:0);
}
#ifdef HAVE_LCD_BITMAP
set_default_align_flags(vp);
vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */
vp->drawmode = DRMODE_SOLID;
#if LCD_DEPTH > 1
#ifdef HAVE_REMOTE_LCD
/* We only need this test if there is a remote LCD */
@ -144,7 +156,7 @@ void viewport_set_fullscreen(struct viewport *vp,
vp->bg_pattern = LCD_REMOTE_DEFAULT_BG;
}
#endif
#endif
}
void viewport_set_defaults(struct viewport *vp,
@ -180,21 +192,29 @@ int viewportmanager_get_statusbar(void)
int viewportmanager_set_statusbar(const int enabled)
{
int old = statusbar_enabled;
int i;
statusbar_enabled = enabled;
if (enabled)
FOR_NB_SCREENS(i)
{
int i;
FOR_NB_SCREENS(i)
if (showing_bars(i)
&& statusbar_position(i) != STATUSBAR_CUSTOM)
{
if (showing_bars(i))
gui_statusbar_draw(&statusbars.statusbars[i], true);
add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_redraw);
gui_statusbar_draw(&statusbars.statusbars[i], true);
}
add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_redraw);
else
remove_event(GUI_EVENT_ACTIONUPDATE, viewportmanager_redraw);
}
else
#ifdef HAVE_LCD_BITMAP
FOR_NB_SCREENS(i)
{
remove_event(GUI_EVENT_ACTIONUPDATE, viewportmanager_redraw);
sb_skin_set_state(showing_bars(i)
&& statusbar_position(i) == STATUSBAR_CUSTOM, i);
}
#endif
return old;
}
@ -204,7 +224,8 @@ static void viewportmanager_redraw(void* data)
FOR_NB_SCREENS(i)
{
if (showing_bars(i))
if (showing_bars(i)
&& statusbar_position(i) != STATUSBAR_CUSTOM)
gui_statusbar_draw(&statusbars.statusbars[i], NULL != data);
}
}
@ -234,11 +255,6 @@ void viewportmanager_theme_changed(const int which)
/* reset the ui viewport */
FOR_NB_SCREENS(i)
ui_vp_info.active[i] = retval & BIT_N(i);
if (retval != 0)
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;
}
@ -249,18 +265,14 @@ void viewportmanager_theme_changed(const int which)
}
if (which & THEME_STATUSBAR)
{
statusbar_enabled = VP_SB_HIDE_ALL;
statusbar_enabled = 0;
FOR_NB_SCREENS(i)
{
if (statusbar_position(i) != STATUSBAR_OFF)
statusbar_enabled |= VP_SB_ONSCREEN(i);
}
if (statusbar_enabled != VP_SB_HIDE_ALL)
add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_redraw);
else
remove_event(GUI_EVENT_ACTIONUPDATE, viewportmanager_redraw);
viewportmanager_set_statusbar(statusbar_enabled);
/* reposition viewport to fit statusbar, only if not using the ui vp */
@ -270,6 +282,19 @@ void viewportmanager_theme_changed(const int which)
viewport_set_fullscreen(&custom_vp[i], i);
}
}
int event_add = 0;
FOR_NB_SCREENS(i)
{
event_add |= ui_vp_info.active[i];
event_add |= (statusbar_position(i) == STATUSBAR_CUSTOM);
}
if (event_add)
add_event(GUI_EVENT_REFRESH, false, viewportmanager_ui_vp_changed);
else
remove_event(GUI_EVENT_REFRESH, viewportmanager_ui_vp_changed);
send_event(GUI_EVENT_THEME_CHANGED, NULL);
}
@ -283,10 +308,10 @@ static void viewportmanager_ui_vp_changed(void *param)
FOR_NB_SCREENS(i)
screens[i].clear_display();
/* redraw the statusbar if it was enabled */
viewportmanager_set_statusbar(statusbar_enabled);
send_event(GUI_EVENT_ACTIONUPDATE, (void*)true);
/* call the passed function which will redraw the content of
* the current screen */
if (param != NULL)
if (draw_func != NULL)
draw_func();
FOR_NB_SCREENS(i)
screens[i].update();

View file

@ -56,16 +56,16 @@ void viewport_set_defaults(struct viewport *vp,
*/
#define THEME_STATUSBAR (BIT_N(0))
#define THEME_UI_VIEWPORT (BIT_N(1))
#define THEME_BUTTONBAR (BIT_N(2))
#define THEME_LANGUAGE (BIT_N(3))
#define THEME_ALL (~(0u))
#define THEME_STATUSBAR (BIT_N(0))
#define THEME_UI_VIEWPORT (BIT_N(1))
#define THEME_BUTTONBAR (BIT_N(2))
#define THEME_LANGUAGE (BIT_N(3))
#define THEME_ALL (~(0u))
#define VP_SB_HIDE_ALL 0
#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))
#define VP_SB_HIDE_ALL 0
#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))
#ifndef __PCTOOL__
/*

View file

@ -31,7 +31,6 @@
#include "action.h"
#include "kernel.h"
#include "filetypes.h"
#include "debug.h"
#include "sprintf.h"
#include "settings.h"
#include "skin_engine/skin_engine.h"
@ -67,6 +66,7 @@
#include "dsp.h"
#include "playlist_viewer.h"
#include "wps.h"
#include "statusbar-skinned.h"
#define RESTORE_WPS_INSTANTLY 0l
#define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick))
@ -82,7 +82,7 @@
static int wpsbars = 0;
/* currently only one wps_state is needed, initialize to 0 */
static struct wps_state wps_state = { .id3 = NULL };
struct wps_state wps_state = { .id3 = NULL };
static struct gui_wps gui_wps[NB_SCREENS] = {{ .data = NULL }};
static struct wps_data wps_datas[NB_SCREENS] = {{ .wps_loaded = 0 }};
@ -129,8 +129,8 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
#endif /* __PCTOOL__ */
loaded_ok = buf && skin_data_load(gui_wps[screen].data,
&screens[screen], buf, isfile);
loaded_ok = buf && skin_data_load(gui_wps[screen].data, buf, isfile);
if (!loaded_ok) /* load the hardcoded default */
{
char *skin_buf[NB_SCREENS] = {
@ -153,11 +153,11 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
"%pb\n",
#endif
};
skin_data_load(gui_wps[screen].data, &screens[screen],
skin_buf[screen], false);
skin_data_load(gui_wps[screen].data, skin_buf[screen], false);
}
#ifdef HAVE_REMOVE_LCD
gui_wps[screen].data->remote_wps = !(screen == SCREEN_MAIN);
#endif
}
@ -587,6 +587,8 @@ static void gwps_leave_wps(void)
/* Play safe and unregister the hook */
lcd_activation_set_hook(NULL);
#endif
/* unhandle statusbar update delay */
sb_skin_set_update_delay(DEFAULT_UPDATE_DELAY);
send_event(GUI_EVENT_REFRESH, NULL);
}
@ -739,7 +741,6 @@ long gui_wps_show(void)
#endif
}
}
#ifdef HAVE_LCD_BITMAP
/* when the peak meter is enabled we want to have a
few extra updates to make it look smooth. On the
@ -1175,7 +1176,13 @@ long gui_wps_show(void)
skin_update(&gui_wps[i], WPS_REFRESH_NON_STATIC);
}
}
wps_state.do_full_update = false;
/* currently skinned statusbar and wps share the same wps_state,
* don't steal do_full_update away */
if (wps_state.do_full_update)
{
send_event(GUI_EVENT_ACTIONUPDATE, (void*)true);
wps_state.do_full_update = false;
}
update = false;
}
@ -1188,6 +1195,9 @@ long gui_wps_show(void)
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
lcd_activation_set_hook(wps_lcd_activation_hook);
#endif
/* we remove the update delay since it's not very usable in the wps,
* e.g. during volume changing or ffwd/rewind */
sb_skin_set_update_delay(0);
FOR_NB_SCREENS(i)
{
screens[i].stop_scroll();

View file

@ -13089,3 +13089,45 @@
*: "Skip to Outro"
</voice>
</phrase>
<phrase>
id: LANG_STATUSBAR_CUSTOM
desc: if this translation is compatible with LANG_CHANNEL_CUSTOM, then please use the same translation. it can be combined later then
user: core
<source>
*: "Custom"
</source>
<dest>
*: "Custom"
</dest>
<voice>
*: "Custom"
</voice>
</phrase>
<phrase>
id: VOICE_EXT_SBS
desc: spoken only, for file extension
user: core
<source>
*: ""
</source>
<dest>
*: ""
</dest>
<voice>
*: "statusbar skin"
</voice>
</phrase>
<phrase>
id: VOICE_EXT_RSBS
desc: spoken only, for file extension
user: core
<source>
*: ""
</source>
<dest>
*: ""
</dest>
<voice>
*: "remote statusbar skin"
</voice>
</phrase>

View file

@ -73,6 +73,7 @@
#include "scrobbler.h"
#include "icon.h"
#include "viewport.h"
#include "statusbar-skinned.h"
#ifdef IPOD_ACCESSORY_PROTOCOL
#include "iap.h"
@ -319,6 +320,7 @@ static void init(void)
settings_reset();
settings_load(SETTINGS_ALL);
gui_sync_wps_init();
sb_skin_init();
settings_apply(true);
init_dircache(true);
init_dircache(false);
@ -546,6 +548,7 @@ static void init(void)
}
gui_sync_wps_init();
sb_skin_init();
settings_apply(true);
init_dircache(false);
#ifdef HAVE_TAGCACHE

View file

@ -162,12 +162,16 @@ static int statusbar_callback_ex(int action,const struct menu_item_ex *this_item
old_bar[screen] = statusbar_position(screen);
break;
case ACTION_EXIT_MENUITEM:
gui_statusbar_changed(screen, old_bar[screen]);
send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL);
send_event(GUI_EVENT_ACTIONUPDATE, (void*)true);
if ((old_bar[screen] == STATUSBAR_CUSTOM)
|| (statusbar_position(screen) == STATUSBAR_CUSTOM))
send_event(GUI_EVENT_REFRESH, NULL);
else
gui_statusbar_changed(screen, old_bar[screen]);
break;
}
return action;
return ACTION_REDRAW;
}
#ifdef HAVE_REMOTE_LCD

View file

@ -161,7 +161,7 @@ enum filling_state {
};
#define MAX_TRACK 128
#define MAX_MULTIPLE_AA 1
#define MAX_MULTIPLE_AA 2
#define MAX_TRACK_MASK (MAX_TRACK-1)

View file

@ -802,8 +802,6 @@ int plugin_load(const char* plugin, const void* parameter)
#ifdef HAVE_TOUCHSCREEN
touchscreen_set_mode(global_settings.touch_mode);
#endif
viewportmanager_set_statusbar(oldbars);
button_clear_queue();
@ -832,13 +830,14 @@ int plugin_load(const char* plugin, const void* parameter)
#endif
#endif
viewportmanager_set_statusbar(oldbars);
viewport_set_current_vp(NULL);
if (rc != PLUGIN_GOTO_WPS)
{
send_event(GUI_EVENT_REFRESH, NULL);
}
viewportmanager_set_statusbar(oldbars);
viewport_set_current_vp(NULL);
if (pfn_tsr_exit == NULL)
plugin_loaded = false;

View file

@ -71,6 +71,7 @@
#include "wps.h"
#include "skin_engine/skin_engine.h"
#include "viewport.h"
#include "statusbar-skinned.h"
#if CONFIG_CODEC == MAS3507D
void dac_line_in(bool enable);
@ -740,6 +741,19 @@ void settings_apply_skins(void)
char buf[MAX_PATH];
/* re-initialize the skin buffer before we start reloading skins */
skin_buffer_init();
#ifdef HAVE_LCD_BITMAP
if ( global_settings.sbs_file[0] &&
global_settings.sbs_file[0] != 0xff )
{
snprintf(buf, sizeof buf, WPS_DIR "/%s.sbs",
global_settings.sbs_file);
sb_skin_data_load(SCREEN_MAIN, buf, true);
}
else
{
sb_skin_data_load(SCREEN_MAIN, NULL, true);
}
#endif
if ( global_settings.wps_file[0] &&
global_settings.wps_file[0] != 0xff )
{
@ -752,6 +766,16 @@ void settings_apply_skins(void)
wps_data_load(SCREEN_MAIN, NULL, true);
}
#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
if ( global_settings.rsbs_file[0] &&
global_settings.rsbs_file[0] != 0xff ) {
snprintf(buf, sizeof buf, WPS_DIR "/%s.rsbs",
global_settings.rsbs_file);
sb_skin_data_load(SCREEN_REMOTE, buf, true);
}
else
{
sb_skin_data_load(SCREEN_REMOTE, NULL, true);
}
if ( global_settings.rwps_file[0])
{
snprintf(buf, sizeof buf, WPS_DIR "/%s.rwps",
@ -763,6 +787,7 @@ void settings_apply_skins(void)
wps_data_load(SCREEN_REMOTE, NULL, true);
}
#endif
viewportmanager_theme_changed(THEME_STATUSBAR);
}
void settings_apply(bool read_disk)
@ -997,7 +1022,10 @@ void settings_apply(bool read_disk)
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
enc_global_settings_apply();
#endif
viewportmanager_theme_changed(THEME_ALL);
#ifdef HAVE_LCD_BITMAP
/* already called with THEME_STATUSBAR in settings_apply_skins() */
viewportmanager_theme_changed(THEME_UI_VIEWPORT|THEME_LANGUAGE);
#endif
}

View file

@ -60,6 +60,7 @@ struct opt_items {
#define FONT_DIR ROCKBOX_DIR "/fonts"
#define LANG_DIR ROCKBOX_DIR "/langs"
#define WPS_DIR ROCKBOX_DIR "/wps"
#define SBS_DIR WPS_DIR
#define THEME_DIR ROCKBOX_DIR "/themes"
#define ICON_DIR ROCKBOX_DIR "/icons"
@ -548,6 +549,13 @@ struct user_settings
int peak_meter_max; /* range maximum */
unsigned char wps_file[MAX_FILENAME+1]; /* last wps */
#ifdef HAVE_LCD_BITMAP
unsigned char sbs_file[MAX_FILENAME+1]; /* last statusbar skin */
#endif
#ifdef HAVE_REMOTE_LCD
unsigned char rwps_file[MAX_FILENAME+1]; /* last remote-wps */
unsigned char rsbs_file[MAX_FILENAME+1]; /* last remote statusbar skin */
#endif
unsigned char lang_file[MAX_FILENAME+1]; /* last language */
unsigned char playlist_catalog_dir[MAX_FILENAME+1];
int skip_length; /* skip length */
@ -722,7 +730,6 @@ struct user_settings
bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */
unsigned char remote_icon_file[MAX_FILENAME+1];
unsigned char remote_viewers_icon_file[MAX_FILENAME+1];
unsigned char rwps_file[MAX_FILENAME+1]; /* last remote-wps */
#ifdef HAS_REMOTE_BUTTON_HOLD
int remote_backlight_on_button_hold; /* what to do with remote backlight when hold
switch is on */

View file

@ -199,6 +199,7 @@ static const char graphic_numeric[] = "graphic,numeric";
/* Default theme settings */
#define DEFAULT_WPSNAME "cabbiev2"
#define DEFAULT_SBS_NAME DEFAULT_WPSNAME
#ifdef HAVE_LCD_BITMAP
@ -633,14 +634,14 @@ const struct settings_list settings[] = {
ID2P(LANG_INVERT_CURSOR_BAR)),
#endif
CHOICE_SETTING(F_THEMESETTING|F_TEMPVAR, statusbar,
LANG_STATUS_BAR, STATUSBAR_TOP, "statusbar","off,top,bottom",
NULL, 3, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP),
ID2P(LANG_STATUSBAR_BOTTOM)),
LANG_STATUS_BAR, STATUSBAR_TOP, "statusbar","off,top,bottom,custom",
NULL, 4, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP),
ID2P(LANG_STATUSBAR_BOTTOM), ID2P(LANG_STATUSBAR_CUSTOM)),
#ifdef HAVE_REMOTE_LCD
CHOICE_SETTING(F_THEMESETTING|F_TEMPVAR, remote_statusbar,
LANG_REMOTE_STATUSBAR, STATUSBAR_TOP, "remote statusbar","off,top,bottom",
NULL, 3, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP),
ID2P(LANG_STATUSBAR_BOTTOM)),
LANG_REMOTE_STATUSBAR, STATUSBAR_TOP, "remote statusbar","off,top,bottom,custom",
NULL, 4, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP),
ID2P(LANG_STATUSBAR_BOTTOM), ID2P(LANG_STATUSBAR_CUSTOM)),
#endif
CHOICE_SETTING(F_THEMESETTING|F_TEMPVAR, scrollbar,
LANG_SCROLL_BAR, SCROLLBAR_LEFT, "scrollbar","off,left,right",
@ -1442,11 +1443,17 @@ const struct settings_list settings[] = {
#endif
TEXT_SETTING(F_THEMESETTING,wps_file, "wps",
DEFAULT_WPSNAME, WPS_DIR "/", ".wps"),
TEXT_SETTING(0,lang_file,"lang","",LANG_DIR "/",".lng"),
#ifdef HAVE_LCD_BITMAP
TEXT_SETTING(F_THEMESETTING,sbs_file, "sbs",
DEFAULT_SBS_NAME, SBS_DIR "/", ".sbs"),
#endif
#ifdef HAVE_REMOTE_LCD
TEXT_SETTING(F_THEMESETTING,rwps_file,"rwps",
DEFAULT_WPSNAME, WPS_DIR "/", ".rwps"),
DEFAULT_SBS_NAME, WPS_DIR "/", ".rwps"),
TEXT_SETTING(F_THEMESETTING,rsbs_file, "rsbs",
DEFAULT_WPSNAME, SBS_DIR "/", ".rsbs"),
#endif
TEXT_SETTING(0,lang_file,"lang","",LANG_DIR "/",".lng"),
#if LCD_DEPTH > 1
TEXT_SETTING(F_THEMESETTING,backdrop_file,"backdrop",
DEFAULT_BACKDROP, BACKDROP_DIR "/", ".bmp"),

View file

@ -44,6 +44,8 @@ selector type: bar (inverse)
<wps>
Name: rockbox_default.wps
RWPS: rockbox_default.rwps
SBS:
RSBS:
Author: Rockbox team
Font: 08-Schumacher-Clean.fnt
Font.11x2x1:
@ -59,6 +61,8 @@ selector type: bar (inverse)
<wps>
Name: boxes.wps
rwps: boxes.rwps
SBS:
RSBS:
Author: Christi Scarborough (after Magnus Westerlund)
Font: 08-Schumacher-Clean.fnt
Statusbar: top
@ -76,6 +80,8 @@ remote ui viewport: -
<wps>
Name: engineeer2.wps
RWPS: engineeer2.rwps
SBS:
RSBS:
Author: Magnus Westerlund
Font: 08-Nedore.fnt
Statusbar: top
@ -90,6 +96,8 @@ remote ui viewport: -
<wps>
Name: iAmp.wps
RWPS: iAmp.rwps
SBS:
RSBS:
Author: Raymond Hoh
Font: 12-Nimbus.fnt
backdrop:
@ -104,6 +112,8 @@ remote ui viewport: -
<wps>
Name: zezayer.wps
RWPS: zezayer.rwps
SBS:
RSBS:
Author: Jake Owen
Font: 08-Nedore.fnt
Statusbar: top
@ -153,6 +163,8 @@ Statusbar: top
<wps>
Name: DancePuffDuo.wps
RWPS: DancePuffDuo.rwps
SBS:
RSBS:
Author: Chris Oxtoby
Font: 13-Nimbus.fnt
Statusbar: top
@ -176,6 +188,8 @@ Statusbar: top
<wps>
Name: iCatcher.wps
RWPS: iCatcher.rwps
SBS:
RSBS:
Author: Ioannis Koutoulakis
Font.112x64x1: 08-Rockfont.fnt
Font.128x64x1: 08-Rockfont.fnt
@ -212,6 +226,8 @@ Statusbar: top
<wps>
Name: UniCatcher.wps
RWPS: UniCatcher.rwps
SBS:
RSBS:
Author: Ioannis Koutoulakis
Font: 16-GNU-Unifont.fnt
Foreground Color: 000000
@ -235,6 +251,8 @@ Statusbar: top
<wps>
Name: Rockboxed.wps
RWPS: rockbox_default.rwps
SBS:
RSBS:
Author: Roan Horning
Font.112x64x1: 08-Schumacher-Clean.fnt
Font.128x64x1: 08-Schumacher-Clean.fnt
@ -268,6 +286,8 @@ Author: Jens Arnold
<wps>
Name: cabbiev2.wps
RWPS: cabbiev2.rwps
SBS:
RSBS:
# Real name of the creator of the WPS
Author: Johannes Voggenthaler, Apoo Maha, Marc Guay, Alex Vanderpol, Jerry Lange, Keith Perri, Mark Fawcus, and Marianne Arnold with support from Rockbox developers and forums. Based on Cabbie by Yohann Misquitta.
@ -349,6 +369,7 @@ viewers iconset.240x400x16: /.rockbox/icons/tango_small_viewers.bmp
# Whether the WPS is designed to have the statusbar on or off
Statusbar: top
remote statusbar: top
# list & remote ui viewports
ui viewport: -

View file

@ -32,9 +32,18 @@ my $cppdef = $target;
my @depthlist = ( 16, 8, 4, 2, 1 );
# These parameters are filled in as we parse wpslist
my $req_size;
my $req_g_wps;
my $req_t;
my $req_t_wps;
my $wps;
my $wps_prefix;
my $sbs_prefix;
my $rwps;
my $sbs;
my $sbs_w_size;
my $rsbs;
my $rsbs_w_size;
my $width;
my $height;
my $font;
@ -42,9 +51,6 @@ my $fgcolor;
my $bgcolor;
my $statusbar;
my $author;
my $req_g;
my $req_g_wps;
my $req_t_wps;
my $backdrop;
my $lineselectstart;
my $lineselectend;
@ -191,12 +197,26 @@ sub copywps
my $dir;
my @filelist;
my $file;
my $__sb;
if($wpslist =~ /(.*)WPSLIST/) {
$dir = $1;
# system("cp $dir/$wps .rockbox/wps/");
#print "$req_t_wps $req_g_wps\n";
$__sb = $sbs_prefix . "." . $req_size . ".sbs";
#print "$req_t_wps $req_g_wps $sbs_prefix\n";
#print "$dir/$__sb\n";
# system("cp $dir/$wps .rockbox/wps/");
# check for <name>.WIDTHxHEIGHTxDEPTH.sbs
if (-e "$dir/$__sb") {
system("cp $dir/$__sb $rbdir/wps/$sbs");
}
# check for <name>.WIDTHxHEIGHTxDEPTH.<model>.sbs and overwrite the
# previous sb if needed
$__sb = $sbs_prefix . "." . $req_size . "." . $modelname . ".sbs";
if (-e "$dir/$__sb") {
system("cp $dir/$__sb $rbdir/wps/$sbs");
}
if (-e "$dir/$req_t_wps" ) {
system("cp $dir/$req_t_wps $rbdir/wps/$wps");
@ -210,9 +230,9 @@ sub copywps
close(WPSFILE);
if ($#filelist >= 0) {
if (-e "$dir/$wps_prefix/$req_g") {
if (-e "$dir/$wps_prefix/$req_size") {
foreach $file (@filelist) {
system("cp $dir/$wps_prefix/$req_g/$file $rbdir/wps/$wps_prefix/");
system("cp $dir/$wps_prefix/$req_size/$file $rbdir/wps/$wps_prefix/");
}
}
elsif (-e "$dir/$wps_prefix") {
@ -235,7 +255,7 @@ sub copywps
sub buildcfg {
my $cfg = $wps;
my @out;
my @out;
$cfg =~ s/\.(r|)wps/.cfg/;
@ -247,6 +267,20 @@ sub buildcfg {
wps: /$rbdir/wps/$wps
MOO
;
if(defined($sbs)) {
if ($sbs eq '') {
push @out, "sbs: -\n";
} else {
push @out, "sbs: /$rbdir/wps/$sbs\n";
}
}
if(defined($sbs) && $has_remote) {
if ($rsbs eq '') {
push @out, "rsbs: -\n";
} else {
push @out, "rsbs: /$rbdir/wps/$rsbs\n";
}
}
if($font) {
push @out, "font: /$rbdir/fonts/$font\n";
}
@ -264,7 +298,7 @@ MOO
}
if(defined($backdrop)) {
if ($backdrop eq '') {
push @out, "backdrop:\n";
push @out, "backdrop: -\n";
} else {
# clip resolution from filename
$backdrop =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//;
@ -338,6 +372,8 @@ while(<WPS>) {
undef $wps;
undef $wps_prefix;
undef $rwps;
undef $sbs;
undef $rsbs;
undef $width;
undef $height;
undef $font;
@ -386,23 +422,24 @@ while(<WPS>) {
foreach my $d (@depthlist) {
next if ($d > $rdepth);
$req_g = $rwidth . "x" . $rheight . "x" . $d;
$req_size = $rwidth . "x" . $rheight . "x" . $d;
# check for model specific wps
$req_g_wps = $wps_prefix . "." . $req_g . "." . $modelname . ".wps";
$req_g_wps = $wps_prefix . "." . $req_size . "." . $modelname . ".wps";
last if (-e "$wpsdir/$req_g_wps");
$req_g_wps = $wps_prefix . "." . $req_g . ".wps";
# check for normal wps (with WIDTHxHEIGHTxDEPTH)
$req_g_wps = $wps_prefix . "." . $req_size . ".wps";
last if (-e "$wpsdir/$req_g_wps");
if ($isrwps) {
$req_g = $req_g . "." . $main_width . "x" . $main_height . "x" . "$main_depth";
$req_size = $req_size . "." . $main_width . "x" . $main_height . "x" . "$main_depth";
$req_g_wps = $wps_prefix . "." . $req_g . ".wps";
$req_g_wps = $wps_prefix . "." . $req_size . ".wps";
last if (-e "$wpsdir/$req_g_wps");
}
}
$req_t_wps = $wps_prefix . ".txt" . ".wps";
$req_t_wps = $wps_prefix . $req_t . ".wps";
#print "LCD: $wps wants $width x $height\n";
#print "LCD: is $rwidth x $rheight\n";
@ -454,6 +491,20 @@ while(<WPS>) {
elsif($l =~ /^RWPS\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
$rwps = $1;
}
elsif($l =~ /^SBS: *(.*)/i) {
$sbs = $sbs_prefix = $1;
$sbs_prefix =~ s/\.(r|)sbs//;
}
elsif($l =~ /^SBS\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
$sbs = $sbs_prefix = $1;
$sbs_prefix =~ s/\.(r|)sbs//;
}
elsif($l =~ /^RSBS: *(.*)/i) {
$rsbs = $1;
}
elsif($l =~ /^RSBS\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
$rsbs = $1;
}
elsif($l =~ /^Author: *(.*)/i) {
$author = $1;
}
@ -526,9 +577,15 @@ while(<WPS>) {
elsif($l =~ /^ui viewport: *(.*)/i) {
$listviewport = $1;
}
elsif($l =~ /^ui viewport\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
$listviewport = $1;
}
elsif($l =~ /^remote ui viewport: *(.*)/i) {
$remotelistviewport = $1;
}
elsif($l =~ /^remote ui viewport\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
$remotelistviewport = $1;
}
else{
#print "Unknown line: $l!\n";
}