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 #include "exported_menus.h"
42 * Menu to clear the backdrop image
44 static int clear_main_backdrop(void)
46 global_settings
.backdrop_file
[0]=0;
47 unload_main_backdrop();
52 MENUITEM_FUNCTION(clear_main_bd
, 0, ID2P(LANG_CLEAR_BACKDROP
),
53 clear_main_backdrop
, NULL
, NULL
, Icon_NOICON
);
65 static struct colour_info
69 } colors
[COLOR_COUNT
] = {
70 [COLOR_FG
] = {&global_settings
.fg_color
, LANG_FOREGROUND_COLOR
},
71 [COLOR_BG
] = {&global_settings
.bg_color
, LANG_BACKGROUND_COLOR
},
72 [COLOR_LSS
] = {&global_settings
.lss_color
, LANG_SELECTOR_START_COLOR
},
73 [COLOR_LSE
] = {&global_settings
.lse_color
, LANG_SELECTOR_END_COLOR
},
74 [COLOR_LST
] = {&global_settings
.lst_color
, LANG_SELECTOR_TEXT_COLOR
},
78 * Menu for fore/back/selection colors
80 static int set_color_func(void* color
)
82 int res
, c
= (intptr_t)color
, banned_color
=-1;
84 /* Don't let foreground be set the same as background and vice-versa */
86 banned_color
= *colors
[COLOR_FG
].setting
;
87 else if (c
== COLOR_FG
)
88 banned_color
= *colors
[COLOR_BG
].setting
;
90 res
= (int)set_color(&screens
[SCREEN_MAIN
],str(colors
[c
].lang_id
),
91 colors
[c
].setting
, banned_color
);
93 settings_apply(false);
97 static int reset_color(void)
99 global_settings
.fg_color
= LCD_DEFAULT_FG
;
100 global_settings
.bg_color
= LCD_DEFAULT_BG
;
101 global_settings
.lss_color
= LCD_DEFAULT_LS
;
102 global_settings
.lse_color
= LCD_DEFAULT_BG
;
103 global_settings
.lst_color
= LCD_DEFAULT_FG
;
106 settings_apply(false);
109 MENUITEM_FUNCTION(set_bg_col
, MENU_FUNC_USEPARAM
, ID2P(LANG_BACKGROUND_COLOR
),
110 set_color_func
, (void*)COLOR_BG
, NULL
, Icon_NOICON
);
111 MENUITEM_FUNCTION(set_fg_col
, MENU_FUNC_USEPARAM
, ID2P(LANG_FOREGROUND_COLOR
),
112 set_color_func
, (void*)COLOR_FG
, NULL
, Icon_NOICON
);
113 MENUITEM_FUNCTION(set_lss_col
, MENU_FUNC_USEPARAM
, ID2P(LANG_SELECTOR_START_COLOR
),
114 set_color_func
, (void*)COLOR_LSS
, NULL
, Icon_NOICON
);
115 MENUITEM_FUNCTION(set_lse_col
, MENU_FUNC_USEPARAM
, ID2P(LANG_SELECTOR_END_COLOR
),
116 set_color_func
, (void*)COLOR_LSE
, NULL
, Icon_NOICON
);
117 MENUITEM_FUNCTION(set_lst_col
, MENU_FUNC_USEPARAM
, ID2P(LANG_SELECTOR_TEXT_COLOR
),
118 set_color_func
, (void*)COLOR_LST
, NULL
, Icon_NOICON
);
119 MENUITEM_FUNCTION(reset_colors
, 0, ID2P(LANG_RESET_COLORS
),
120 reset_color
, NULL
, NULL
, Icon_NOICON
);
122 MAKE_MENU(lss_settings
, ID2P(LANG_SELECTOR_COLOR_MENU
),
124 &set_lss_col
, &set_lse_col
, &set_lst_col
127 /* now the actual menu */
128 MAKE_MENU(colors_settings
, ID2P(LANG_COLORS_MENU
),
129 NULL
, Icon_Display_menu
,
131 &set_bg_col
, &set_fg_col
, &reset_colors
134 #endif /* HAVE_LCD_COLOR */
136 /***********************************/
138 #ifdef HAVE_LCD_BITMAP
139 static struct browse_folder_info fonts
= {FONT_DIR
, SHOW_FONT
};
141 static struct browse_folder_info wps
= {WPS_DIR
, SHOW_WPS
};
142 #ifdef HAVE_REMOTE_LCD
143 static struct browse_folder_info rwps
= {WPS_DIR
, SHOW_RWPS
};
145 static struct browse_folder_info themes
= {THEME_DIR
, SHOW_CFG
};
147 int browse_folder(void *param
)
149 const struct browse_folder_info
*info
=
150 (const struct browse_folder_info
*)param
;
151 return rockbox_browse(info
->dir
, info
->show_options
);
154 #ifdef HAVE_LCD_BITMAP
155 MENUITEM_FUNCTION(browse_fonts
, MENU_FUNC_USEPARAM
,
156 ID2P(LANG_CUSTOM_FONT
),
157 browse_folder
, (void*)&fonts
, NULL
, Icon_Font
);
159 MENUITEM_FUNCTION(browse_wps
, MENU_FUNC_USEPARAM
,
160 ID2P(LANG_WHILE_PLAYING
),
161 browse_folder
, (void*)&wps
, NULL
, Icon_Wps
);
162 #ifdef HAVE_REMOTE_LCD
163 MENUITEM_FUNCTION(browse_rwps
, MENU_FUNC_USEPARAM
,
164 ID2P(LANG_REMOTE_WHILE_PLAYING
),
165 browse_folder
, (void*)&rwps
, NULL
, Icon_Wps
);
168 MENUITEM_SETTING(show_icons
, &global_settings
.show_icons
, NULL
);
169 MENUITEM_FUNCTION(browse_themes
, MENU_FUNC_USEPARAM
,
170 ID2P(LANG_CUSTOM_THEME
),
171 browse_folder
, (void*)&themes
, NULL
, Icon_Config
);
172 #ifdef HAVE_LCD_BITMAP
173 MENUITEM_SETTING(cursor_style
, &global_settings
.cursor_style
, NULL
);
176 MAKE_MENU(theme_menu
, ID2P(LANG_THEME_MENU
),
179 #ifdef HAVE_LCD_BITMAP
183 #ifdef HAVE_REMOTE_LCD
190 #ifdef HAVE_LCD_BITMAP
193 #ifdef HAVE_LCD_COLOR