1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 Jonathan Gordon
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
30 #ifdef HAVE_LCD_BITMAP
31 #include "peakmeter.h"
34 #include "color_picker.h"
36 #include "lcd-remote.h"
38 #if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
41 #include "exported_menus.h"
46 * Menu to clear the backdrop image
48 static int clear_main_backdrop(void)
50 global_settings
.backdrop_file
[0]=0;
51 unload_main_backdrop();
56 MENUITEM_FUNCTION(clear_main_bd
, 0, ID2P(LANG_CLEAR_BACKDROP
),
57 clear_main_backdrop
, NULL
, NULL
, Icon_NOICON
);
61 * Menu for fore/back colors
63 static int set_fg_color(void)
66 res
= (int)set_color(&screens
[SCREEN_MAIN
],str(LANG_FOREGROUND_COLOR
),
67 &global_settings
.fg_color
,global_settings
.bg_color
);
69 screens
[SCREEN_MAIN
].set_foreground(global_settings
.fg_color
);
74 static int set_bg_color(void)
77 res
= (int)set_color(&screens
[SCREEN_MAIN
],str(LANG_BACKGROUND_COLOR
),
78 &global_settings
.bg_color
,global_settings
.fg_color
);
80 screens
[SCREEN_MAIN
].set_background(global_settings
.bg_color
);
85 /* Line selector colour */
86 static int set_lss_color(void)
89 res
= (int)set_color(&screens
[SCREEN_MAIN
],str(LANG_SELECTOR_START_COLOR
),
90 &global_settings
.lss_color
,-1);
92 screens
[SCREEN_MAIN
].set_selector_start(global_settings
.lss_color
);
97 static int set_lse_color(void)
100 res
= (int)set_color(&screens
[SCREEN_MAIN
],str(LANG_SELECTOR_END_COLOR
),
101 &global_settings
.lse_color
,-1);
103 screens
[SCREEN_MAIN
].set_selector_end(global_settings
.lse_color
);
108 /* Line selector text colour */
109 static int set_lst_color(void)
112 res
= (int)set_color(&screens
[SCREEN_MAIN
],str(LANG_SELECTOR_TEXT_COLOR
),
113 &global_settings
.lst_color
,global_settings
.lss_color
);
115 screens
[SCREEN_MAIN
].set_selector_text(global_settings
.lst_color
);
120 static int reset_color(void)
122 global_settings
.fg_color
= LCD_DEFAULT_FG
;
123 global_settings
.bg_color
= LCD_DEFAULT_BG
;
124 global_settings
.lss_color
= LCD_DEFAULT_LS
;
125 global_settings
.lse_color
= LCD_DEFAULT_BG
;
126 global_settings
.lst_color
= LCD_DEFAULT_FG
;
128 screens
[SCREEN_MAIN
].set_foreground(global_settings
.fg_color
);
129 screens
[SCREEN_MAIN
].set_background(global_settings
.bg_color
);
130 screens
[SCREEN_MAIN
].set_selector_start(global_settings
.lss_color
);
131 screens
[SCREEN_MAIN
].set_selector_end(global_settings
.lse_color
);
132 screens
[SCREEN_MAIN
].set_selector_text(global_settings
.lst_color
);
136 MENUITEM_FUNCTION(set_bg_col
, 0, ID2P(LANG_BACKGROUND_COLOR
),
137 set_bg_color
, NULL
, NULL
, Icon_NOICON
);
138 MENUITEM_FUNCTION(set_fg_col
, 0, ID2P(LANG_FOREGROUND_COLOR
),
139 set_fg_color
, NULL
, NULL
, Icon_NOICON
);
140 MENUITEM_FUNCTION(set_lss_col
, 0, ID2P(LANG_SELECTOR_START_COLOR
),
141 set_lss_color
, NULL
, NULL
, Icon_NOICON
);
142 MENUITEM_FUNCTION(set_lse_col
, 0, ID2P(LANG_SELECTOR_END_COLOR
),
143 set_lse_color
, NULL
, NULL
, Icon_NOICON
);
144 MENUITEM_FUNCTION(set_lst_col
, 0, ID2P(LANG_SELECTOR_TEXT_COLOR
),
145 set_lst_color
, NULL
, NULL
, Icon_NOICON
);
146 MENUITEM_FUNCTION(reset_colors
, 0, ID2P(LANG_RESET_COLORS
),
147 reset_color
, NULL
, NULL
, Icon_NOICON
);
149 MAKE_MENU(lss_settings
, ID2P(LANG_SELECTOR_COLOR_MENU
),
151 &set_lss_col
, &set_lse_col
, &set_lst_col
154 /* now the actual menu */
155 MAKE_MENU(colors_settings
, ID2P(LANG_COLORS_MENU
),
156 NULL
, Icon_Display_menu
,
158 &set_bg_col
, &set_fg_col
, &reset_colors
161 #endif /* HAVE_LCD_COLOR */
163 /***********************************/
165 #ifdef HAVE_LCD_BITMAP
166 static struct browse_folder_info fonts
= {FONT_DIR
, SHOW_FONT
};
168 static struct browse_folder_info wps
= {WPS_DIR
, SHOW_WPS
};
169 #ifdef HAVE_REMOTE_LCD
170 static struct browse_folder_info rwps
= {WPS_DIR
, SHOW_RWPS
};
172 static struct browse_folder_info themes
= {THEME_DIR
, SHOW_CFG
};
174 int browse_folder(void *param
)
176 const struct browse_folder_info
*info
=
177 (const struct browse_folder_info
*)param
;
178 return rockbox_browse(info
->dir
, info
->show_options
);
181 #ifdef HAVE_LCD_BITMAP
182 MENUITEM_FUNCTION(browse_fonts
, MENU_FUNC_USEPARAM
,
183 ID2P(LANG_CUSTOM_FONT
),
184 browse_folder
, (void*)&fonts
, NULL
, Icon_Font
);
186 MENUITEM_FUNCTION(browse_wps
, MENU_FUNC_USEPARAM
,
187 ID2P(LANG_WHILE_PLAYING
),
188 browse_folder
, (void*)&wps
, NULL
, Icon_Wps
);
189 #ifdef HAVE_REMOTE_LCD
190 MENUITEM_FUNCTION(browse_rwps
, MENU_FUNC_USEPARAM
,
191 ID2P(LANG_REMOTE_WHILE_PLAYING
),
192 browse_folder
, (void*)&rwps
, NULL
, Icon_Wps
);
195 MENUITEM_SETTING(show_icons
, &global_settings
.show_icons
, NULL
);
196 MENUITEM_FUNCTION(browse_themes
, MENU_FUNC_USEPARAM
,
197 ID2P(LANG_CUSTOM_THEME
),
198 browse_folder
, (void*)&themes
, NULL
, Icon_Config
);
199 #ifdef HAVE_LCD_BITMAP
200 MENUITEM_SETTING(cursor_style
, &global_settings
.cursor_style
, NULL
);
203 MAKE_MENU(theme_menu
, ID2P(LANG_THEME_MENU
),
206 #ifdef HAVE_LCD_BITMAP
210 #ifdef HAVE_REMOTE_LCD
217 #ifdef HAVE_LCD_BITMAP
220 #ifdef HAVE_LCD_COLOR