mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-17 20:17:37 -04:00
Accept FS #9052 by Alexander Levin with a fix by me. Changes HAS_BUTTONBAR into HAVE_BUTTONBAR to bring it in line with the other defines
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17655 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0792596e17
commit
f76122f0e7
12 changed files with 33 additions and 33 deletions
|
@ -47,7 +47,7 @@ filetree.c
|
||||||
scrobbler.c
|
scrobbler.c
|
||||||
|
|
||||||
screen_access.c
|
screen_access.c
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
gui/buttonbar.c
|
gui/buttonbar.c
|
||||||
#endif
|
#endif
|
||||||
gui/gwps.c
|
gui/gwps.c
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "screen_access.h"
|
#include "screen_access.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
#define BUTTONBAR_HEIGHT 8
|
#define BUTTONBAR_HEIGHT 8
|
||||||
#define BUTTONBAR_MAX_BUTTONS 3
|
#define BUTTONBAR_MAX_BUTTONS 3
|
||||||
#define BUTTONBAR_CAPTION_LENGTH 8
|
#define BUTTONBAR_CAPTION_LENGTH 8
|
||||||
|
|
|
@ -79,7 +79,7 @@ void list_init_viewports(struct gui_synclist *list)
|
||||||
list->parent[i]->height = screens[i].height - list->parent[i]->y;
|
list->parent[i]->height = screens[i].height - list->parent[i]->y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
if (list && (list->parent[0] == &parent[0]) && global_settings.buttonbar)
|
if (list && (list->parent[0] == &parent[0]) && global_settings.buttonbar)
|
||||||
list->parent[0]->height -= BUTTONBAR_HEIGHT;
|
list->parent[0]->height -= BUTTONBAR_HEIGHT;
|
||||||
#endif
|
#endif
|
||||||
|
@ -218,11 +218,11 @@ void gui_synclist_draw(struct gui_synclist *gui_list)
|
||||||
int i;
|
int i;
|
||||||
static struct gui_synclist *last_list = NULL;
|
static struct gui_synclist *last_list = NULL;
|
||||||
static int last_count = -1;
|
static int last_count = -1;
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
static bool last_buttonbar = false;
|
static bool last_buttonbar = false;
|
||||||
#endif
|
#endif
|
||||||
if (force_list_reinit ||
|
if (force_list_reinit ||
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
last_buttonbar != screens[SCREEN_MAIN].has_buttonbar ||
|
last_buttonbar != screens[SCREEN_MAIN].has_buttonbar ||
|
||||||
#endif
|
#endif
|
||||||
last_list != gui_list ||
|
last_list != gui_list ||
|
||||||
|
@ -231,7 +231,7 @@ void gui_synclist_draw(struct gui_synclist *gui_list)
|
||||||
list_init_viewports(gui_list);
|
list_init_viewports(gui_list);
|
||||||
force_list_reinit = false;
|
force_list_reinit = false;
|
||||||
}
|
}
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
last_buttonbar = screens[SCREEN_MAIN].has_buttonbar;
|
last_buttonbar = screens[SCREEN_MAIN].has_buttonbar;
|
||||||
#endif
|
#endif
|
||||||
last_count = gui_list->nb_items;
|
last_count = gui_list->nb_items;
|
||||||
|
|
10
apps/menu.c
10
apps/menu.c
|
@ -299,7 +299,7 @@ static void init_default_menu_viewports(struct viewport parent[NB_SCREENS], bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
if (!hide_bars && global_settings.buttonbar)
|
if (!hide_bars && global_settings.buttonbar)
|
||||||
parent[0].height -= BUTTONBAR_HEIGHT;
|
parent[0].height -= BUTTONBAR_HEIGHT;
|
||||||
#endif
|
#endif
|
||||||
|
@ -383,7 +383,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
|
||||||
bool in_stringlist, done = false;
|
bool in_stringlist, done = false;
|
||||||
|
|
||||||
struct viewport *vps, menu_vp[NB_SCREENS]; /* menu_vp will hopefully be phased out */
|
struct viewport *vps, menu_vp[NB_SCREENS]; /* menu_vp will hopefully be phased out */
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
struct gui_buttonbar buttonbar;
|
struct gui_buttonbar buttonbar;
|
||||||
gui_buttonbar_init(&buttonbar);
|
gui_buttonbar_init(&buttonbar);
|
||||||
gui_buttonbar_set_display(&buttonbar, &(screens[SCREEN_MAIN]) );
|
gui_buttonbar_set_display(&buttonbar, &(screens[SCREEN_MAIN]) );
|
||||||
|
@ -418,7 +418,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
|
||||||
get_menu_callback(menu, &menu_callback);
|
get_menu_callback(menu, &menu_callback);
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
if (!hide_bars)
|
if (!hide_bars)
|
||||||
{
|
{
|
||||||
gui_buttonbar_set(&buttonbar, "<<<", "", "");
|
gui_buttonbar_set(&buttonbar, "<<<", "", "");
|
||||||
|
@ -526,7 +526,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
|
||||||
else if (action == ACTION_STD_OK)
|
else if (action == ACTION_STD_OK)
|
||||||
{
|
{
|
||||||
int type;
|
int type;
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
if (!hide_bars)
|
if (!hide_bars)
|
||||||
{
|
{
|
||||||
gui_buttonbar_unset(&buttonbar);
|
gui_buttonbar_unset(&buttonbar);
|
||||||
|
@ -633,7 +633,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
|
||||||
done = true;
|
done = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
if (!hide_bars)
|
if (!hide_bars)
|
||||||
{
|
{
|
||||||
gui_buttonbar_set(&buttonbar, "<<<", "", "");
|
gui_buttonbar_set(&buttonbar, "<<<", "", "");
|
||||||
|
|
|
@ -338,7 +338,7 @@ int kbd_input(char* text, int buflen)
|
||||||
}
|
}
|
||||||
|
|
||||||
char outline[256];
|
char outline[256];
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
struct gui_buttonbar buttonbar;
|
struct gui_buttonbar buttonbar;
|
||||||
bool buttonbar_config = global_settings.buttonbar;
|
bool buttonbar_config = global_settings.buttonbar;
|
||||||
|
|
||||||
|
@ -712,7 +712,7 @@ int kbd_input(char* text, int buflen)
|
||||||
|
|
||||||
cur_blink = !cur_blink;
|
cur_blink = !cur_blink;
|
||||||
|
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
/* draw the button bar */
|
/* draw the button bar */
|
||||||
gui_buttonbar_set(&buttonbar, "Shift", "OK", "Del");
|
gui_buttonbar_set(&buttonbar, "Shift", "OK", "Del");
|
||||||
gui_buttonbar_draw(&buttonbar);
|
gui_buttonbar_draw(&buttonbar);
|
||||||
|
@ -764,7 +764,7 @@ int kbd_input(char* text, int buflen)
|
||||||
FOR_NB_SCREENS(l)
|
FOR_NB_SCREENS(l)
|
||||||
screens[l].setfont(FONT_UI);
|
screens[l].setfont(FONT_UI);
|
||||||
|
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
global_settings.buttonbar=buttonbar_config;
|
global_settings.buttonbar=buttonbar_config;
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1230,7 +1230,7 @@ int kbd_input(char* text, int buflen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
global_settings.buttonbar = buttonbar_config;
|
global_settings.buttonbar = buttonbar_config;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -452,7 +452,7 @@ int radio_screen(void)
|
||||||
int button_timeout = current_tick + (2*HZ);
|
int button_timeout = current_tick + (2*HZ);
|
||||||
#endif
|
#endif
|
||||||
struct viewport vp[NB_SCREENS];
|
struct viewport vp[NB_SCREENS];
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
struct gui_buttonbar buttonbar;
|
struct gui_buttonbar buttonbar;
|
||||||
gui_buttonbar_init(&buttonbar);
|
gui_buttonbar_init(&buttonbar);
|
||||||
gui_buttonbar_set_display(&buttonbar, &(screens[SCREEN_MAIN]) );
|
gui_buttonbar_set_display(&buttonbar, &(screens[SCREEN_MAIN]) );
|
||||||
|
@ -468,7 +468,7 @@ int radio_screen(void)
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
{
|
{
|
||||||
viewport_set_defaults(&vp[i], i);
|
viewport_set_defaults(&vp[i], i);
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
if (global_settings.buttonbar)
|
if (global_settings.buttonbar)
|
||||||
vp[i].height -= BUTTONBAR_HEIGHT;
|
vp[i].height -= BUTTONBAR_HEIGHT;
|
||||||
#endif
|
#endif
|
||||||
|
@ -532,7 +532,7 @@ int radio_screen(void)
|
||||||
if(curr_preset != -1)
|
if(curr_preset != -1)
|
||||||
radio_mode = RADIO_PRESET_MODE;
|
radio_mode = RADIO_PRESET_MODE;
|
||||||
|
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
gui_buttonbar_set(&buttonbar, str(LANG_BUTTONBAR_MENU),
|
gui_buttonbar_set(&buttonbar, str(LANG_BUTTONBAR_MENU),
|
||||||
str(LANG_PRESET), str(LANG_FM_BUTTONBAR_RECORD));
|
str(LANG_PRESET), str(LANG_FM_BUTTONBAR_RECORD));
|
||||||
#endif
|
#endif
|
||||||
|
@ -728,7 +728,7 @@ int radio_screen(void)
|
||||||
screens[i].update_viewport();
|
screens[i].update_viewport();
|
||||||
screens[i].set_viewport(NULL);
|
screens[i].set_viewport(NULL);
|
||||||
}
|
}
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
gui_buttonbar_set(&buttonbar, str(LANG_BUTTONBAR_MENU),
|
gui_buttonbar_set(&buttonbar, str(LANG_BUTTONBAR_MENU),
|
||||||
str(LANG_PRESET),
|
str(LANG_PRESET),
|
||||||
str(LANG_FM_BUTTONBAR_RECORD));
|
str(LANG_FM_BUTTONBAR_RECORD));
|
||||||
|
@ -760,7 +760,7 @@ int radio_screen(void)
|
||||||
screens[i].update_viewport();
|
screens[i].update_viewport();
|
||||||
screens[i].set_viewport(NULL);
|
screens[i].set_viewport(NULL);
|
||||||
}
|
}
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
gui_buttonbar_set(&buttonbar,
|
gui_buttonbar_set(&buttonbar,
|
||||||
str(LANG_BUTTONBAR_MENU),
|
str(LANG_BUTTONBAR_MENU),
|
||||||
str(LANG_PRESET),
|
str(LANG_PRESET),
|
||||||
|
@ -952,7 +952,7 @@ int radio_screen(void)
|
||||||
screens[i].set_viewport(NULL);
|
screens[i].set_viewport(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
gui_buttonbar_draw(&buttonbar);
|
gui_buttonbar_draw(&buttonbar);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1337,14 +1337,14 @@ static int handle_radio_presets(void)
|
||||||
struct gui_synclist lists;
|
struct gui_synclist lists;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
int action = ACTION_NONE;
|
int action = ACTION_NONE;
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
struct gui_buttonbar buttonbar;
|
struct gui_buttonbar buttonbar;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(presets_loaded == false)
|
if(presets_loaded == false)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
gui_buttonbar_init(&buttonbar);
|
gui_buttonbar_init(&buttonbar);
|
||||||
gui_buttonbar_set_display(&buttonbar, &(screens[SCREEN_MAIN]) );
|
gui_buttonbar_set_display(&buttonbar, &(screens[SCREEN_MAIN]) );
|
||||||
gui_buttonbar_set(&buttonbar, str(LANG_FM_BUTTONBAR_ADD),
|
gui_buttonbar_set(&buttonbar, str(LANG_FM_BUTTONBAR_ADD),
|
||||||
|
|
|
@ -128,7 +128,7 @@ struct screen screens[NB_SCREENS] =
|
||||||
.backlight_off=&backlight_off,
|
.backlight_off=&backlight_off,
|
||||||
.is_backlight_on=&is_backlight_on,
|
.is_backlight_on=&is_backlight_on,
|
||||||
.backlight_set_timeout=&backlight_set_timeout,
|
.backlight_set_timeout=&backlight_set_timeout,
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
.has_buttonbar=false
|
.has_buttonbar=false
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
|
@ -239,7 +239,7 @@ void screen_access_init(void)
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
if(global_settings.statusbar)
|
if(global_settings.statusbar)
|
||||||
height -= STATUSBAR_HEIGHT;
|
height -= STATUSBAR_HEIGHT;
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
if(global_settings.buttonbar && display->has_buttonbar)
|
if(global_settings.buttonbar && display->has_buttonbar)
|
||||||
height -= BUTTONBAR_HEIGHT;
|
height -= BUTTONBAR_HEIGHT;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -68,7 +68,7 @@ struct screen
|
||||||
#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
|
#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
|
||||||
bool has_disk_led;
|
bool has_disk_led;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
bool has_buttonbar;
|
bool has_buttonbar;
|
||||||
#endif
|
#endif
|
||||||
void (*set_viewport)(struct viewport* vp);
|
void (*set_viewport)(struct viewport* vp);
|
||||||
|
@ -155,7 +155,7 @@ struct screen
|
||||||
void (*backlight_set_timeout)(int index);
|
void (*backlight_set_timeout)(int index);
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
/*
|
/*
|
||||||
* Sets if the given screen has a buttonbar or not
|
* Sets if the given screen has a buttonbar or not
|
||||||
* - screen : the screen structure
|
* - screen : the screen structure
|
||||||
|
|
|
@ -89,7 +89,7 @@ struct gui_synclist tree_lists;
|
||||||
|
|
||||||
/* I put it here because other files doesn't use it yet,
|
/* I put it here because other files doesn't use it yet,
|
||||||
* but should be elsewhere since it will be used mostly everywhere */
|
* but should be elsewhere since it will be used mostly everywhere */
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
struct gui_buttonbar tree_buttonbar;
|
struct gui_buttonbar tree_buttonbar;
|
||||||
#endif
|
#endif
|
||||||
static struct tree_context tc;
|
static struct tree_context tc;
|
||||||
|
@ -299,7 +299,7 @@ void tree_gui_init(void)
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
screens[i].double_height(false);
|
screens[i].double_height(false);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
gui_buttonbar_init(&tree_buttonbar);
|
gui_buttonbar_init(&tree_buttonbar);
|
||||||
/* since archos only have one screen, no need to create more than that */
|
/* since archos only have one screen, no need to create more than that */
|
||||||
gui_buttonbar_set_display(&tree_buttonbar, &(screens[SCREEN_MAIN]) );
|
gui_buttonbar_set_display(&tree_buttonbar, &(screens[SCREEN_MAIN]) );
|
||||||
|
@ -463,7 +463,7 @@ static int update_dir(void)
|
||||||
tc.selected_item=tc.filesindir-1;
|
tc.selected_item=tc.filesindir-1;
|
||||||
|
|
||||||
gui_synclist_select_item(&tree_lists, tc.selected_item);
|
gui_synclist_select_item(&tree_lists, tc.selected_item);
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
if (global_settings.buttonbar) {
|
if (global_settings.buttonbar) {
|
||||||
if (*tc.dirfilter < NUM_FILTER_MODES)
|
if (*tc.dirfilter < NUM_FILTER_MODES)
|
||||||
gui_buttonbar_set(&tree_buttonbar, str(LANG_SYSFONT_DIRBROWSE_F1),
|
gui_buttonbar_set(&tree_buttonbar, str(LANG_SYSFONT_DIRBROWSE_F1),
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
/* define this if you have access to the pitchscreen */
|
/* define this if you have access to the pitchscreen */
|
||||||
#define HAVE_PITCHSCREEN
|
#define HAVE_PITCHSCREEN
|
||||||
/* define this if you have the button bar */
|
/* define this if you have the button bar */
|
||||||
#define HAS_BUTTONBAR
|
#define HAVE_BUTTONBAR
|
||||||
|
|
||||||
/* define this if you would like tagcache to build on this target */
|
/* define this if you would like tagcache to build on this target */
|
||||||
#define HAVE_TAGCACHE
|
#define HAVE_TAGCACHE
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
/* define this if you have access to the pitchscreen */
|
/* define this if you have access to the pitchscreen */
|
||||||
#define HAVE_PITCHSCREEN
|
#define HAVE_PITCHSCREEN
|
||||||
/* define this if you have the button bar */
|
/* define this if you have the button bar */
|
||||||
#define HAS_BUTTONBAR
|
#define HAVE_BUTTONBAR
|
||||||
|
|
||||||
/* define this if you would like tagcache to build on this target */
|
/* define this if you would like tagcache to build on this target */
|
||||||
#define HAVE_TAGCACHE
|
#define HAVE_TAGCACHE
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
/* define this if you have access to the pitchscreen */
|
/* define this if you have access to the pitchscreen */
|
||||||
#define HAVE_PITCHSCREEN
|
#define HAVE_PITCHSCREEN
|
||||||
/* define this if you have the button bar */
|
/* define this if you have the button bar */
|
||||||
#define HAS_BUTTONBAR
|
#define HAVE_BUTTONBAR
|
||||||
|
|
||||||
/* define this if you would like tagcache to build on this target */
|
/* define this if you would like tagcache to build on this target */
|
||||||
#define HAVE_TAGCACHE
|
#define HAVE_TAGCACHE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue