Move drawing, input and utils code into separate library

This commit is contained in:
Vojtech Bocek
2015-02-16 21:01:06 +01:00
parent 2449b5b27e
commit 7db8f34697
64 changed files with 772 additions and 544 deletions

View File

@@ -18,8 +18,8 @@
#include "multirom_ui.h"
#include "multirom_ui_themes.h"
#include "multirom.h"
#include "util.h"
#include "log.h"
#include "lib/util.h"
#include "lib/log.h"
multirom_themes_info *multirom_ui_init_themes(void)
{
@@ -67,140 +67,3 @@ multirom_theme *multirom_ui_select_theme(multirom_themes_info *i, int w, int h)
return universal;
}
static const struct multirom_color_theme color_themes[] = {
// 0 - red/white, default
{
.background = 0xFFDCDCDC,
.highlight_bg = 0xFFF72F2F,
.highlight_hover = 0xFFF85555,
.highlight_text = 0xFFFFFFFF,
.text = 0xFF000000,
.text_secondary = 0xFF4D4D4D,
.ncard_bg = 0xFF37474F,
.ncard_text = 0xFFFFFFFF,
.ncard_text_secondary = 0xFFE6E6E6,
.ncard_shadow = 0x54000000,
.rom_highlight = 0xFFFFFFFF,
.rom_highlight_shadow = 0x54000000,
.keyaction_frame = 0xFF0000FF,
},
// 1 - orange/white
{
.background = 0xFFDCDCDC,
.highlight_bg = 0xFFFF5722,
.highlight_hover = 0xFFFF8A65,
.highlight_text = 0xFFFFFFFF,
.text = 0xFF000000,
.text_secondary = 0xFF4D4D4D,
.ncard_bg = 0xFF37474F,
.ncard_text = 0xFFFFFFFF,
.ncard_text_secondary = 0xFFE6E6E6,
.ncard_shadow = 0x54000000,
.rom_highlight = 0xFFFFFFFF,
.rom_highlight_shadow = 0x54000000,
.keyaction_frame = 0xFFFF0000,
},
// 2 - blue/white
{
.background = 0xFFDCDCDC,
.highlight_bg = 0xFF5677FC,
.highlight_hover = 0xFF91A7FF,
.highlight_text = 0xFFFFFFFF,
.text = 0xFF000000,
.text_secondary = 0xFF4D4D4D,
.ncard_bg = 0xFF37474F,
.ncard_text = 0xFFFFFFFF,
.ncard_text_secondary = 0xFFE6E6E6,
.ncard_shadow = 0x54000000,
.rom_highlight = 0xFFFFFFFF,
.rom_highlight_shadow = 0x54000000,
.keyaction_frame = 0xFFFF0000,
},
// 3 - purple/white
{
.background = 0xFFDCDCDC,
.highlight_bg = 0xFF673AB7,
.highlight_hover = 0xFF9575CD,
.highlight_text = 0xFFFFFFFF,
.text = 0xFF000000,
.text_secondary = 0xFF4D4D4D,
.ncard_bg = 0xFF37474F,
.ncard_text = 0xFFFFFFFF,
.ncard_text_secondary = 0xFFE6E6E6,
.ncard_shadow = 0x54000000,
.rom_highlight = 0xFFFFFFFF,
.rom_highlight_shadow = 0x54000000,
.keyaction_frame = 0xFFFF0000,
},
// 4 - green/white
{
.background = 0xFFDCDCDC,
.highlight_bg = 0xFF259B24,
.highlight_hover = 0xFF72D572,
.highlight_text = 0xFFFFFFFF,
.text = 0xFF000000,
.text_secondary = 0xFF4D4D4D,
.ncard_bg = 0xFF37474F,
.ncard_text = 0xFFFFFFFF,
.ncard_text_secondary = 0xFFE6E6E6,
.ncard_shadow = 0x54000000,
.rom_highlight = 0xFFFFFFFF,
.rom_highlight_shadow = 0x54000000,
.keyaction_frame = 0xFFFF0000,
},
// 5 - dark blue
{
.background = 0xFF263238,
.highlight_bg = 0xFF607D8B,
.highlight_hover = 0xFF90A4AE,
.highlight_text = 0xFFFFFFFF,
.text = 0xFFFFFFFF,
.text_secondary = 0xFFE6E6E6,
.ncard_bg = 0xFF37474F,
.ncard_text = 0xFFFFFFFF,
.ncard_text_secondary = 0xFFE6E6E6,
.ncard_shadow = 0x54000000,
.rom_highlight = 0xFF607D8B,
.rom_highlight_shadow = 0x54000000,
.keyaction_frame = 0xFFFF0000,
},
// 6 - dark blue/black
{
.background = 0xFF000000,
.highlight_bg = 0xFF263238,
.highlight_hover = 0xFF607D8B,
.highlight_text = 0xFFFFFFFF,
.text = 0xFFFFFFFF,
.text_secondary = 0xFFE6E6E6,
.ncard_bg = 0xFF37474F,
.ncard_text = 0xFFFFFFFF,
.ncard_text_secondary = 0xFFE6E6E6,
.ncard_shadow = 0x54424242,
.rom_highlight = 0xFF263238,
.rom_highlight_shadow = 0x54424242,
.keyaction_frame = 0xFFFF0000,
},
};
const struct multirom_color_theme *color_theme = &color_themes[0];
void multirom_ui_select_color(size_t color_theme_idx)
{
if(color_theme_idx >= ARRAY_SIZE(color_themes))
return;
color_theme = &color_themes[color_theme_idx];
}
const struct multirom_color_theme *multirom_ui_get_color_theme(size_t color_theme_idx)
{
if(color_theme_idx >= ARRAY_SIZE(color_themes))
return NULL;
return &color_themes[color_theme_idx];
}
int multirom_ui_get_color_theme_count(void)
{
return ARRAY_SIZE(color_themes);
}