summaryrefslogtreecommitdiffstats
path: root/apps/gui
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-10-16 20:34:04 +0000
committerThomas Martitz <kugel@rockbox.org>2009-10-16 20:34:04 +0000
commit94f76513412cdaf8f3b98054f9c027b97093027e (patch)
tree6e5b4483ab09c83270bc36b828a297f8fc0b2fc4 /apps/gui
parent5c244cfcaad88ea6bb660f2daf779c628e00af00 (diff)
downloadrockbox-94f76513412cdaf8f3b98054f9c027b97093027e.tar.gz
rockbox-94f76513412cdaf8f3b98054f9c027b97093027e.zip
Revert r23212, I committed it accidentally.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23214 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/list.c1
-rw-r--r--apps/gui/skin_engine/skin_display.c36
-rw-r--r--apps/gui/skin_engine/skin_parser.c7
-rw-r--r--apps/gui/skin_engine/wps_internals.h2
-rw-r--r--apps/gui/statusbar-skinned.c127
-rw-r--r--apps/gui/statusbar-skinned.h41
-rw-r--r--apps/gui/viewport.c18
-rw-r--r--apps/gui/wps.c2
8 files changed, 17 insertions, 217 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c
index 0090f44b42..d7ecdccd30 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -29,7 +29,6 @@
#include "kernel.h"
#include "system.h"
-#include "appevents.h"
#include "action.h"
#include "screen_access.h"
#include "list.h"
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index ef1c39c1c7..a5ea28619a 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -168,7 +168,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,
@@ -482,12 +482,7 @@ static bool evaluate_conditional(struct gui_wps *gwps, int *token_index)
#ifdef HAVE_LCD_BITMAP
/* clear all pictures in the conditional and nested ones */
if (data->tokens[i].type == WPS_TOKEN_IMAGE_PRELOAD_DISPLAY)
- {
- struct gui_img *tmp = find_image(data->tokens[i].value.i&0xFF,
- data);
- if (tmp)
- clear_image_pos(gwps, tmp);
- }
+ clear_image_pos(gwps, find_image(data->tokens[i].value.i&0xFF, gwps->data));
#endif
#ifdef HAVE_ALBUMART
if (data->albumart && data->tokens[i].type == WPS_TOKEN_ALBUMART_DISPLAY)
@@ -504,35 +499,17 @@ static bool evaluate_conditional(struct gui_wps *gwps, int *token_index)
#ifdef HAVE_LCD_BITMAP
struct gui_img* find_image(char label, struct wps_data *data)
{
- static int i = 0;
- struct gui_img *ret = NULL;
struct skin_token_list *list = data->images;
- if (data->debug)
- {
- DEBUGF("%s >> requesting image (id: %d)\n", __func__, n);
- DEBUGF("%s >> first list data (p: %p\n", __func__, data->images);
- }
while (list)
{
struct gui_img *img = (struct gui_img *)list->token->value.data;
if (img->label == label)
- {
- i = 0;
- ret = img; goto end;
- }
+ return img;
list = list->next;
-/*
- if (!list && data->debug)
- DEBUGF("failed to find: %s\n", img->bm.data);
-*/
}
- i = 0;
-end:
- if (data->debug)
- DEBUGF("%s >> returning %p\n", __func__, ret);
- return ret;
-}
-#endif
+ return NULL;
+}
+#endif
struct skin_viewport* find_viewport(char label, struct wps_data *data)
{
@@ -547,6 +524,7 @@ struct skin_viewport* find_viewport(char label, struct wps_data *data)
return NULL;
}
+
/* Read a (sub)line to the given alignment format buffer.
linebuf is the buffer where the data is actually stored.
align is the alignment format that'll be used to display the text.
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 9a8d3f5ce4..fa35ed994f 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -603,8 +603,6 @@ static int parse_image_load(const char *wps_bufptr,
return WPS_ERROR_INVALID_PARAM;
/* save a pointer to the filename */
img->bm.data = (char*)filename;
- if (wps_data->debug)
- DEBUGF("%s >> image parsed (label: %c)\n", __func__, *id);
img->label = *id;
img->x = x;
img->y = y;
@@ -1641,13 +1639,8 @@ void skin_data_reset(struct wps_data *wps_data)
wps_data->wps_progress_pat[i] = 0;
}
wps_data->full_line_progressbar = false;
-
-#ifdef HAVE_REMOTE_LCD
- data->remote_wps = rwps;
#endif
wps_data->wps_loaded = false;
- if (wps_data->debug)
- DEBUGF("%s >> wps_data trashed (%p)\n", __func__, data);
}
#ifdef HAVE_LCD_BITMAP
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index 1d1bcbc8e4..638fb0a081 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -263,6 +263,7 @@ struct wps_data
int num_tokens;
/* tick the volume button was last pressed */
unsigned int button_time_volume;
+
#ifdef HAVE_LCD_BITMAP
bool peak_meter_enabled;
bool wps_sb_tag;
@@ -276,7 +277,6 @@ struct wps_data
/* this must not be reset on skin loading */
bool remote_wps;
#endif
- bool debug;
};
/* wps_data end */
diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c
deleted file mode 100644
index bb77a5088c..0000000000
--- a/apps/gui/statusbar-skinned.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * 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 <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#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 "debug.h"
-
-
-/* currently only one wps_state is needed */
-extern struct wps_state wps_state;
-static struct gui_wps sb_skin[NB_SCREENS];
-static struct wps_data sb_skin_data[NB_SCREENS];
-
-/* initial setup of wps_data */
-static void sb_skin_update(void*);
-static bool loaded_ok = false;
-
-void sb_skin_data_load(enum screen_type screen, const char *buf, bool isfile)
-{
-
- loaded_ok = buf && skin_data_load(sb_skin[screen].data,
- &screens[screen], buf, isfile);
-
-
- if (loaded_ok)
- add_event(GUI_EVENT_ACTIONUPDATE, false, sb_skin_update);
- else
- remove_event(GUI_EVENT_ACTIONUPDATE, sb_skin_update);
-
-#ifdef HAVE_REMOVE_LCD
- sb_skin[screen].data->remote_wps = !(screen == SCREEN_MAIN);
-#endif
-}
-
-void sb_skin_data_init(enum screen_type screen)
-{
- skin_data_init(sb_skin[screen].data);
-}
-
-bool sb_skin_active(void)
-{
- return loaded_ok;
-}
-
-void sb_skin_update(void* param)
-{
- int i;
- (void)param;
- FOR_NB_SCREENS(i)
- {
- skin_update(&sb_skin[i], wps_state.do_full_update?
- WPS_REFRESH_ALL : WPS_REFRESH_NON_STATIC);
- }
-}
-
-void sb_skin_init(void)
-{
- int i;
- FOR_NB_SCREENS(i)
- {
- skin_data_init(&sb_skin_data[i]);
-#ifdef HAVE_ALBUMART
- sb_skin_data[i].wps_uses_albumart = 0;
-#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];
- sb_skin[i].data->debug = true;
- DEBUGF("data in init: %p, debug: %d\n", &sb_skin_data[i], sb_skin_data[i].debug);
- /* Currently no seperate wps_state needed/possible
- so use the only available ( "global" ) one */
- sb_skin[i].state = &wps_state;
- }
-#ifdef HAVE_LCD_BITMAP
-/*
- add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, statusbar_toggle_handler);
-*/
-#endif
-}
-
-#ifdef HAVE_ALBUMART
-bool sb_skin_uses_statusbar(int *width, int *height)
-{
- int i;
- FOR_NB_SCREENS(i) {
- struct gui_wps *gwps = &sb_skin[i];
- if (gwps->data && (gwps->data->wps_uses_albumart != WPS_ALBUMART_NONE))
- {
- if (width)
- *width = sb_skin[0].data->albumart_max_width;
- if (height)
- *height = sb_skin[0].data->albumart_max_height;
- return true;
- }
- }
- return false;
-}
-#endif
diff --git a/apps/gui/statusbar-skinned.h b/apps/gui/statusbar-skinned.h
deleted file mode 100644
index 7714496e52..0000000000
--- a/apps/gui/statusbar-skinned.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * 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 <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include "config.h"
-
-#ifndef __STATUSBAR_SKINNED_H__
-#define __STATUSBAR_SKINNED_H__
-
-
-void sb_skin_data_load(enum screen_type screen, const char *buf, bool isfile);
-void sb_skin_data_init(enum screen_type screen);
-
-/* probably temporary, to shut the classic statusbar up */
-bool sb_skin_active(void);
-void sb_skin_init(void);
-
-#ifdef HAVE_ALBUMART
-bool sb_skin_uses_statusbar(int *width, int *height);
-#endif
-
-#endif /* __STATUSBAR_SKINNED_H__ */
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 1a2b29a65a..fdd06bdc46 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -189,8 +189,7 @@ int viewportmanager_set_statusbar(const int enabled)
if (showing_bars(i))
gui_statusbar_draw(&statusbars.statusbars[i], true);
}
- if (!sb_skin_active())
- add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_redraw);
+ add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_redraw);
}
else
{
@@ -251,13 +250,14 @@ void viewportmanager_theme_changed(const int which)
if (which & THEME_STATUSBAR)
{
statusbar_enabled = VP_SB_HIDE_ALL;
- 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 && !sb_skin_active())
+
+ 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);
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 3ea5cf97f7..342ebdea2b 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -131,7 +131,6 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
loaded_ok = buf && skin_data_load(gui_wps[screen].data,
&screens[screen], buf, isfile);
- DEBUGF("%s >> wps loading\n", __func__);
if (!loaded_ok) /* load the hardcoded default */
{
char *skin_buf[NB_SCREENS] = {
@@ -1292,7 +1291,6 @@ void gui_sync_wps_init(void)
#ifdef HAVE_REMOTE_LCD
wps_datas[i].remote_wps = (i == SCREEN_REMOTE);
#endif
- wps_datas[i].debug = false;
gui_wps[i].data = &wps_datas[i];
gui_wps[i].display = &screens[i];
/* Currently no seperate wps_state needed/possible