mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 10:37:38 -04:00
total removal of gui_textarea. The only thing using the text_message struct is the yesno screen so move its definition to yesno.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17653 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
43f0770943
commit
0501fb016c
10 changed files with 99 additions and 204 deletions
|
@ -71,7 +71,6 @@ gui/quickscreen.c
|
||||||
gui/scrollbar.c
|
gui/scrollbar.c
|
||||||
gui/splash.c
|
gui/splash.c
|
||||||
gui/statusbar.c
|
gui/statusbar.c
|
||||||
gui/textarea.c
|
|
||||||
gui/yesno.c
|
gui/yesno.c
|
||||||
gui/wps_debug.c
|
gui/wps_debug.c
|
||||||
gui/wps_parser.c
|
gui/wps_parser.c
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
#include "backdrop.h"
|
#include "backdrop.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "statusbar.h"
|
#include "statusbar.h"
|
||||||
#include "textarea.h"
|
|
||||||
|
|
||||||
#define MAX_BOOKMARKS 10
|
#define MAX_BOOKMARKS 10
|
||||||
#define MAX_BOOKMARK_SIZE 350
|
#define MAX_BOOKMARK_SIZE 350
|
||||||
|
|
|
@ -1,81 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
* __________ __ ___.
|
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
||||||
* \/ \/ \/ \/ \/
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* Copyright (C) 2005 by Kevin Ferrare
|
|
||||||
*
|
|
||||||
* All files in this archive are subject to the GNU General Public License.
|
|
||||||
* See the file COPYING in the source tree root for full license agreement.
|
|
||||||
*
|
|
||||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
||||||
* KIND, either express or implied.
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "textarea.h"
|
|
||||||
#include "font.h"
|
|
||||||
#include "lang.h"
|
|
||||||
#include "talk.h"
|
|
||||||
|
|
||||||
void gui_textarea_clear(struct screen * display)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
int y_start = gui_textarea_get_ystart(display);
|
|
||||||
int y_end = gui_textarea_get_yend(display);
|
|
||||||
screen_clear_area(display, 0, y_start, display->width, y_end - y_start);
|
|
||||||
display->stop_scroll();
|
|
||||||
screen_set_ymargin(display, y_start);
|
|
||||||
#else
|
|
||||||
display->clear_display();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void gui_textarea_update(struct screen * display)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
int y_start = gui_textarea_get_ystart(display);
|
|
||||||
int y_end = gui_textarea_get_yend(display);
|
|
||||||
display->update_rect(0, y_start, display->width, y_end - y_start);
|
|
||||||
#else
|
|
||||||
display->update();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void gui_textarea_update_nblines(struct screen * display)
|
|
||||||
{
|
|
||||||
int height=display->height;
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
if(global_settings.statusbar)
|
|
||||||
height -= STATUSBAR_HEIGHT;
|
|
||||||
#ifdef HAS_BUTTONBAR
|
|
||||||
if(global_settings.buttonbar && display->has_buttonbar)
|
|
||||||
height -= BUTTONBAR_HEIGHT;
|
|
||||||
#endif
|
|
||||||
display->getstringsize((unsigned char *)"A", &display->char_width,
|
|
||||||
&display->char_height);
|
|
||||||
#else
|
|
||||||
display->char_width = 1;
|
|
||||||
display->char_height = 1;
|
|
||||||
#endif
|
|
||||||
display->nb_lines = height / display->char_height;
|
|
||||||
}
|
|
||||||
|
|
||||||
void talk_text_message(const struct text_message * message, bool enqueue)
|
|
||||||
{
|
|
||||||
int line;
|
|
||||||
if(message)
|
|
||||||
for(line=0; line<message->nb_lines; line++)
|
|
||||||
{
|
|
||||||
long id = P2ID((unsigned char *)message->message_lines[line]);
|
|
||||||
if(id>=0)
|
|
||||||
{
|
|
||||||
talk_id(id, enqueue);
|
|
||||||
enqueue = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,84 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
* __________ __ ___.
|
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
||||||
* \/ \/ \/ \/ \/
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* Copyright (C) 2005 by Kevin Ferrare
|
|
||||||
*
|
|
||||||
* All files in this archive are subject to the GNU General Public License.
|
|
||||||
* See the file COPYING in the source tree root for full license agreement.
|
|
||||||
*
|
|
||||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
||||||
* KIND, either express or implied.
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef _GUI_TEXTAREA_H_
|
|
||||||
#define _GUI_TEXTAREA_H_
|
|
||||||
#include "screen_access.h"
|
|
||||||
#include "settings.h"
|
|
||||||
#include "statusbar.h"
|
|
||||||
|
|
||||||
struct text_message
|
|
||||||
{
|
|
||||||
const char **message_lines;
|
|
||||||
int nb_lines;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Clears the area in the screen in which text can be displayed
|
|
||||||
* and sets the y margin properly
|
|
||||||
* - display : the screen structure
|
|
||||||
*/
|
|
||||||
extern void gui_textarea_clear(struct screen * display);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Updates the area in the screen in which text can be displayed
|
|
||||||
* - display : the screen structure
|
|
||||||
*/
|
|
||||||
extern void gui_textarea_update(struct screen * display);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Compute the number of text lines the display can draw with the current font
|
|
||||||
* Also updates the char height and width
|
|
||||||
* - display : the screen structure
|
|
||||||
*/
|
|
||||||
extern void gui_textarea_update_nblines(struct screen * display);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Speak a text_message. The message's lines may be virtual pointers
|
|
||||||
* representing language / voicefont IDs (see settings.h).
|
|
||||||
*/
|
|
||||||
extern void talk_text_message(const struct text_message * message, bool enqueue);
|
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
/*
|
|
||||||
* Compute the number of pixels from which text can be displayed
|
|
||||||
* - display : the screen structure
|
|
||||||
* Returns the number of pixels
|
|
||||||
*/
|
|
||||||
#define gui_textarea_get_ystart(display) \
|
|
||||||
( (global_settings.statusbar)? STATUSBAR_HEIGHT : 0)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Compute the number of pixels below which text can't be displayed
|
|
||||||
* - display : the screen structure
|
|
||||||
* Returns the number of pixels
|
|
||||||
*/
|
|
||||||
#ifdef HAS_BUTTONBAR
|
|
||||||
#define gui_textarea_get_yend(display) \
|
|
||||||
( (display)->height - ( (global_settings.buttonbar && \
|
|
||||||
(display)->has_buttonbar)? \
|
|
||||||
BUTTONBAR_HEIGHT : 0) )
|
|
||||||
#else
|
|
||||||
#define gui_textarea_get_yend(display) \
|
|
||||||
( (display)->height )
|
|
||||||
#endif /* HAS_BUTTONBAR */
|
|
||||||
|
|
||||||
#endif /* HAVE_LCD_BITMAP */
|
|
||||||
|
|
||||||
#endif /* _GUI_TEXTAREA_H_ */
|
|
|
@ -16,7 +16,7 @@
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
#include "config.h"
|
||||||
#include "yesno.h"
|
#include "yesno.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "kernel.h"
|
#include "kernel.h"
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
#include "action.h"
|
#include "action.h"
|
||||||
#include "talk.h"
|
#include "talk.h"
|
||||||
#include "textarea.h"
|
#include "settings.h"
|
||||||
#include "viewport.h"
|
#include "viewport.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,6 +36,24 @@ struct gui_yesno
|
||||||
struct viewport *vp;
|
struct viewport *vp;
|
||||||
struct screen * display;
|
struct screen * display;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void talk_text_message(const struct text_message * message, bool enqueue)
|
||||||
|
{
|
||||||
|
int line;
|
||||||
|
if(message)
|
||||||
|
{
|
||||||
|
for(line=0; line<message->nb_lines; line++)
|
||||||
|
{
|
||||||
|
long id = P2ID((unsigned char *)message->message_lines[line]);
|
||||||
|
if(id>=0)
|
||||||
|
{
|
||||||
|
talk_id(id, enqueue);
|
||||||
|
enqueue = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int put_message(struct screen *display,
|
static int put_message(struct screen *display,
|
||||||
const struct text_message * message,
|
const struct text_message * message,
|
||||||
int start, int max_y)
|
int start, int max_y)
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#define _GUI_YESNO_H_
|
#define _GUI_YESNO_H_
|
||||||
|
|
||||||
#include "screen_access.h"
|
#include "screen_access.h"
|
||||||
#include "textarea.h"
|
|
||||||
|
|
||||||
enum yesno_res
|
enum yesno_res
|
||||||
{
|
{
|
||||||
|
@ -30,6 +29,12 @@ enum yesno_res
|
||||||
YESNO_USB
|
YESNO_USB
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct text_message
|
||||||
|
{
|
||||||
|
const char **message_lines;
|
||||||
|
int nb_lines;
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Runs the yesno asker :
|
* Runs the yesno asker :
|
||||||
* it will display the 'main_message' question, and wait for user keypress
|
* it will display the 'main_message' question, and wait for user keypress
|
||||||
|
|
|
@ -73,7 +73,6 @@
|
||||||
|
|
||||||
#ifdef BOOTFILE
|
#ifdef BOOTFILE
|
||||||
#if !defined(USB_NONE) && !defined(USB_IPODSTYLE)
|
#if !defined(USB_NONE) && !defined(USB_IPODSTYLE)
|
||||||
#include "textarea.h"
|
|
||||||
#include "rolo.h"
|
#include "rolo.h"
|
||||||
#include "yesno.h"
|
#include "yesno.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include "filetypes.h"
|
#include "filetypes.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "playlist_catalog.h"
|
#include "playlist_catalog.h"
|
||||||
|
#include "statusbar.h"
|
||||||
|
|
||||||
#define MAX_PLAYLISTS 400
|
#define MAX_PLAYLISTS 400
|
||||||
#define PLAYLIST_DISPLAY_COUNT 10
|
#define PLAYLIST_DISPLAY_COUNT 10
|
||||||
|
|
|
@ -53,7 +53,6 @@
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "screen_access.h"
|
#include "screen_access.h"
|
||||||
#include "statusbar.h"
|
#include "statusbar.h"
|
||||||
#include "textarea.h"
|
|
||||||
#include "splash.h"
|
#include "splash.h"
|
||||||
#include "yesno.h"
|
#include "yesno.h"
|
||||||
#include "buttonbar.h"
|
#include "buttonbar.h"
|
||||||
|
@ -64,6 +63,7 @@
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "menus/exported_menus.h"
|
#include "menus/exported_menus.h"
|
||||||
#include "root_menu.h"
|
#include "root_menu.h"
|
||||||
|
#include "viewport.h"
|
||||||
|
|
||||||
#if CONFIG_TUNER
|
#if CONFIG_TUNER
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ static int save_preset_list(void);
|
||||||
static int load_preset_list(void);
|
static int load_preset_list(void);
|
||||||
static int clear_preset_list(void);
|
static int clear_preset_list(void);
|
||||||
|
|
||||||
static int scan_presets(void);
|
static int scan_presets(void *viewports);
|
||||||
|
|
||||||
/* Function to manipulate all yesno dialogues.
|
/* Function to manipulate all yesno dialogues.
|
||||||
This function needs the output text as an argument. */
|
This function needs the output text as an argument. */
|
||||||
|
@ -142,7 +142,7 @@ static bool yesno_pop(const char* text)
|
||||||
const struct text_message message={lines, 1};
|
const struct text_message message={lines, 1};
|
||||||
bool ret = (gui_syncyesno_run(&message,NULL,NULL)== YESNO_YES);
|
bool ret = (gui_syncyesno_run(&message,NULL,NULL)== YESNO_YES);
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
gui_textarea_clear(&screens[i]);
|
screens[i].clear_viewport();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -451,6 +451,7 @@ int radio_screen(void)
|
||||||
#ifndef HAVE_NOISY_IDLE_MODE
|
#ifndef HAVE_NOISY_IDLE_MODE
|
||||||
int button_timeout = current_tick + (2*HZ);
|
int button_timeout = current_tick + (2*HZ);
|
||||||
#endif
|
#endif
|
||||||
|
struct viewport vp[NB_SCREENS];
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAS_BUTTONBAR
|
||||||
struct gui_buttonbar buttonbar;
|
struct gui_buttonbar buttonbar;
|
||||||
gui_buttonbar_init(&buttonbar);
|
gui_buttonbar_init(&buttonbar);
|
||||||
|
@ -463,14 +464,19 @@ int radio_screen(void)
|
||||||
/* always display status bar in radio screen for now */
|
/* always display status bar in radio screen for now */
|
||||||
global_status.statusbar_forced = statusbar?0:1;
|
global_status.statusbar_forced = statusbar?0:1;
|
||||||
global_settings.statusbar = true;
|
global_settings.statusbar = true;
|
||||||
|
gui_syncstatusbar_draw(&statusbars,true);
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
{
|
{
|
||||||
gui_textarea_clear(&screens[i]);
|
viewport_set_defaults(&vp[i], i);
|
||||||
screen_set_xmargin(&screens[i],0);
|
#ifdef HAS_BUTTONBAR
|
||||||
|
if (global_settings.buttonbar)
|
||||||
|
vp[i].height -= BUTTONBAR_HEIGHT;
|
||||||
|
#endif
|
||||||
|
screens[i].set_viewport(&vp[i]);
|
||||||
|
screens[i].clear_viewport();
|
||||||
|
screens[i].update_viewport();
|
||||||
}
|
}
|
||||||
|
|
||||||
gui_syncstatusbar_draw(&statusbars,true);
|
|
||||||
|
|
||||||
fh = font_get(FONT_UI)->height;
|
fh = font_get(FONT_UI)->height;
|
||||||
|
|
||||||
/* Adjust for font size, trying to center the information vertically */
|
/* Adjust for font size, trying to center the information vertically */
|
||||||
|
@ -520,7 +526,7 @@ int radio_screen(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(num_presets < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN)))
|
if(num_presets < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN)))
|
||||||
scan_presets();
|
scan_presets(vp);
|
||||||
|
|
||||||
curr_preset = find_preset(curr_freq);
|
curr_preset = find_preset(curr_freq);
|
||||||
if(curr_preset != -1)
|
if(curr_preset != -1)
|
||||||
|
@ -715,10 +721,12 @@ int radio_screen(void)
|
||||||
case ACTION_FM_MENU:
|
case ACTION_FM_MENU:
|
||||||
radio_menu();
|
radio_menu();
|
||||||
curr_preset = find_preset(curr_freq);
|
curr_preset = find_preset(curr_freq);
|
||||||
FOR_NB_SCREENS(i){
|
FOR_NB_SCREENS(i)
|
||||||
struct screen *sc = &screens[i];
|
{
|
||||||
gui_textarea_clear(sc);
|
screens[i].set_viewport(&vp[i]);
|
||||||
screen_set_xmargin(sc, 0);
|
screens[i].clear_viewport();
|
||||||
|
screens[i].update_viewport();
|
||||||
|
screens[i].set_viewport(NULL);
|
||||||
}
|
}
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAS_BUTTONBAR
|
||||||
gui_buttonbar_set(&buttonbar, str(LANG_BUTTONBAR_MENU),
|
gui_buttonbar_set(&buttonbar, str(LANG_BUTTONBAR_MENU),
|
||||||
|
@ -736,10 +744,10 @@ int radio_screen(void)
|
||||||
update_screen = true;
|
update_screen = true;
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
{
|
{
|
||||||
struct screen *sc = &screens[i];
|
screens[i].set_viewport(&vp[i]);
|
||||||
gui_textarea_clear(sc);
|
screens[i].clear_viewport();
|
||||||
screen_set_xmargin(sc, 0);
|
screens[i].update_viewport();
|
||||||
gui_textarea_update(sc);
|
screens[i].set_viewport(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -747,10 +755,10 @@ int radio_screen(void)
|
||||||
handle_radio_presets();
|
handle_radio_presets();
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
{
|
{
|
||||||
struct screen *sc = &screens[i];
|
screens[i].set_viewport(&vp[i]);
|
||||||
gui_textarea_clear(sc);
|
screens[i].clear_viewport();
|
||||||
screen_set_xmargin(sc, 0);
|
screens[i].update_viewport();
|
||||||
gui_textarea_update(sc);
|
screens[i].set_viewport(NULL);
|
||||||
}
|
}
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAS_BUTTONBAR
|
||||||
gui_buttonbar_set(&buttonbar,
|
gui_buttonbar_set(&buttonbar,
|
||||||
|
@ -847,10 +855,12 @@ int radio_screen(void)
|
||||||
{
|
{
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
{
|
{
|
||||||
|
screens[i].set_viewport(&vp[i]);
|
||||||
peak_meter_screen(&screens[i],0,
|
peak_meter_screen(&screens[i],0,
|
||||||
STATUSBAR_HEIGHT + fh*(top_of_screen + 4), fh);
|
STATUSBAR_HEIGHT + fh*(top_of_screen + 4), fh);
|
||||||
screens[i].update_rect(0, STATUSBAR_HEIGHT + fh*(top_of_screen + 4),
|
screens[i].update_rect(0, STATUSBAR_HEIGHT + fh*(top_of_screen + 4),
|
||||||
screens[i].width, fh);
|
screens[i].width, fh);
|
||||||
|
screens[i].set_viewport(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -887,7 +897,9 @@ int radio_screen(void)
|
||||||
int freq;
|
int freq;
|
||||||
|
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
screens[i].setfont(FONT_UI);
|
{
|
||||||
|
screens[i].set_viewport(&vp[i]);
|
||||||
|
}
|
||||||
|
|
||||||
snprintf(buf, 128, curr_preset >= 0 ? "%d. %s" : " ",
|
snprintf(buf, 128, curr_preset >= 0 ? "%d. %s" : " ",
|
||||||
curr_preset + 1, presets[curr_preset].name);
|
curr_preset + 1, presets[curr_preset].name);
|
||||||
|
@ -934,11 +946,15 @@ int radio_screen(void)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_CODEC != SWCODEC */
|
#endif /* CONFIG_CODEC != SWCODEC */
|
||||||
|
|
||||||
|
FOR_NB_SCREENS(i)
|
||||||
|
{
|
||||||
|
screens[i].update_viewport();
|
||||||
|
screens[i].set_viewport(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAS_BUTTONBAR
|
||||||
gui_buttonbar_draw(&buttonbar);
|
gui_buttonbar_draw(&buttonbar);
|
||||||
#endif
|
#endif
|
||||||
FOR_NB_SCREENS(i)
|
|
||||||
gui_textarea_update(&screens[i]);
|
|
||||||
}
|
}
|
||||||
/* Only force the redraw if update_screen is true */
|
/* Only force the redraw if update_screen is true */
|
||||||
gui_syncstatusbar_draw(&statusbars,true);
|
gui_syncstatusbar_draw(&statusbars,true);
|
||||||
|
@ -983,7 +999,11 @@ int radio_screen(void)
|
||||||
gui_syncsplash(0, str(LANG_DISK_FULL));
|
gui_syncsplash(0, str(LANG_DISK_FULL));
|
||||||
gui_syncstatusbar_draw(&statusbars,true);
|
gui_syncstatusbar_draw(&statusbars,true);
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
gui_textarea_update(&screens[i]);
|
{
|
||||||
|
screens[i].set_viewport(&vp[i]);
|
||||||
|
screens[i].update_viewport();
|
||||||
|
screens[i].set_viewport(NULL);
|
||||||
|
}
|
||||||
audio_error_clear();
|
audio_error_clear();
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
|
@ -1415,10 +1435,14 @@ MENUITEM_FUNCTION_DYNTEXT(radio_mode_item, 0,
|
||||||
get_mode_text, NULL, NULL, NULL, Icon_NOICON);
|
get_mode_text, NULL, NULL, NULL, Icon_NOICON);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int scan_presets(void)
|
static int scan_presets(void *viewports)
|
||||||
{
|
{
|
||||||
bool do_scan = true;
|
bool do_scan = true;
|
||||||
|
int i;
|
||||||
|
struct viewport *vp = (struct viewport *)viewports;
|
||||||
|
|
||||||
|
FOR_NB_SCREENS(i)
|
||||||
|
screens[i].set_viewport(vp?&vp[i]:NULL);
|
||||||
if(num_presets > 0) /* Do that to avoid 2 questions. */
|
if(num_presets > 0) /* Do that to avoid 2 questions. */
|
||||||
do_scan = yesno_pop(ID2P(LANG_FM_CLEAR_PRESETS));
|
do_scan = yesno_pop(ID2P(LANG_FM_CLEAR_PRESETS));
|
||||||
|
|
||||||
|
@ -1428,7 +1452,6 @@ static int scan_presets(void)
|
||||||
&fm_region_data[global_settings.fm_region];
|
&fm_region_data[global_settings.fm_region];
|
||||||
|
|
||||||
char buf[MAX_FMPRESET_LEN + 1];
|
char buf[MAX_FMPRESET_LEN + 1];
|
||||||
int i;
|
|
||||||
|
|
||||||
curr_freq = fmr->freq_min;
|
curr_freq = fmr->freq_min;
|
||||||
num_presets = 0;
|
num_presets = 0;
|
||||||
|
@ -1466,9 +1489,8 @@ static int scan_presets(void)
|
||||||
|
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
{
|
{
|
||||||
gui_textarea_clear(&screens[i]);
|
screens[i].clear_viewport();
|
||||||
screen_set_xmargin(&screens[i],0);
|
screens[i].update_viewport();
|
||||||
gui_textarea_update(&screens[i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(num_presets > 0)
|
if(num_presets > 0)
|
||||||
|
@ -1557,7 +1579,8 @@ MENUITEM_FUNCTION(presetsave_item, 0, ID2P(LANG_FM_PRESET_SAVE),
|
||||||
save_preset_list, NULL, NULL, Icon_NOICON);
|
save_preset_list, NULL, NULL, Icon_NOICON);
|
||||||
MENUITEM_FUNCTION(presetclear_item, 0, ID2P(LANG_FM_PRESET_CLEAR),
|
MENUITEM_FUNCTION(presetclear_item, 0, ID2P(LANG_FM_PRESET_CLEAR),
|
||||||
clear_preset_list, NULL, NULL, Icon_NOICON);
|
clear_preset_list, NULL, NULL, Icon_NOICON);
|
||||||
MENUITEM_FUNCTION(scan_presets_item, 0, ID2P(LANG_FM_SCAN_PRESETS),
|
MENUITEM_FUNCTION(scan_presets_item, MENU_FUNC_USEPARAM,
|
||||||
|
ID2P(LANG_FM_SCAN_PRESETS),
|
||||||
scan_presets, NULL, NULL, Icon_NOICON);
|
scan_presets, NULL, NULL, Icon_NOICON);
|
||||||
|
|
||||||
MAKE_MENU(radio_settings_menu, ID2P(LANG_FM_MENU), NULL,
|
MAKE_MENU(radio_settings_menu, ID2P(LANG_FM_MENU), NULL,
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include <icons.h>
|
#include <icons.h>
|
||||||
|
|
||||||
#include "screen_access.h"
|
#include "screen_access.h"
|
||||||
#include "textarea.h"
|
|
||||||
|
|
||||||
struct screen screens[NB_SCREENS] =
|
struct screen screens[NB_SCREENS] =
|
||||||
{
|
{
|
||||||
|
@ -228,11 +227,28 @@ void screen_clear_area(struct screen * display, int xstart, int ystart,
|
||||||
void screen_access_init(void)
|
void screen_access_init(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
struct screen *display;
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
{
|
{
|
||||||
|
display = &screens[i];
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
((struct screen*)&screens[i])->setfont(FONT_UI);
|
((struct screen*)&screens[i])->setfont(FONT_UI);
|
||||||
#endif
|
#endif
|
||||||
gui_textarea_update_nblines(&screens[i]);
|
|
||||||
|
int height=display->height;
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
if(global_settings.statusbar)
|
||||||
|
height -= STATUSBAR_HEIGHT;
|
||||||
|
#ifdef HAS_BUTTONBAR
|
||||||
|
if(global_settings.buttonbar && display->has_buttonbar)
|
||||||
|
height -= BUTTONBAR_HEIGHT;
|
||||||
|
#endif
|
||||||
|
display->getstringsize((unsigned char *)"A", &display->char_width,
|
||||||
|
&display->char_height);
|
||||||
|
#else
|
||||||
|
display->char_width = 1;
|
||||||
|
display->char_height = 1;
|
||||||
|
#endif
|
||||||
|
display->nb_lines = height / display->char_height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue