diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 0fed890e68..07d428af77 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -71,1246 +71,6 @@ #define MUI_TICKER_SPACER "\xE2\x80\x83\xE2\x80\xA2\xE2\x80\x83" #endif -/* ============================== - * Colour Themes START - * ============================== */ - -/* Theme colours */ -typedef struct -{ - /* Text (& small inline icon) colours */ - uint32_t on_sys_bar; - uint32_t on_header; - uint32_t list_text; - uint32_t list_text_highlighted; - uint32_t list_hint_text; - uint32_t list_hint_text_highlighted; - uint32_t status_bar_text; - /* Background colours */ - uint32_t sys_bar_background; - uint32_t title_bar_background; - uint32_t list_background; - uint32_t list_highlighted_background; - uint32_t nav_bar_background; - uint32_t surface_background; - uint32_t thumbnail_background; - uint32_t side_bar_background; - uint32_t status_bar_background; - /* List icon colours */ - uint32_t list_icon; - uint32_t list_switch_on; - uint32_t list_switch_on_background; - uint32_t list_switch_off; - uint32_t list_switch_off_background; - /* Navigation bar icon colours */ - uint32_t nav_bar_icon_active; - uint32_t nav_bar_icon_passive; - uint32_t nav_bar_icon_disabled; - /* Screensaver */ - uint32_t screensaver_tint; - /* Misc. colours */ - uint32_t header_shadow; - uint32_t landscape_border_shadow; - uint32_t status_bar_shadow; - uint32_t selection_marker_shadow; - uint32_t scrollbar; - uint32_t divider; - uint32_t screen_fade; - uint32_t missing_thumbnail_icon; - float header_shadow_opacity; - float landscape_border_shadow_opacity; - float status_bar_shadow_opacity; - float selection_marker_shadow_opacity; - float screen_fade_opacity; -} materialui_theme_t; - -static const materialui_theme_t materialui_theme_blue = { - /* Text (& small inline icon) colours */ - 0xDEDEDE, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0x212121, /* list_text */ - 0x000000, /* list_text_highlighted */ - 0x666666, /* list_hint_text */ - 0x212121, /* list_hint_text_highlighted */ - 0x000000, /* status_bar_text */ - /* Background colours */ - 0x0069c0, /* sys_bar_background */ - 0x2196f3, /* title_bar_background */ - 0xF5F5F6, /* list_background */ - 0xc1d5e0, /* list_highlighted_background */ - 0xE1E2E1, /* nav_bar_background */ - 0xFFFFFF, /* surface_background */ - 0x242424, /* thumbnail_background */ - 0xc1d5e0, /* side_bar_background */ - 0x9F9FA0, /* status_bar_background */ - /* List icon colours */ - 0x0069c0, /* list_icon */ - 0x2196f3, /* list_switch_on */ - 0x6ec6ff, /* list_switch_on_background */ - 0x808e95, /* list_switch_off */ - 0xbabdbe, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x0069c0, /* nav_bar_icon_active */ - 0x9ea7aa, /* nav_bar_icon_passive */ - 0xffffff, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xF5F5F6, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x0069c0, /* scrollbar */ - 0x9ea7aa, /* divider */ - 0x000000, /* screen_fade */ - 0xF5F5F6, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.35f, /* landscape_border_shadow_opacity */ - 0.45f, /* status_bar_shadow_opacity */ - 0.1f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_blue_grey = { - /* Text (& small inline icon) colours */ - 0xDEDEDE, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0x212121, /* list_text */ - 0x000000, /* list_text_highlighted */ - 0x666666, /* list_hint_text */ - 0x212121, /* list_hint_text_highlighted */ - 0x000000, /* status_bar_text */ - /* Background colours */ - 0x34515e, /* sys_bar_background */ - 0x607d8b, /* title_bar_background */ - 0xF5F5F6, /* list_background */ - 0xe0e0e0, /* list_highlighted_background */ - 0xE1E2E1, /* nav_bar_background */ - 0xFFFFFF, /* surface_background */ - 0x242424, /* thumbnail_background */ - 0xe0e0e0, /* side_bar_background */ - 0x9F9FA0, /* status_bar_background */ - /* List icon colours */ - 0x34515e, /* list_icon */ - 0x607d8b, /* list_switch_on */ - 0x8eacbb, /* list_switch_on_background */ - 0xbcbcbc, /* list_switch_off */ - 0xc7c7c7, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x34515e, /* nav_bar_icon_active */ - 0xaeaeae, /* nav_bar_icon_passive */ - 0xffffff, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xF5F5F6, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x34515e, /* scrollbar */ - 0xc2c2c2, /* divider */ - 0x000000, /* screen_fade */ - 0xF5F5F6, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.35f, /* landscape_border_shadow_opacity */ - 0.45f, /* status_bar_shadow_opacity */ - 0.2f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_dark_blue = { - /* Text (& small inline icon) colours */ - 0xC4C4C4, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0xDEDEDE, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0x999999, /* list_hint_text */ - 0xDEDEDE, /* list_hint_text_highlighted */ - 0x999999, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x1F1F1F, /* title_bar_background */ - 0x121212, /* list_background */ - 0x34515e, /* list_highlighted_background */ - 0x242424, /* nav_bar_background */ - 0x1D1D1D, /* surface_background */ - 0x000000, /* thumbnail_background */ - 0x1D1D1D, /* side_bar_background */ - 0x242424, /* status_bar_background */ - /* List icon colours */ - 0x90caf9, /* list_icon */ - 0x64b5f6, /* list_switch_on */ - 0x5d99c6, /* list_switch_on_background */ - 0x4b636e, /* list_switch_off */ - 0x607d8b, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x6ec6ff, /* nav_bar_icon_active */ - 0xA5B4BB, /* nav_bar_icon_passive */ - 0x000000, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xDEDEDE, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x3B3B3B, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x3B3B3B, /* selection_marker_shadow */ - 0x90caf9, /* scrollbar */ - 0x607d8b, /* divider */ - 0x000000, /* screen_fade */ - 0xDEDEDE, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.8f, /* status_bar_shadow_opacity */ - 0.2f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_green = { - /* Text (& small inline icon) colours */ - 0xDEDEDE, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0x212121, /* list_text */ - 0x000000, /* list_text_highlighted */ - 0x666666, /* list_hint_text */ - 0x212121, /* list_hint_text_highlighted */ - 0x000000, /* status_bar_text */ - /* Background colours */ - 0x087f23, /* sys_bar_background */ - 0x4caf50, /* title_bar_background */ - 0xF5F5F6, /* list_background */ - 0xdcedc8, /* list_highlighted_background */ - 0xE1E2E1, /* nav_bar_background */ - 0xFFFFFF, /* surface_background */ - 0x242424, /* thumbnail_background */ - 0xdcedc8, /* side_bar_background */ - 0x9F9FA0, /* status_bar_background */ - /* List icon colours */ - 0x087f23, /* list_icon */ - 0x4caf50, /* list_switch_on */ - 0x80e27e, /* list_switch_on_background */ - 0xaabb97, /* list_switch_off */ - 0xbec5b7, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x087f23, /* nav_bar_icon_active */ - 0xaeaeae, /* nav_bar_icon_passive */ - 0xffffff, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xF5F5F6, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x087f23, /* scrollbar */ - 0xaabb97, /* divider */ - 0x000000, /* screen_fade */ - 0xF5F5F6, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.35f, /* landscape_border_shadow_opacity */ - 0.45f, /* status_bar_shadow_opacity */ - 0.15f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_red = { - /* Text (& small inline icon) colours */ - 0xDEDEDE, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0x212121, /* list_text */ - 0x000000, /* list_text_highlighted */ - 0x666666, /* list_hint_text */ - 0x212121, /* list_hint_text_highlighted */ - 0x000000, /* status_bar_text */ - /* Background colours */ - 0xba000d, /* sys_bar_background */ - 0xf44336, /* title_bar_background */ - 0xF5F5F6, /* list_background */ - 0xf8bbd0, /* list_highlighted_background */ - 0xE1E2E1, /* nav_bar_background */ - 0xFFFFFF, /* surface_background */ - 0x242424, /* thumbnail_background */ - 0xf8bbd0, /* side_bar_background */ - 0x9F9FA0, /* status_bar_background */ - /* List icon colours */ - 0xba000d, /* list_icon */ - 0xf44336, /* list_switch_on */ - 0xff7961, /* list_switch_on_background */ - 0xbf5f82, /* list_switch_off */ - 0xc48b9f, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0xba000d, /* nav_bar_icon_active */ - 0xaeaeae, /* nav_bar_icon_passive */ - 0xffffff, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xF5F5F6, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0xba000d, /* scrollbar */ - 0xbf5f82, /* divider */ - 0x000000, /* screen_fade */ - 0xF5F5F6, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.35f, /* landscape_border_shadow_opacity */ - 0.45f, /* status_bar_shadow_opacity */ - 0.15f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_yellow = { - /* Text (& small inline icon) colours */ - 0x212121, /* on_sys_bar */ - 0x000000, /* on_header */ - 0x212121, /* list_text */ - 0x000000, /* list_text_highlighted */ - 0x666666, /* list_hint_text */ - 0x212121, /* list_hint_text_highlighted */ - 0x000000, /* status_bar_text */ - /* Background colours */ - 0xc8b900, /* sys_bar_background */ - 0xffeb3b, /* title_bar_background */ - 0xF5F5F6, /* list_background */ - 0xffecb3, /* list_highlighted_background */ - 0xE1E2E1, /* nav_bar_background */ - 0xFFFFFF, /* surface_background */ - 0x242424, /* thumbnail_background */ - 0xffecb3, /* side_bar_background */ - 0x9F9FA0, /* status_bar_background */ - /* List icon colours */ - 0xc6a700, /* list_icon */ - 0xffeb3b, /* list_switch_on */ - 0xccc5af, /* list_switch_on_background */ - 0xcaae53, /* list_switch_off */ - 0xccc5af, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0xc6a700, /* nav_bar_icon_active */ - 0xaeaeae, /* nav_bar_icon_passive */ - 0xFFFFFF, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xF5F5F6, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x33311A, /* selection_marker_shadow */ - 0xc6a700, /* scrollbar */ - 0xcbba83, /* divider */ - 0x000000, /* screen_fade */ - 0xF5F5F6, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.35f, /* landscape_border_shadow_opacity */ - 0.45f, /* status_bar_shadow_opacity */ - 0.15f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_nvidia_shield = { - /* Text (& small inline icon) colours */ - 0xC4C4C4, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0xDEDEDE, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0x999999, /* list_hint_text */ - 0xDEDEDE, /* list_hint_text_highlighted */ - 0x999999, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x1F1F1F, /* title_bar_background */ - 0x121212, /* list_background */ - 0x255d00, /* list_highlighted_background */ - 0x242424, /* nav_bar_background */ - 0x1D1D1D, /* surface_background */ - 0x000000, /* thumbnail_background */ - 0x1D1D1D, /* side_bar_background */ - 0x242424, /* status_bar_background */ - /* List icon colours */ - 0x7ab547, /* list_icon */ - 0x85bb5c, /* list_switch_on */ - 0x498515, /* list_switch_on_background */ - 0x33691e, /* list_switch_off */ - 0x003d00, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x7ab547, /* nav_bar_icon_active */ - 0x558b2f, /* nav_bar_icon_passive */ - 0x000000, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xDEDEDE, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x3B3B3B, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x3B3B3B, /* selection_marker_shadow */ - 0x7ab547, /* scrollbar */ - 0x498515, /* divider */ - 0x000000, /* screen_fade */ - 0xDEDEDE, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.8f, /* status_bar_shadow_opacity */ - 0.2f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_materialui = { - /* Text (& small inline icon) colours */ - 0xDEDEDE, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0x212121, /* list_text */ - 0x000000, /* list_text_highlighted */ - 0x666666, /* list_hint_text */ - 0x212121, /* list_hint_text_highlighted */ - 0x000000, /* status_bar_text */ - /* Background colours */ - 0x3700B3, /* sys_bar_background */ - 0x6200ee, /* title_bar_background */ - 0xF5F5F6, /* list_background */ - 0xe7b9ff, /* list_highlighted_background */ - 0xE1E2E1, /* nav_bar_background */ - 0xFFFFFF, /* surface_background */ - 0x242424, /* thumbnail_background */ - 0xe7b9ff, /* side_bar_background */ - 0x9F9FA0, /* status_bar_background */ - /* List icon colours */ - 0x3700B3, /* list_icon */ - 0x03DAC6, /* list_switch_on */ - 0x018786, /* list_switch_on_background */ - 0x9e47ff, /* list_switch_off */ - 0x0400ba, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x018786, /* nav_bar_icon_active */ - 0xaeaeae, /* nav_bar_icon_passive */ - 0xffffff, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xF5F5F6, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x018786, /* scrollbar */ - 0x018786, /* divider */ - 0x000000, /* screen_fade */ - 0xF5F5F6, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.35f, /* landscape_border_shadow_opacity */ - 0.45f, /* status_bar_shadow_opacity */ - 0.1f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_materialui_dark = { - /* Text (& small inline icon) colours */ - 0xC4C4C4, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0xDEDEDE, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0x999999, /* list_hint_text */ - 0xDEDEDE, /* list_hint_text_highlighted */ - 0x999999, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x1F1F1F, /* title_bar_background */ - 0x121212, /* list_background */ - 0x51455E, /* list_highlighted_background */ - 0x242424, /* nav_bar_background */ - 0x1D1D1D, /* surface_background */ - 0x000000, /* thumbnail_background */ - 0x1D1D1D, /* side_bar_background */ - 0x242424, /* status_bar_background */ - /* List icon colours */ - 0xbb86fc, /* list_icon */ - 0x03DAC5, /* list_switch_on */ - 0x00a895, /* list_switch_on_background */ - 0xbb86fc, /* list_switch_off */ - 0x8858c8, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x03DAC6, /* nav_bar_icon_active */ - 0x00a895, /* nav_bar_icon_passive */ - 0x000000, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xDEDEDE, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x3B3B3B, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x3B3B3B, /* selection_marker_shadow */ - 0xC89EFC, /* scrollbar */ - 0x03DAC6, /* divider */ - 0x000000, /* screen_fade */ - 0xDEDEDE, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.8f, /* status_bar_shadow_opacity */ - 0.2f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_ozone_dark = { - /* Text (& small inline icon) colours */ - 0xC4C4C4, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0xFFFFFF, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0xDADADA, /* list_hint_text */ - 0xEEEEEE, /* list_hint_text_highlighted */ - 0xDADADA, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x373737, /* title_bar_background */ - 0x2D2D2D, /* list_background */ - 0x268C75, /* list_highlighted_background */ - 0x373737, /* nav_bar_background */ - 0x333333, /* surface_background */ - 0x0B0B0B, /* thumbnail_background */ - 0x333333, /* side_bar_background */ - 0x191919, /* status_bar_background */ - /* List icon colours */ - 0xFFFFFF, /* list_icon */ - 0x00FFC5, /* list_switch_on */ - 0x00D8AE, /* list_switch_on_background */ - 0x9F9FA1, /* list_switch_off */ - 0x7D7D7D, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x00FFC5, /* nav_bar_icon_active */ - 0xDADADA, /* nav_bar_icon_passive */ - 0x242424, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xDADADA, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x9F9F9F, /* scrollbar */ - 0xFFFFFF, /* divider */ - 0x000000, /* screen_fade */ - 0xDADADA, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.8f, /* status_bar_shadow_opacity */ - 0.05f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_nord = { - /* Text (& small inline icon) colours */ - 0xD8DEE9, /* on_sys_bar */ - 0xECEFF4, /* on_header */ - 0xD8DEE9, /* list_text */ - 0xECEFF4, /* list_text_highlighted */ - 0x93E5CC, /* list_hint_text */ - 0x93E5CC, /* list_hint_text_highlighted */ - 0x93E5CC, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x4C566A, /* title_bar_background */ - 0x2E3440, /* list_background */ - 0x3f444f, /* list_highlighted_background */ - 0x3B4252, /* nav_bar_background */ - 0x3B4252, /* surface_background */ - 0x0B0B0B, /* thumbnail_background */ - 0x3f444f, /* side_bar_background */ - 0x191D23, /* status_bar_background */ - /* List icon colours */ - 0xD8DEE9, /* list_icon */ - 0xA3BE8C, /* list_switch_on */ - 0x7E946D, /* list_switch_on_background */ - 0xB48EAD, /* list_switch_off */ - 0x8A6D84, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0xD8DEE9, /* nav_bar_icon_active */ - 0x81A1C1, /* nav_bar_icon_passive */ - 0x242A33, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xD8DEE9, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0xA0A5AD, /* scrollbar */ - 0x81A1C1, /* divider */ - 0x000000, /* screen_fade */ - 0xD8DEE9, /* missing_thumbnail_icon */ - 0.4f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.8f, /* status_bar_shadow_opacity */ - 0.35f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_gruvbox_dark = { - /* Text (& small inline icon) colours */ - 0xA89984, /* on_sys_bar */ - 0xFBF1C7, /* on_header */ - 0xEBDBB2, /* list_text */ - 0xFBF1C7, /* list_text_highlighted */ - 0xD79921, /* list_hint_text */ - 0xFABD2F, /* list_hint_text_highlighted */ - 0xD79921, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x504945, /* title_bar_background */ - 0x282828, /* list_background */ - 0x3C3836, /* list_highlighted_background */ - 0x1D2021, /* nav_bar_background */ - 0x32302F, /* surface_background */ - 0x0B0B0B, /* thumbnail_background */ - 0x3C3836, /* side_bar_background */ - 0x161616, /* status_bar_background */ - /* List icon colours */ - 0xA89984, /* list_icon */ - 0xB8BB26, /* list_switch_on */ - 0x98971A, /* list_switch_on_background */ - 0xFB4934, /* list_switch_off */ - 0xCC241D, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0xBF9137, /* nav_bar_icon_active */ - 0xA89984, /* nav_bar_icon_passive */ - 0x3C3836, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xEBDBB2, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x7C6F64, /* scrollbar */ - 0xD5C4A1, /* divider */ - 0x000000, /* screen_fade */ - 0xA89984, /* missing_thumbnail_icon */ - 0.4f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.8f, /* status_bar_shadow_opacity */ - 0.35f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_solarized_dark = { - /* Text (& small inline icon) colours */ - 0x657B83, /* on_sys_bar */ - 0x93A1A1, /* on_header */ - 0x839496, /* list_text */ - 0x93A1A1, /* list_text_highlighted */ - 0x2AA198, /* list_hint_text */ - 0x2AA198, /* list_hint_text_highlighted */ - 0x2AA198, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x053542, /* title_bar_background */ - 0x002B36, /* list_background */ - 0x073642, /* list_highlighted_background */ - 0x003541, /* nav_bar_background */ - 0x073642, /* surface_background */ - 0x0B0B0B, /* thumbnail_background */ - 0x073642, /* side_bar_background */ - 0x00181E, /* status_bar_background */ - /* List icon colours */ - 0x657B83, /* list_icon */ - 0x859900, /* list_switch_on */ - 0x667500, /* list_switch_on_background */ - 0x6C71C4, /* list_switch_off */ - 0x565A9C, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x2AA198, /* nav_bar_icon_active */ - 0x839496, /* nav_bar_icon_passive */ - 0x00222B, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0x839496, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x586E75, /* scrollbar */ - 0x2AA198, /* divider */ - 0x000000, /* screen_fade */ - 0x657B83, /* missing_thumbnail_icon */ - 0.4f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.8f, /* status_bar_shadow_opacity */ - 0.35f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_cutie_blue = { - /* Text (& small inline icon) colours */ - 0xC4C4C4, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0xFFFFFF, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0xDADADA, /* list_hint_text */ - 0xEEEEEE, /* list_hint_text_highlighted */ - 0xDADADA, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x353535, /* title_bar_background */ - 0x191919, /* list_background */ - 0x3399FF, /* list_highlighted_background */ - 0x282828, /* nav_bar_background */ - 0x333333, /* surface_background */ - 0x000000, /* thumbnail_background */ - 0x333333, /* side_bar_background */ - 0x0E0E0E, /* status_bar_background */ - /* List icon colours */ - 0xFFFFFF, /* list_icon */ - 0x3399FF, /* list_switch_on */ - 0x454545, /* list_switch_on_background */ - 0x454545, /* list_switch_off */ - 0x414141, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x3399FF, /* nav_bar_icon_active */ - 0xDADADA, /* nav_bar_icon_passive */ - 0x000000, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xFFFFFF, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x727272, /* scrollbar */ - 0x727272, /* divider */ - 0x000000, /* screen_fade */ - 0xDADADA, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.9f, /* status_bar_shadow_opacity */ - 0.1f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_cutie_cyan = { - /* Text (& small inline icon) colours */ - 0xC4C4C4, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0xFFFFFF, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0xDADADA, /* list_hint_text */ - 0xEEEEEE, /* list_hint_text_highlighted */ - 0xDADADA, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x353535, /* title_bar_background */ - 0x191919, /* list_background */ - 0x39859A, /* list_highlighted_background */ - 0x282828, /* nav_bar_background */ - 0x333333, /* surface_background */ - 0x000000, /* thumbnail_background */ - 0x333333, /* side_bar_background */ - 0x0E0E0E, /* status_bar_background */ - /* List icon colours */ - 0xFFFFFF, /* list_icon */ - 0x39859A, /* list_switch_on */ - 0x454545, /* list_switch_on_background */ - 0x454545, /* list_switch_off */ - 0x414141, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x39859A, /* nav_bar_icon_active */ - 0xDADADA, /* nav_bar_icon_passive */ - 0x000000, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xFFFFFF, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x727272, /* scrollbar */ - 0x727272, /* divider */ - 0x000000, /* screen_fade */ - 0xDADADA, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.9f, /* status_bar_shadow_opacity */ - 0.1f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_cutie_green = { - /* Text (& small inline icon) colours */ - 0xC4C4C4, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0xFFFFFF, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0xDADADA, /* list_hint_text */ - 0xEEEEEE, /* list_hint_text_highlighted */ - 0xDADADA, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x353535, /* title_bar_background */ - 0x191919, /* list_background */ - 0x23A367, /* list_highlighted_background */ - 0x282828, /* nav_bar_background */ - 0x333333, /* surface_background */ - 0x000000, /* thumbnail_background */ - 0x333333, /* side_bar_background */ - 0x0E0E0E, /* status_bar_background */ - /* List icon colours */ - 0xFFFFFF, /* list_icon */ - 0x23A367, /* list_switch_on */ - 0x454545, /* list_switch_on_background */ - 0x454545, /* list_switch_off */ - 0x414141, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x23A367, /* nav_bar_icon_active */ - 0xDADADA, /* nav_bar_icon_passive */ - 0x000000, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xFFFFFF, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x727272, /* scrollbar */ - 0x727272, /* divider */ - 0x000000, /* screen_fade */ - 0xDADADA, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.9f, /* status_bar_shadow_opacity */ - 0.1f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_cutie_orange = { - /* Text (& small inline icon) colours */ - 0xC4C4C4, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0xFFFFFF, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0xDADADA, /* list_hint_text */ - 0xEEEEEE, /* list_hint_text_highlighted */ - 0xDADADA, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x353535, /* title_bar_background */ - 0x191919, /* list_background */ - 0xCE6E1F, /* list_highlighted_background */ - 0x282828, /* nav_bar_background */ - 0x333333, /* surface_background */ - 0x000000, /* thumbnail_background */ - 0x333333, /* side_bar_background */ - 0x0E0E0E, /* status_bar_background */ - /* List icon colours */ - 0xFFFFFF, /* list_icon */ - 0xCE6E1F, /* list_switch_on */ - 0x454545, /* list_switch_on_background */ - 0x454545, /* list_switch_off */ - 0x414141, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0xCE6E1F, /* nav_bar_icon_active */ - 0xDADADA, /* nav_bar_icon_passive */ - 0x000000, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xFFFFFF, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x727272, /* scrollbar */ - 0x727272, /* divider */ - 0x000000, /* screen_fade */ - 0xDADADA, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.9f, /* status_bar_shadow_opacity */ - 0.1f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_cutie_pink = { - /* Text (& small inline icon) colours */ - 0xC4C4C4, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0xFFFFFF, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0xDADADA, /* list_hint_text */ - 0xEEEEEE, /* list_hint_text_highlighted */ - 0xDADADA, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x353535, /* title_bar_background */ - 0x191919, /* list_background */ - 0xD16FD8, /* list_highlighted_background */ - 0x282828, /* nav_bar_background */ - 0x333333, /* surface_background */ - 0x000000, /* thumbnail_background */ - 0x333333, /* side_bar_background */ - 0x0E0E0E, /* status_bar_background */ - /* List icon colours */ - 0xFFFFFF, /* list_icon */ - 0xD16FD8, /* list_switch_on */ - 0x454545, /* list_switch_on_background */ - 0x454545, /* list_switch_off */ - 0x414141, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0xD16FD8, /* nav_bar_icon_active */ - 0xDADADA, /* nav_bar_icon_passive */ - 0x000000, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xFFFFFF, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x727272, /* scrollbar */ - 0x727272, /* divider */ - 0x000000, /* screen_fade */ - 0xDADADA, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.9f, /* status_bar_shadow_opacity */ - 0.1f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_cutie_purple = { - /* Text (& small inline icon) colours */ - 0xC4C4C4, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0xFFFFFF, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0xDADADA, /* list_hint_text */ - 0xEEEEEE, /* list_hint_text_highlighted */ - 0xDADADA, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x353535, /* title_bar_background */ - 0x191919, /* list_background */ - 0x814FFF, /* list_highlighted_background */ - 0x282828, /* nav_bar_background */ - 0x333333, /* surface_background */ - 0x000000, /* thumbnail_background */ - 0x333333, /* side_bar_background */ - 0x0E0E0E, /* status_bar_background */ - /* List icon colours */ - 0xFFFFFF, /* list_icon */ - 0x814FFF, /* list_switch_on */ - 0x454545, /* list_switch_on_background */ - 0x454545, /* list_switch_off */ - 0x414141, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x814FFF, /* nav_bar_icon_active */ - 0xDADADA, /* nav_bar_icon_passive */ - 0x000000, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xFFFFFF, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x727272, /* scrollbar */ - 0x727272, /* divider */ - 0x000000, /* screen_fade */ - 0xDADADA, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.9f, /* status_bar_shadow_opacity */ - 0.1f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_cutie_red = { - /* Text (& small inline icon) colours */ - 0xC4C4C4, /* on_sys_bar */ - 0xFFFFFF, /* on_header */ - 0xFFFFFF, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0xDADADA, /* list_hint_text */ - 0xEEEEEE, /* list_hint_text_highlighted */ - 0xDADADA, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x353535, /* title_bar_background */ - 0x191919, /* list_background */ - 0xCB1619, /* list_highlighted_background */ - 0x282828, /* nav_bar_background */ - 0x333333, /* surface_background */ - 0x000000, /* thumbnail_background */ - 0x333333, /* side_bar_background */ - 0x0E0E0E, /* status_bar_background */ - /* List icon colours */ - 0xFFFFFF, /* list_icon */ - 0xCB1619, /* list_switch_on */ - 0x454545, /* list_switch_on_background */ - 0x454545, /* list_switch_off */ - 0x414141, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0xCB1619, /* nav_bar_icon_active */ - 0xDADADA, /* nav_bar_icon_passive */ - 0x000000, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xFFFFFF, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x000000, /* selection_marker_shadow */ - 0x727272, /* scrollbar */ - 0x727272, /* divider */ - 0x000000, /* screen_fade */ - 0xDADADA, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.9f, /* status_bar_shadow_opacity */ - 0.1f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_virtual_boy = { - /* Text (& small inline icon) colours */ - 0xE60000, /* on_sys_bar */ - 0xF00000, /* on_header */ - 0xE60000, /* list_text */ - 0xF00000, /* list_text_highlighted */ - 0xE60000, /* list_hint_text */ - 0xF00000, /* list_hint_text_highlighted */ - 0xE60000, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x350000, /* title_bar_background */ - 0x000000, /* list_background */ - 0x400000, /* list_highlighted_background */ - 0x350000, /* nav_bar_background */ - 0x400000, /* surface_background */ - 0x250000, /* thumbnail_background */ - 0x400000, /* side_bar_background */ - 0x000000, /* status_bar_background */ - /* List icon colours */ - 0xE60000, /* list_icon */ - 0xE60000, /* list_switch_on */ - 0x6B0000, /* list_switch_on_background */ - 0x6B0000, /* list_switch_off */ - 0x6B0000, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0xF00000, /* nav_bar_icon_active */ - 0xA10000, /* nav_bar_icon_passive */ - 0x300000, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0xE60000, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x000000, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0xE60000, /* selection_marker_shadow */ - 0xA10000, /* scrollbar */ - 0xE60000, /* divider */ - 0x000000, /* screen_fade */ - 0xE60000, /* missing_thumbnail_icon */ - 0.3f, /* header_shadow_opacity */ - 0.45f, /* landscape_border_shadow_opacity */ - 0.7f, /* status_bar_shadow_opacity */ - 0.35f, /* selection_marker_shadow_opacity */ - 0.75f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_hacking_the_kernel = { - /* Text (& small inline icon) colours */ - 0x00E000, /* on_sys_bar */ - 0x00E02D, /* on_header */ - 0x00E000, /* list_text */ - 0x00E02D, /* list_text_highlighted */ - 0x83FF83, /* list_hint_text */ - 0x83FF83, /* list_hint_text_highlighted */ - 0x83FF83, /* status_bar_text */ - /* Background colours */ - 0x000000, /* sys_bar_background */ - 0x003400, /* title_bar_background */ - 0x000000, /* list_background */ - 0x022F1C, /* list_highlighted_background */ - 0x002200, /* nav_bar_background */ - 0x022F1C, /* surface_background */ - 0x001100, /* thumbnail_background */ - 0x022F1C, /* side_bar_background */ - 0x002200, /* status_bar_background */ - /* List icon colours */ - 0x008C00, /* list_icon */ - 0x89DE00, /* list_switch_on */ - 0x4A8500, /* list_switch_on_background */ - 0x04804C, /* list_switch_off */ - 0x02663C, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0x00E02D, /* nav_bar_icon_active */ - 0x008C00, /* nav_bar_icon_passive */ - 0x000000, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0x00E000, /* screensaver_tint */ - /* Misc. colours */ - 0x000000, /* header_shadow */ - 0x08ED8D, /* landscape_border_shadow */ - 0x000000, /* status_bar_shadow */ - 0x00FF00, /* selection_marker_shadow */ - 0x008C00, /* scrollbar */ - 0x006F00, /* divider */ - 0x000000, /* screen_fade */ - 0x008C00, /* missing_thumbnail_icon */ - 0.8f, /* header_shadow_opacity */ - 0.2f, /* landscape_border_shadow_opacity */ - 1.0f, /* status_bar_shadow_opacity */ - 0.12f, /* selection_marker_shadow_opacity */ - 0.85f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_gray_dark = { - /* Text (& small inline icon) colours */ - 0x808080, /* on_sys_bar */ - 0xC0C0C0, /* on_header */ - 0xC0C0C0, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0x707070, /* list_hint_text */ - 0x808080, /* list_hint_text_highlighted */ - 0x808080, /* status_bar_text */ - /* Background colours */ - 0x101010, /* sys_bar_background */ - 0x101010, /* title_bar_background */ - 0x101010, /* list_background */ - 0x303030, /* list_highlighted_background */ - 0x101010, /* nav_bar_background */ - 0x202020, /* surface_background */ - 0x0C0C0C, /* thumbnail_background */ - 0x101010, /* side_bar_background */ - 0x101010, /* status_bar_background */ - /* List icon colours */ - 0xFFFFFF, /* list_icon */ - 0xFFFFFF, /* list_switch_on */ - 0x202020, /* list_switch_on_background */ - 0x707070, /* list_switch_off */ - 0x202020, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0xFFFFFF, /* nav_bar_icon_active */ - 0x707070, /* nav_bar_icon_passive */ - 0x202020, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0x101010, /* screensaver_tint */ - /* Misc. colours */ - 0x202020, /* header_shadow */ - 0x202020, /* landscape_border_shadow */ - 0x202020, /* status_bar_shadow */ - 0x0C0C0C, /* selection_marker_shadow */ - 0x202020, /* scrollbar */ - 0x101010, /* divider */ - 0x0C0C0C, /* screen_fade */ - 0x202020, /* missing_thumbnail_icon */ - 0.0f, /* header_shadow_opacity */ - 0.5f, /* landscape_border_shadow_opacity */ - 0.0f, /* status_bar_shadow_opacity */ - 0.0f, /* selection_marker_shadow_opacity */ - 0.5f /* screen_fade_opacity */ -}; - -static const materialui_theme_t materialui_theme_gray_light = { - /* Text (& small inline icon) colours */ - 0x808080, /* on_sys_bar */ - 0xC0C0C0, /* on_header */ - 0xC0C0C0, /* list_text */ - 0xFFFFFF, /* list_text_highlighted */ - 0x707070, /* list_hint_text */ - 0x808080, /* list_hint_text_highlighted */ - 0x808080, /* status_bar_text */ - /* Background colours */ - 0x303030, /* sys_bar_background */ - 0x303030, /* title_bar_background */ - 0x303030, /* list_background */ - 0x101010, /* list_highlighted_background */ - 0x303030, /* nav_bar_background */ - 0x202020, /* surface_background */ - 0x0C0C0C, /* thumbnail_background */ - 0x303030, /* side_bar_background */ - 0x303030, /* status_bar_background */ - /* List icon colours */ - 0xFFFFFF, /* list_icon */ - 0xFFFFFF, /* list_switch_on */ - 0x202020, /* list_switch_on_background */ - 0x707070, /* list_switch_off */ - 0x202020, /* list_switch_off_background */ - /* Navigation bar icon colours */ - 0xFFFFFF, /* nav_bar_icon_active */ - 0x707070, /* nav_bar_icon_passive */ - 0x202020, /* nav_bar_icon_disabled */ - /* Screensaver */ - 0x101010, /* screensaver_tint */ - /* Misc. colours */ - 0x202020, /* header_shadow */ - 0x202020, /* landscape_border_shadow */ - 0x202020, /* status_bar_shadow */ - 0x0C0C0C, /* selection_marker_shadow */ - 0x202020, /* scrollbar */ - 0x303030, /* divider */ - 0x0C0C0C, /* screen_fade */ - 0x202020, /* missing_thumbnail_icon */ - 0.0f, /* header_shadow_opacity */ - 0.5f, /* landscape_border_shadow_opacity */ - 0.0f, /* status_bar_shadow_opacity */ - 0.0f, /* selection_marker_shadow_opacity */ - 0.5f /* screen_fade_opacity */ -}; - -typedef struct -{ - /* Text */ - uint32_t sys_bar_text; - uint32_t header_text; - uint32_t list_text; - uint32_t list_text_highlighted; - uint32_t list_hint_text; - uint32_t list_hint_text_highlighted; - uint32_t status_bar_text; - /* Screensaver */ - uint32_t screensaver_tint; - /* Background colours */ - float sys_bar_background[16]; - float title_bar_background[16]; - float list_background[16]; - float list_highlighted_background[16]; - float nav_bar_background[16]; - float surface_background[16]; - float thumbnail_background[16]; - float side_bar_background[16]; - float status_bar_background[16]; - /* System bar + header icon colours */ - float sys_bar_icon[16]; - float header_icon[16]; - /* List icon colours */ - float list_icon[16]; - float list_switch_on[16]; - float list_switch_on_background[16]; - float list_switch_off[16]; - float list_switch_off_background[16]; - /* Navigation bar icon colours */ - float nav_bar_icon_active[16]; - float nav_bar_icon_passive[16]; - float nav_bar_icon_disabled[16]; - /* Misc. colours */ - float header_shadow[16]; - float landscape_border_shadow_left[16]; - float landscape_border_shadow_right[16]; - float status_bar_shadow[16]; - float selection_marker_shadow_top[16]; - float selection_marker_shadow_bottom[16]; - float scrollbar[16]; - float divider[16]; - float entry_divider[16]; - float screen_fade[16]; - float missing_thumbnail_icon[16]; - float landscape_border_shadow_opacity; - float status_bar_shadow_opacity; - float selection_marker_shadow_opacity; - float screen_fade_opacity; - /* Flags */ - bool divider_is_list_background; -} materialui_colors_t; - -/* ============================== - * Colour Themes END - * ============================== */ - /* Specifies minimum period (in usec) between * tab switch events when input repeat is * active (i.e. when navigating between top level @@ -1373,6 +133,16 @@ typedef struct * the scroll animation duration */ #define MUI_THUMBNAIL_STREAM_DELAY_PLAYLIST_DESKTOP MUI_ANIM_DURATION_SCROLL +/* Maximum number of menu tabs that can be shown on + * the navigation bar */ +#define MUI_NAV_BAR_NUM_MENU_TABS_MAX 3 + +/* Number of action tabs shown on the navigation bar */ +#define MUI_NAV_BAR_NUM_ACTION_TABS 2 + +#define MUI_BATTERY_PERCENT_MAX_LENGTH 12 +#define MUI_TIMEDATE_MAX_LENGTH 255 + /* Defines the various types of supported menu * list views * - MUI_LIST_VIEW_DEFAULT is the standard for @@ -1403,26 +173,6 @@ enum materialui_node_icon_type MUI_ICON_TYPE_MENU_CONTENTLESS_CORE }; -/* This structure holds auxiliary information for - * each menu entry (physical on-screen size/position, - * icon data, thumbnail data, etc.) */ -typedef struct -{ - /* Thumbnail containers */ - struct - { - gfx_thumbnail_t primary; /* uintptr_t alignment */ - gfx_thumbnail_t secondary; /* uintptr_t alignment */ - } thumbnails; - unsigned icon_texture_index; - float entry_width; - float entry_height; - float text_height; - float x; - float y; - enum materialui_node_icon_type icon_type; -} materialui_node_t; - /* Defines all standard menu textures */ enum { @@ -1496,25 +246,6 @@ enum MUI_TEXTURE_LAST }; -/* This structure holds all runtime parameters - * associated with landscape optimisation - * (enable state, border width, nominal - * additional horizontal margin/padding for - * menu entries) */ -typedef struct -{ - unsigned border_width; - unsigned entry_margin; - bool enabled; -} materialui_landscape_optimization_t; - -/* Maximum number of menu tabs that can be shown on - * the navigation bar */ -#define MUI_NAV_BAR_NUM_MENU_TABS_MAX 3 - -/* Number of action tabs shown on the navigation bar */ -#define MUI_NAV_BAR_NUM_ACTION_TABS 2 - /* Defines the various types of menu tab that can * be shown on the navigation bar */ enum materialui_nav_bar_menu_tab_type @@ -1544,6 +275,169 @@ enum materialui_nav_bar_location_type MUI_NAV_BAR_LOCATION_HIDDEN }; +/* Defines all possible entry value types + * > Note: These are not necessarily 'values', + * but they correspond to the object drawn in + * the 'value' location when rendering + * menu lists */ +enum materialui_entry_value_type +{ + MUI_ENTRY_VALUE_NONE = 0, + MUI_ENTRY_VALUE_TEXT, + MUI_ENTRY_VALUE_SWITCH_ON, + MUI_ENTRY_VALUE_SWITCH_OFF, + MUI_ENTRY_VALUE_CHECKMARK +}; + +/* Defines common positions when referencing + * the list of currently on screen menu entries + * > Used to specify a target when the current + * selection is off screen, and we wish to + * automatically move the selection marker + * to a specific on screen location */ +enum materialui_onscreen_entry_position_type +{ + MUI_ONSCREEN_ENTRY_FIRST = 0, + MUI_ONSCREEN_ENTRY_LAST, + MUI_ONSCREEN_ENTRY_CENTRE +}; + +/* Theme colours */ +typedef struct +{ + /* Text (& small inline icon) colours */ + uint32_t on_sys_bar; + uint32_t on_header; + uint32_t list_text; + uint32_t list_text_highlighted; + uint32_t list_hint_text; + uint32_t list_hint_text_highlighted; + uint32_t status_bar_text; + /* Background colours */ + uint32_t sys_bar_background; + uint32_t title_bar_background; + uint32_t list_background; + uint32_t list_highlighted_background; + uint32_t nav_bar_background; + uint32_t surface_background; + uint32_t thumbnail_background; + uint32_t side_bar_background; + uint32_t status_bar_background; + /* List icon colours */ + uint32_t list_icon; + uint32_t list_switch_on; + uint32_t list_switch_on_background; + uint32_t list_switch_off; + uint32_t list_switch_off_background; + /* Navigation bar icon colours */ + uint32_t nav_bar_icon_active; + uint32_t nav_bar_icon_passive; + uint32_t nav_bar_icon_disabled; + /* Screensaver */ + uint32_t screensaver_tint; + /* Misc. colours */ + uint32_t header_shadow; + uint32_t landscape_border_shadow; + uint32_t status_bar_shadow; + uint32_t selection_marker_shadow; + uint32_t scrollbar; + uint32_t divider; + uint32_t screen_fade; + uint32_t missing_thumbnail_icon; + float header_shadow_opacity; + float landscape_border_shadow_opacity; + float status_bar_shadow_opacity; + float selection_marker_shadow_opacity; + float screen_fade_opacity; +} materialui_theme_t; + +typedef struct +{ + /* Text */ + uint32_t sys_bar_text; + uint32_t header_text; + uint32_t list_text; + uint32_t list_text_highlighted; + uint32_t list_hint_text; + uint32_t list_hint_text_highlighted; + uint32_t status_bar_text; + /* Screensaver */ + uint32_t screensaver_tint; + /* Background colours */ + float sys_bar_background[16]; + float title_bar_background[16]; + float list_background[16]; + float list_highlighted_background[16]; + float nav_bar_background[16]; + float surface_background[16]; + float thumbnail_background[16]; + float side_bar_background[16]; + float status_bar_background[16]; + /* System bar + header icon colours */ + float sys_bar_icon[16]; + float header_icon[16]; + /* List icon colours */ + float list_icon[16]; + float list_switch_on[16]; + float list_switch_on_background[16]; + float list_switch_off[16]; + float list_switch_off_background[16]; + /* Navigation bar icon colours */ + float nav_bar_icon_active[16]; + float nav_bar_icon_passive[16]; + float nav_bar_icon_disabled[16]; + /* Misc. colours */ + float header_shadow[16]; + float landscape_border_shadow_left[16]; + float landscape_border_shadow_right[16]; + float status_bar_shadow[16]; + float selection_marker_shadow_top[16]; + float selection_marker_shadow_bottom[16]; + float scrollbar[16]; + float divider[16]; + float entry_divider[16]; + float screen_fade[16]; + float missing_thumbnail_icon[16]; + float landscape_border_shadow_opacity; + float status_bar_shadow_opacity; + float selection_marker_shadow_opacity; + float screen_fade_opacity; + /* Flags */ + bool divider_is_list_background; +} materialui_colors_t; + +/* This structure holds auxiliary information for + * each menu entry (physical on-screen size/position, + * icon data, thumbnail data, etc.) */ +typedef struct +{ + /* Thumbnail containers */ + struct + { + gfx_thumbnail_t primary; /* uintptr_t alignment */ + gfx_thumbnail_t secondary; /* uintptr_t alignment */ + } thumbnails; + unsigned icon_texture_index; + float entry_width; + float entry_height; + float text_height; + float x; + float y; + enum materialui_node_icon_type icon_type; +} materialui_node_t; + +/* This structure holds all runtime parameters + * associated with landscape optimisation + * (enable state, border width, nominal + * additional horizontal margin/padding for + * menu entries) */ +typedef struct +{ + unsigned border_width; + unsigned entry_margin; + bool enabled; +} materialui_landscape_optimization_t; + /* This structure holds all runtime parameters * associated with a navigation bar menu tab */ typedef struct @@ -1591,20 +485,6 @@ typedef struct bool dragged; } materialui_scrollbar_t; -/* Defines all possible entry value types - * > Note: These are not necessarily 'values', - * but they correspond to the object drawn in - * the 'value' location when rendering - * menu lists */ -enum materialui_entry_value_type -{ - MUI_ENTRY_VALUE_NONE = 0, - MUI_ENTRY_VALUE_TEXT, - MUI_ENTRY_VALUE_SWITCH_ON, - MUI_ENTRY_VALUE_SWITCH_OFF, - MUI_ENTRY_VALUE_CHECKMARK -}; - /* This structure holds all objects + metadata * corresponding to a particular font */ typedef struct @@ -1618,9 +498,6 @@ typedef struct int line_centre_offset; } materialui_font_data_t; -#define MUI_BATTERY_PERCENT_MAX_LENGTH 12 -#define MUI_TIMEDATE_MAX_LENGTH 255 - /* This structure is used to cache system bar * string data (+ metadata) to improve rendering * performance */ @@ -1651,19 +528,6 @@ typedef struct bool cached; } materialui_status_bar_t; -/* Defines common positions when referencing - * the list of currently on screen menu entries - * > Used to specify a target when the current - * selection is off screen, and we wish to - * automatically move the selection marker - * to a specific on screen location */ -enum materialui_onscreen_entry_position_type -{ - MUI_ONSCREEN_ENTRY_FIRST = 0, - MUI_ONSCREEN_ENTRY_LAST, - MUI_ONSCREEN_ENTRY_CENTRE -}; - /* Contains the file path(s) and texture pointer * of a single playlist icon */ typedef struct @@ -1829,61 +693,1188 @@ static void hex32_to_rgba_normalized(uint32_t hex, float* rgba, float alpha) static const materialui_theme_t *materialui_get_theme(enum materialui_color_theme color_theme) { - switch (color_theme) - { - case MATERIALUI_THEME_BLUE: - return &materialui_theme_blue; - case MATERIALUI_THEME_BLUE_GREY: - return &materialui_theme_blue_grey; - case MATERIALUI_THEME_DARK_BLUE: - return &materialui_theme_dark_blue; - case MATERIALUI_THEME_GREEN: - return &materialui_theme_green; - case MATERIALUI_THEME_RED: - return &materialui_theme_red; - case MATERIALUI_THEME_YELLOW: - return &materialui_theme_yellow; - case MATERIALUI_THEME_NVIDIA_SHIELD: - return &materialui_theme_nvidia_shield; - case MATERIALUI_THEME_MATERIALUI: - return &materialui_theme_materialui; - case MATERIALUI_THEME_MATERIALUI_DARK: - return &materialui_theme_materialui_dark; - case MATERIALUI_THEME_OZONE_DARK: - return &materialui_theme_ozone_dark; - case MATERIALUI_THEME_NORD: - return &materialui_theme_nord; - case MATERIALUI_THEME_GRUVBOX_DARK: - return &materialui_theme_gruvbox_dark; - case MATERIALUI_THEME_SOLARIZED_DARK: - return &materialui_theme_solarized_dark; - case MATERIALUI_THEME_CUTIE_BLUE: - return &materialui_theme_cutie_blue; - case MATERIALUI_THEME_CUTIE_CYAN: - return &materialui_theme_cutie_cyan; - case MATERIALUI_THEME_CUTIE_GREEN: - return &materialui_theme_cutie_green; - case MATERIALUI_THEME_CUTIE_ORANGE: - return &materialui_theme_cutie_orange; - case MATERIALUI_THEME_CUTIE_PINK: - return &materialui_theme_cutie_pink; - case MATERIALUI_THEME_CUTIE_PURPLE: - return &materialui_theme_cutie_purple; - case MATERIALUI_THEME_CUTIE_RED: - return &materialui_theme_cutie_red; - case MATERIALUI_THEME_VIRTUAL_BOY: - return &materialui_theme_virtual_boy; - case MATERIALUI_THEME_HACKING_THE_KERNEL: - return &materialui_theme_hacking_the_kernel; - case MATERIALUI_THEME_GRAY_DARK: - return &materialui_theme_gray_dark; - case MATERIALUI_THEME_GRAY_LIGHT: - return &materialui_theme_gray_light; - default: - break; - } + static const materialui_theme_t materialui_theme_cutie_blue = { + /* Text (& small inline icon) colours */ + 0xC4C4C4, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0xFFFFFF, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0xDADADA, /* list_hint_text */ + 0xEEEEEE, /* list_hint_text_highlighted */ + 0xDADADA, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x353535, /* title_bar_background */ + 0x191919, /* list_background */ + 0x3399FF, /* list_highlighted_background */ + 0x282828, /* nav_bar_background */ + 0x333333, /* surface_background */ + 0x000000, /* thumbnail_background */ + 0x333333, /* side_bar_background */ + 0x0E0E0E, /* status_bar_background */ + /* List icon colours */ + 0xFFFFFF, /* list_icon */ + 0x3399FF, /* list_switch_on */ + 0x454545, /* list_switch_on_background */ + 0x454545, /* list_switch_off */ + 0x414141, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x3399FF, /* nav_bar_icon_active */ + 0xDADADA, /* nav_bar_icon_passive */ + 0x000000, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xFFFFFF, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x727272, /* scrollbar */ + 0x727272, /* divider */ + 0x000000, /* screen_fade */ + 0xDADADA, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.9f, /* status_bar_shadow_opacity */ + 0.1f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + static const materialui_theme_t materialui_theme_cutie_cyan = { + /* Text (& small inline icon) colours */ + 0xC4C4C4, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0xFFFFFF, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0xDADADA, /* list_hint_text */ + 0xEEEEEE, /* list_hint_text_highlighted */ + 0xDADADA, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x353535, /* title_bar_background */ + 0x191919, /* list_background */ + 0x39859A, /* list_highlighted_background */ + 0x282828, /* nav_bar_background */ + 0x333333, /* surface_background */ + 0x000000, /* thumbnail_background */ + 0x333333, /* side_bar_background */ + 0x0E0E0E, /* status_bar_background */ + /* List icon colours */ + 0xFFFFFF, /* list_icon */ + 0x39859A, /* list_switch_on */ + 0x454545, /* list_switch_on_background */ + 0x454545, /* list_switch_off */ + 0x414141, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x39859A, /* nav_bar_icon_active */ + 0xDADADA, /* nav_bar_icon_passive */ + 0x000000, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xFFFFFF, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x727272, /* scrollbar */ + 0x727272, /* divider */ + 0x000000, /* screen_fade */ + 0xDADADA, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.9f, /* status_bar_shadow_opacity */ + 0.1f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + static const materialui_theme_t materialui_theme_blue = { + /* Text (& small inline icon) colours */ + 0xDEDEDE, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0x212121, /* list_text */ + 0x000000, /* list_text_highlighted */ + 0x666666, /* list_hint_text */ + 0x212121, /* list_hint_text_highlighted */ + 0x000000, /* status_bar_text */ + /* Background colours */ + 0x0069c0, /* sys_bar_background */ + 0x2196f3, /* title_bar_background */ + 0xF5F5F6, /* list_background */ + 0xc1d5e0, /* list_highlighted_background */ + 0xE1E2E1, /* nav_bar_background */ + 0xFFFFFF, /* surface_background */ + 0x242424, /* thumbnail_background */ + 0xc1d5e0, /* side_bar_background */ + 0x9F9FA0, /* status_bar_background */ + /* List icon colours */ + 0x0069c0, /* list_icon */ + 0x2196f3, /* list_switch_on */ + 0x6ec6ff, /* list_switch_on_background */ + 0x808e95, /* list_switch_off */ + 0xbabdbe, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x0069c0, /* nav_bar_icon_active */ + 0x9ea7aa, /* nav_bar_icon_passive */ + 0xffffff, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xF5F5F6, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x0069c0, /* scrollbar */ + 0x9ea7aa, /* divider */ + 0x000000, /* screen_fade */ + 0xF5F5F6, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.35f, /* landscape_border_shadow_opacity */ + 0.45f, /* status_bar_shadow_opacity */ + 0.1f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; - return &materialui_theme_blue; + static const materialui_theme_t materialui_theme_blue_grey = { + /* Text (& small inline icon) colours */ + 0xDEDEDE, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0x212121, /* list_text */ + 0x000000, /* list_text_highlighted */ + 0x666666, /* list_hint_text */ + 0x212121, /* list_hint_text_highlighted */ + 0x000000, /* status_bar_text */ + /* Background colours */ + 0x34515e, /* sys_bar_background */ + 0x607d8b, /* title_bar_background */ + 0xF5F5F6, /* list_background */ + 0xe0e0e0, /* list_highlighted_background */ + 0xE1E2E1, /* nav_bar_background */ + 0xFFFFFF, /* surface_background */ + 0x242424, /* thumbnail_background */ + 0xe0e0e0, /* side_bar_background */ + 0x9F9FA0, /* status_bar_background */ + /* List icon colours */ + 0x34515e, /* list_icon */ + 0x607d8b, /* list_switch_on */ + 0x8eacbb, /* list_switch_on_background */ + 0xbcbcbc, /* list_switch_off */ + 0xc7c7c7, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x34515e, /* nav_bar_icon_active */ + 0xaeaeae, /* nav_bar_icon_passive */ + 0xffffff, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xF5F5F6, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x34515e, /* scrollbar */ + 0xc2c2c2, /* divider */ + 0x000000, /* screen_fade */ + 0xF5F5F6, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.35f, /* landscape_border_shadow_opacity */ + 0.45f, /* status_bar_shadow_opacity */ + 0.2f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_dark_blue = { + /* Text (& small inline icon) colours */ + 0xC4C4C4, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0xDEDEDE, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0x999999, /* list_hint_text */ + 0xDEDEDE, /* list_hint_text_highlighted */ + 0x999999, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x1F1F1F, /* title_bar_background */ + 0x121212, /* list_background */ + 0x34515e, /* list_highlighted_background */ + 0x242424, /* nav_bar_background */ + 0x1D1D1D, /* surface_background */ + 0x000000, /* thumbnail_background */ + 0x1D1D1D, /* side_bar_background */ + 0x242424, /* status_bar_background */ + /* List icon colours */ + 0x90caf9, /* list_icon */ + 0x64b5f6, /* list_switch_on */ + 0x5d99c6, /* list_switch_on_background */ + 0x4b636e, /* list_switch_off */ + 0x607d8b, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x6ec6ff, /* nav_bar_icon_active */ + 0xA5B4BB, /* nav_bar_icon_passive */ + 0x000000, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xDEDEDE, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x3B3B3B, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x3B3B3B, /* selection_marker_shadow */ + 0x90caf9, /* scrollbar */ + 0x607d8b, /* divider */ + 0x000000, /* screen_fade */ + 0xDEDEDE, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.8f, /* status_bar_shadow_opacity */ + 0.2f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_green = { + /* Text (& small inline icon) colours */ + 0xDEDEDE, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0x212121, /* list_text */ + 0x000000, /* list_text_highlighted */ + 0x666666, /* list_hint_text */ + 0x212121, /* list_hint_text_highlighted */ + 0x000000, /* status_bar_text */ + /* Background colours */ + 0x087f23, /* sys_bar_background */ + 0x4caf50, /* title_bar_background */ + 0xF5F5F6, /* list_background */ + 0xdcedc8, /* list_highlighted_background */ + 0xE1E2E1, /* nav_bar_background */ + 0xFFFFFF, /* surface_background */ + 0x242424, /* thumbnail_background */ + 0xdcedc8, /* side_bar_background */ + 0x9F9FA0, /* status_bar_background */ + /* List icon colours */ + 0x087f23, /* list_icon */ + 0x4caf50, /* list_switch_on */ + 0x80e27e, /* list_switch_on_background */ + 0xaabb97, /* list_switch_off */ + 0xbec5b7, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x087f23, /* nav_bar_icon_active */ + 0xaeaeae, /* nav_bar_icon_passive */ + 0xffffff, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xF5F5F6, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x087f23, /* scrollbar */ + 0xaabb97, /* divider */ + 0x000000, /* screen_fade */ + 0xF5F5F6, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.35f, /* landscape_border_shadow_opacity */ + 0.45f, /* status_bar_shadow_opacity */ + 0.15f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_red = { + /* Text (& small inline icon) colours */ + 0xDEDEDE, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0x212121, /* list_text */ + 0x000000, /* list_text_highlighted */ + 0x666666, /* list_hint_text */ + 0x212121, /* list_hint_text_highlighted */ + 0x000000, /* status_bar_text */ + /* Background colours */ + 0xba000d, /* sys_bar_background */ + 0xf44336, /* title_bar_background */ + 0xF5F5F6, /* list_background */ + 0xf8bbd0, /* list_highlighted_background */ + 0xE1E2E1, /* nav_bar_background */ + 0xFFFFFF, /* surface_background */ + 0x242424, /* thumbnail_background */ + 0xf8bbd0, /* side_bar_background */ + 0x9F9FA0, /* status_bar_background */ + /* List icon colours */ + 0xba000d, /* list_icon */ + 0xf44336, /* list_switch_on */ + 0xff7961, /* list_switch_on_background */ + 0xbf5f82, /* list_switch_off */ + 0xc48b9f, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0xba000d, /* nav_bar_icon_active */ + 0xaeaeae, /* nav_bar_icon_passive */ + 0xffffff, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xF5F5F6, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0xba000d, /* scrollbar */ + 0xbf5f82, /* divider */ + 0x000000, /* screen_fade */ + 0xF5F5F6, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.35f, /* landscape_border_shadow_opacity */ + 0.45f, /* status_bar_shadow_opacity */ + 0.15f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_yellow = { + /* Text (& small inline icon) colours */ + 0x212121, /* on_sys_bar */ + 0x000000, /* on_header */ + 0x212121, /* list_text */ + 0x000000, /* list_text_highlighted */ + 0x666666, /* list_hint_text */ + 0x212121, /* list_hint_text_highlighted */ + 0x000000, /* status_bar_text */ + /* Background colours */ + 0xc8b900, /* sys_bar_background */ + 0xffeb3b, /* title_bar_background */ + 0xF5F5F6, /* list_background */ + 0xffecb3, /* list_highlighted_background */ + 0xE1E2E1, /* nav_bar_background */ + 0xFFFFFF, /* surface_background */ + 0x242424, /* thumbnail_background */ + 0xffecb3, /* side_bar_background */ + 0x9F9FA0, /* status_bar_background */ + /* List icon colours */ + 0xc6a700, /* list_icon */ + 0xffeb3b, /* list_switch_on */ + 0xccc5af, /* list_switch_on_background */ + 0xcaae53, /* list_switch_off */ + 0xccc5af, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0xc6a700, /* nav_bar_icon_active */ + 0xaeaeae, /* nav_bar_icon_passive */ + 0xFFFFFF, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xF5F5F6, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x33311A, /* selection_marker_shadow */ + 0xc6a700, /* scrollbar */ + 0xcbba83, /* divider */ + 0x000000, /* screen_fade */ + 0xF5F5F6, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.35f, /* landscape_border_shadow_opacity */ + 0.45f, /* status_bar_shadow_opacity */ + 0.15f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_nvidia_shield = { + /* Text (& small inline icon) colours */ + 0xC4C4C4, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0xDEDEDE, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0x999999, /* list_hint_text */ + 0xDEDEDE, /* list_hint_text_highlighted */ + 0x999999, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x1F1F1F, /* title_bar_background */ + 0x121212, /* list_background */ + 0x255d00, /* list_highlighted_background */ + 0x242424, /* nav_bar_background */ + 0x1D1D1D, /* surface_background */ + 0x000000, /* thumbnail_background */ + 0x1D1D1D, /* side_bar_background */ + 0x242424, /* status_bar_background */ + /* List icon colours */ + 0x7ab547, /* list_icon */ + 0x85bb5c, /* list_switch_on */ + 0x498515, /* list_switch_on_background */ + 0x33691e, /* list_switch_off */ + 0x003d00, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x7ab547, /* nav_bar_icon_active */ + 0x558b2f, /* nav_bar_icon_passive */ + 0x000000, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xDEDEDE, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x3B3B3B, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x3B3B3B, /* selection_marker_shadow */ + 0x7ab547, /* scrollbar */ + 0x498515, /* divider */ + 0x000000, /* screen_fade */ + 0xDEDEDE, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.8f, /* status_bar_shadow_opacity */ + 0.2f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_materialui = { + /* Text (& small inline icon) colours */ + 0xDEDEDE, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0x212121, /* list_text */ + 0x000000, /* list_text_highlighted */ + 0x666666, /* list_hint_text */ + 0x212121, /* list_hint_text_highlighted */ + 0x000000, /* status_bar_text */ + /* Background colours */ + 0x3700B3, /* sys_bar_background */ + 0x6200ee, /* title_bar_background */ + 0xF5F5F6, /* list_background */ + 0xe7b9ff, /* list_highlighted_background */ + 0xE1E2E1, /* nav_bar_background */ + 0xFFFFFF, /* surface_background */ + 0x242424, /* thumbnail_background */ + 0xe7b9ff, /* side_bar_background */ + 0x9F9FA0, /* status_bar_background */ + /* List icon colours */ + 0x3700B3, /* list_icon */ + 0x03DAC6, /* list_switch_on */ + 0x018786, /* list_switch_on_background */ + 0x9e47ff, /* list_switch_off */ + 0x0400ba, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x018786, /* nav_bar_icon_active */ + 0xaeaeae, /* nav_bar_icon_passive */ + 0xffffff, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xF5F5F6, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x018786, /* scrollbar */ + 0x018786, /* divider */ + 0x000000, /* screen_fade */ + 0xF5F5F6, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.35f, /* landscape_border_shadow_opacity */ + 0.45f, /* status_bar_shadow_opacity */ + 0.1f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_materialui_dark = { + /* Text (& small inline icon) colours */ + 0xC4C4C4, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0xDEDEDE, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0x999999, /* list_hint_text */ + 0xDEDEDE, /* list_hint_text_highlighted */ + 0x999999, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x1F1F1F, /* title_bar_background */ + 0x121212, /* list_background */ + 0x51455E, /* list_highlighted_background */ + 0x242424, /* nav_bar_background */ + 0x1D1D1D, /* surface_background */ + 0x000000, /* thumbnail_background */ + 0x1D1D1D, /* side_bar_background */ + 0x242424, /* status_bar_background */ + /* List icon colours */ + 0xbb86fc, /* list_icon */ + 0x03DAC5, /* list_switch_on */ + 0x00a895, /* list_switch_on_background */ + 0xbb86fc, /* list_switch_off */ + 0x8858c8, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x03DAC6, /* nav_bar_icon_active */ + 0x00a895, /* nav_bar_icon_passive */ + 0x000000, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xDEDEDE, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x3B3B3B, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x3B3B3B, /* selection_marker_shadow */ + 0xC89EFC, /* scrollbar */ + 0x03DAC6, /* divider */ + 0x000000, /* screen_fade */ + 0xDEDEDE, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.8f, /* status_bar_shadow_opacity */ + 0.2f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_ozone_dark = { + /* Text (& small inline icon) colours */ + 0xC4C4C4, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0xFFFFFF, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0xDADADA, /* list_hint_text */ + 0xEEEEEE, /* list_hint_text_highlighted */ + 0xDADADA, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x373737, /* title_bar_background */ + 0x2D2D2D, /* list_background */ + 0x268C75, /* list_highlighted_background */ + 0x373737, /* nav_bar_background */ + 0x333333, /* surface_background */ + 0x0B0B0B, /* thumbnail_background */ + 0x333333, /* side_bar_background */ + 0x191919, /* status_bar_background */ + /* List icon colours */ + 0xFFFFFF, /* list_icon */ + 0x00FFC5, /* list_switch_on */ + 0x00D8AE, /* list_switch_on_background */ + 0x9F9FA1, /* list_switch_off */ + 0x7D7D7D, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x00FFC5, /* nav_bar_icon_active */ + 0xDADADA, /* nav_bar_icon_passive */ + 0x242424, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xDADADA, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x9F9F9F, /* scrollbar */ + 0xFFFFFF, /* divider */ + 0x000000, /* screen_fade */ + 0xDADADA, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.8f, /* status_bar_shadow_opacity */ + 0.05f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_nord = { + /* Text (& small inline icon) colours */ + 0xD8DEE9, /* on_sys_bar */ + 0xECEFF4, /* on_header */ + 0xD8DEE9, /* list_text */ + 0xECEFF4, /* list_text_highlighted */ + 0x93E5CC, /* list_hint_text */ + 0x93E5CC, /* list_hint_text_highlighted */ + 0x93E5CC, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x4C566A, /* title_bar_background */ + 0x2E3440, /* list_background */ + 0x3f444f, /* list_highlighted_background */ + 0x3B4252, /* nav_bar_background */ + 0x3B4252, /* surface_background */ + 0x0B0B0B, /* thumbnail_background */ + 0x3f444f, /* side_bar_background */ + 0x191D23, /* status_bar_background */ + /* List icon colours */ + 0xD8DEE9, /* list_icon */ + 0xA3BE8C, /* list_switch_on */ + 0x7E946D, /* list_switch_on_background */ + 0xB48EAD, /* list_switch_off */ + 0x8A6D84, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0xD8DEE9, /* nav_bar_icon_active */ + 0x81A1C1, /* nav_bar_icon_passive */ + 0x242A33, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xD8DEE9, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0xA0A5AD, /* scrollbar */ + 0x81A1C1, /* divider */ + 0x000000, /* screen_fade */ + 0xD8DEE9, /* missing_thumbnail_icon */ + 0.4f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.8f, /* status_bar_shadow_opacity */ + 0.35f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_gruvbox_dark = { + /* Text (& small inline icon) colours */ + 0xA89984, /* on_sys_bar */ + 0xFBF1C7, /* on_header */ + 0xEBDBB2, /* list_text */ + 0xFBF1C7, /* list_text_highlighted */ + 0xD79921, /* list_hint_text */ + 0xFABD2F, /* list_hint_text_highlighted */ + 0xD79921, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x504945, /* title_bar_background */ + 0x282828, /* list_background */ + 0x3C3836, /* list_highlighted_background */ + 0x1D2021, /* nav_bar_background */ + 0x32302F, /* surface_background */ + 0x0B0B0B, /* thumbnail_background */ + 0x3C3836, /* side_bar_background */ + 0x161616, /* status_bar_background */ + /* List icon colours */ + 0xA89984, /* list_icon */ + 0xB8BB26, /* list_switch_on */ + 0x98971A, /* list_switch_on_background */ + 0xFB4934, /* list_switch_off */ + 0xCC241D, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0xBF9137, /* nav_bar_icon_active */ + 0xA89984, /* nav_bar_icon_passive */ + 0x3C3836, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xEBDBB2, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x7C6F64, /* scrollbar */ + 0xD5C4A1, /* divider */ + 0x000000, /* screen_fade */ + 0xA89984, /* missing_thumbnail_icon */ + 0.4f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.8f, /* status_bar_shadow_opacity */ + 0.35f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_solarized_dark = { + /* Text (& small inline icon) colours */ + 0x657B83, /* on_sys_bar */ + 0x93A1A1, /* on_header */ + 0x839496, /* list_text */ + 0x93A1A1, /* list_text_highlighted */ + 0x2AA198, /* list_hint_text */ + 0x2AA198, /* list_hint_text_highlighted */ + 0x2AA198, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x053542, /* title_bar_background */ + 0x002B36, /* list_background */ + 0x073642, /* list_highlighted_background */ + 0x003541, /* nav_bar_background */ + 0x073642, /* surface_background */ + 0x0B0B0B, /* thumbnail_background */ + 0x073642, /* side_bar_background */ + 0x00181E, /* status_bar_background */ + /* List icon colours */ + 0x657B83, /* list_icon */ + 0x859900, /* list_switch_on */ + 0x667500, /* list_switch_on_background */ + 0x6C71C4, /* list_switch_off */ + 0x565A9C, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x2AA198, /* nav_bar_icon_active */ + 0x839496, /* nav_bar_icon_passive */ + 0x00222B, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0x839496, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x586E75, /* scrollbar */ + 0x2AA198, /* divider */ + 0x000000, /* screen_fade */ + 0x657B83, /* missing_thumbnail_icon */ + 0.4f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.8f, /* status_bar_shadow_opacity */ + 0.35f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_cutie_green = { + /* Text (& small inline icon) colours */ + 0xC4C4C4, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0xFFFFFF, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0xDADADA, /* list_hint_text */ + 0xEEEEEE, /* list_hint_text_highlighted */ + 0xDADADA, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x353535, /* title_bar_background */ + 0x191919, /* list_background */ + 0x23A367, /* list_highlighted_background */ + 0x282828, /* nav_bar_background */ + 0x333333, /* surface_background */ + 0x000000, /* thumbnail_background */ + 0x333333, /* side_bar_background */ + 0x0E0E0E, /* status_bar_background */ + /* List icon colours */ + 0xFFFFFF, /* list_icon */ + 0x23A367, /* list_switch_on */ + 0x454545, /* list_switch_on_background */ + 0x454545, /* list_switch_off */ + 0x414141, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x23A367, /* nav_bar_icon_active */ + 0xDADADA, /* nav_bar_icon_passive */ + 0x000000, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xFFFFFF, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x727272, /* scrollbar */ + 0x727272, /* divider */ + 0x000000, /* screen_fade */ + 0xDADADA, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.9f, /* status_bar_shadow_opacity */ + 0.1f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_cutie_orange = { + /* Text (& small inline icon) colours */ + 0xC4C4C4, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0xFFFFFF, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0xDADADA, /* list_hint_text */ + 0xEEEEEE, /* list_hint_text_highlighted */ + 0xDADADA, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x353535, /* title_bar_background */ + 0x191919, /* list_background */ + 0xCE6E1F, /* list_highlighted_background */ + 0x282828, /* nav_bar_background */ + 0x333333, /* surface_background */ + 0x000000, /* thumbnail_background */ + 0x333333, /* side_bar_background */ + 0x0E0E0E, /* status_bar_background */ + /* List icon colours */ + 0xFFFFFF, /* list_icon */ + 0xCE6E1F, /* list_switch_on */ + 0x454545, /* list_switch_on_background */ + 0x454545, /* list_switch_off */ + 0x414141, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0xCE6E1F, /* nav_bar_icon_active */ + 0xDADADA, /* nav_bar_icon_passive */ + 0x000000, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xFFFFFF, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x727272, /* scrollbar */ + 0x727272, /* divider */ + 0x000000, /* screen_fade */ + 0xDADADA, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.9f, /* status_bar_shadow_opacity */ + 0.1f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_cutie_pink = { + /* Text (& small inline icon) colours */ + 0xC4C4C4, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0xFFFFFF, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0xDADADA, /* list_hint_text */ + 0xEEEEEE, /* list_hint_text_highlighted */ + 0xDADADA, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x353535, /* title_bar_background */ + 0x191919, /* list_background */ + 0xD16FD8, /* list_highlighted_background */ + 0x282828, /* nav_bar_background */ + 0x333333, /* surface_background */ + 0x000000, /* thumbnail_background */ + 0x333333, /* side_bar_background */ + 0x0E0E0E, /* status_bar_background */ + /* List icon colours */ + 0xFFFFFF, /* list_icon */ + 0xD16FD8, /* list_switch_on */ + 0x454545, /* list_switch_on_background */ + 0x454545, /* list_switch_off */ + 0x414141, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0xD16FD8, /* nav_bar_icon_active */ + 0xDADADA, /* nav_bar_icon_passive */ + 0x000000, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xFFFFFF, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x727272, /* scrollbar */ + 0x727272, /* divider */ + 0x000000, /* screen_fade */ + 0xDADADA, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.9f, /* status_bar_shadow_opacity */ + 0.1f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_cutie_purple = { + /* Text (& small inline icon) colours */ + 0xC4C4C4, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0xFFFFFF, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0xDADADA, /* list_hint_text */ + 0xEEEEEE, /* list_hint_text_highlighted */ + 0xDADADA, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x353535, /* title_bar_background */ + 0x191919, /* list_background */ + 0x814FFF, /* list_highlighted_background */ + 0x282828, /* nav_bar_background */ + 0x333333, /* surface_background */ + 0x000000, /* thumbnail_background */ + 0x333333, /* side_bar_background */ + 0x0E0E0E, /* status_bar_background */ + /* List icon colours */ + 0xFFFFFF, /* list_icon */ + 0x814FFF, /* list_switch_on */ + 0x454545, /* list_switch_on_background */ + 0x454545, /* list_switch_off */ + 0x414141, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x814FFF, /* nav_bar_icon_active */ + 0xDADADA, /* nav_bar_icon_passive */ + 0x000000, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xFFFFFF, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x727272, /* scrollbar */ + 0x727272, /* divider */ + 0x000000, /* screen_fade */ + 0xDADADA, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.9f, /* status_bar_shadow_opacity */ + 0.1f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_cutie_red = { + /* Text (& small inline icon) colours */ + 0xC4C4C4, /* on_sys_bar */ + 0xFFFFFF, /* on_header */ + 0xFFFFFF, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0xDADADA, /* list_hint_text */ + 0xEEEEEE, /* list_hint_text_highlighted */ + 0xDADADA, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x353535, /* title_bar_background */ + 0x191919, /* list_background */ + 0xCB1619, /* list_highlighted_background */ + 0x282828, /* nav_bar_background */ + 0x333333, /* surface_background */ + 0x000000, /* thumbnail_background */ + 0x333333, /* side_bar_background */ + 0x0E0E0E, /* status_bar_background */ + /* List icon colours */ + 0xFFFFFF, /* list_icon */ + 0xCB1619, /* list_switch_on */ + 0x454545, /* list_switch_on_background */ + 0x454545, /* list_switch_off */ + 0x414141, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0xCB1619, /* nav_bar_icon_active */ + 0xDADADA, /* nav_bar_icon_passive */ + 0x000000, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xFFFFFF, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x000000, /* selection_marker_shadow */ + 0x727272, /* scrollbar */ + 0x727272, /* divider */ + 0x000000, /* screen_fade */ + 0xDADADA, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.9f, /* status_bar_shadow_opacity */ + 0.1f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_virtual_boy = { + /* Text (& small inline icon) colours */ + 0xE60000, /* on_sys_bar */ + 0xF00000, /* on_header */ + 0xE60000, /* list_text */ + 0xF00000, /* list_text_highlighted */ + 0xE60000, /* list_hint_text */ + 0xF00000, /* list_hint_text_highlighted */ + 0xE60000, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x350000, /* title_bar_background */ + 0x000000, /* list_background */ + 0x400000, /* list_highlighted_background */ + 0x350000, /* nav_bar_background */ + 0x400000, /* surface_background */ + 0x250000, /* thumbnail_background */ + 0x400000, /* side_bar_background */ + 0x000000, /* status_bar_background */ + /* List icon colours */ + 0xE60000, /* list_icon */ + 0xE60000, /* list_switch_on */ + 0x6B0000, /* list_switch_on_background */ + 0x6B0000, /* list_switch_off */ + 0x6B0000, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0xF00000, /* nav_bar_icon_active */ + 0xA10000, /* nav_bar_icon_passive */ + 0x300000, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0xE60000, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x000000, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0xE60000, /* selection_marker_shadow */ + 0xA10000, /* scrollbar */ + 0xE60000, /* divider */ + 0x000000, /* screen_fade */ + 0xE60000, /* missing_thumbnail_icon */ + 0.3f, /* header_shadow_opacity */ + 0.45f, /* landscape_border_shadow_opacity */ + 0.7f, /* status_bar_shadow_opacity */ + 0.35f, /* selection_marker_shadow_opacity */ + 0.75f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_hacking_the_kernel = { + /* Text (& small inline icon) colours */ + 0x00E000, /* on_sys_bar */ + 0x00E02D, /* on_header */ + 0x00E000, /* list_text */ + 0x00E02D, /* list_text_highlighted */ + 0x83FF83, /* list_hint_text */ + 0x83FF83, /* list_hint_text_highlighted */ + 0x83FF83, /* status_bar_text */ + /* Background colours */ + 0x000000, /* sys_bar_background */ + 0x003400, /* title_bar_background */ + 0x000000, /* list_background */ + 0x022F1C, /* list_highlighted_background */ + 0x002200, /* nav_bar_background */ + 0x022F1C, /* surface_background */ + 0x001100, /* thumbnail_background */ + 0x022F1C, /* side_bar_background */ + 0x002200, /* status_bar_background */ + /* List icon colours */ + 0x008C00, /* list_icon */ + 0x89DE00, /* list_switch_on */ + 0x4A8500, /* list_switch_on_background */ + 0x04804C, /* list_switch_off */ + 0x02663C, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0x00E02D, /* nav_bar_icon_active */ + 0x008C00, /* nav_bar_icon_passive */ + 0x000000, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0x00E000, /* screensaver_tint */ + /* Misc. colours */ + 0x000000, /* header_shadow */ + 0x08ED8D, /* landscape_border_shadow */ + 0x000000, /* status_bar_shadow */ + 0x00FF00, /* selection_marker_shadow */ + 0x008C00, /* scrollbar */ + 0x006F00, /* divider */ + 0x000000, /* screen_fade */ + 0x008C00, /* missing_thumbnail_icon */ + 0.8f, /* header_shadow_opacity */ + 0.2f, /* landscape_border_shadow_opacity */ + 1.0f, /* status_bar_shadow_opacity */ + 0.12f, /* selection_marker_shadow_opacity */ + 0.85f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_gray_dark = { + /* Text (& small inline icon) colours */ + 0x808080, /* on_sys_bar */ + 0xC0C0C0, /* on_header */ + 0xC0C0C0, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0x707070, /* list_hint_text */ + 0x808080, /* list_hint_text_highlighted */ + 0x808080, /* status_bar_text */ + /* Background colours */ + 0x101010, /* sys_bar_background */ + 0x101010, /* title_bar_background */ + 0x101010, /* list_background */ + 0x303030, /* list_highlighted_background */ + 0x101010, /* nav_bar_background */ + 0x202020, /* surface_background */ + 0x0C0C0C, /* thumbnail_background */ + 0x101010, /* side_bar_background */ + 0x101010, /* status_bar_background */ + /* List icon colours */ + 0xFFFFFF, /* list_icon */ + 0xFFFFFF, /* list_switch_on */ + 0x202020, /* list_switch_on_background */ + 0x707070, /* list_switch_off */ + 0x202020, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0xFFFFFF, /* nav_bar_icon_active */ + 0x707070, /* nav_bar_icon_passive */ + 0x202020, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0x101010, /* screensaver_tint */ + /* Misc. colours */ + 0x202020, /* header_shadow */ + 0x202020, /* landscape_border_shadow */ + 0x202020, /* status_bar_shadow */ + 0x0C0C0C, /* selection_marker_shadow */ + 0x202020, /* scrollbar */ + 0x101010, /* divider */ + 0x0C0C0C, /* screen_fade */ + 0x202020, /* missing_thumbnail_icon */ + 0.0f, /* header_shadow_opacity */ + 0.5f, /* landscape_border_shadow_opacity */ + 0.0f, /* status_bar_shadow_opacity */ + 0.0f, /* selection_marker_shadow_opacity */ + 0.5f /* screen_fade_opacity */ + }; + + static const materialui_theme_t materialui_theme_gray_light = { + /* Text (& small inline icon) colours */ + 0x808080, /* on_sys_bar */ + 0xC0C0C0, /* on_header */ + 0xC0C0C0, /* list_text */ + 0xFFFFFF, /* list_text_highlighted */ + 0x707070, /* list_hint_text */ + 0x808080, /* list_hint_text_highlighted */ + 0x808080, /* status_bar_text */ + /* Background colours */ + 0x303030, /* sys_bar_background */ + 0x303030, /* title_bar_background */ + 0x303030, /* list_background */ + 0x101010, /* list_highlighted_background */ + 0x303030, /* nav_bar_background */ + 0x202020, /* surface_background */ + 0x0C0C0C, /* thumbnail_background */ + 0x303030, /* side_bar_background */ + 0x303030, /* status_bar_background */ + /* List icon colours */ + 0xFFFFFF, /* list_icon */ + 0xFFFFFF, /* list_switch_on */ + 0x202020, /* list_switch_on_background */ + 0x707070, /* list_switch_off */ + 0x202020, /* list_switch_off_background */ + /* Navigation bar icon colours */ + 0xFFFFFF, /* nav_bar_icon_active */ + 0x707070, /* nav_bar_icon_passive */ + 0x202020, /* nav_bar_icon_disabled */ + /* Screensaver */ + 0x101010, /* screensaver_tint */ + /* Misc. colours */ + 0x202020, /* header_shadow */ + 0x202020, /* landscape_border_shadow */ + 0x202020, /* status_bar_shadow */ + 0x0C0C0C, /* selection_marker_shadow */ + 0x202020, /* scrollbar */ + 0x303030, /* divider */ + 0x0C0C0C, /* screen_fade */ + 0x202020, /* missing_thumbnail_icon */ + 0.0f, /* header_shadow_opacity */ + 0.5f, /* landscape_border_shadow_opacity */ + 0.0f, /* status_bar_shadow_opacity */ + 0.0f, /* selection_marker_shadow_opacity */ + 0.5f /* screen_fade_opacity */ + }; + + + switch (color_theme) + { + case MATERIALUI_THEME_BLUE: + return &materialui_theme_blue; + case MATERIALUI_THEME_BLUE_GREY: + return &materialui_theme_blue_grey; + case MATERIALUI_THEME_DARK_BLUE: + return &materialui_theme_dark_blue; + case MATERIALUI_THEME_GREEN: + return &materialui_theme_green; + case MATERIALUI_THEME_RED: + return &materialui_theme_red; + case MATERIALUI_THEME_YELLOW: + return &materialui_theme_yellow; + case MATERIALUI_THEME_NVIDIA_SHIELD: + return &materialui_theme_nvidia_shield; + case MATERIALUI_THEME_MATERIALUI: + return &materialui_theme_materialui; + case MATERIALUI_THEME_MATERIALUI_DARK: + return &materialui_theme_materialui_dark; + case MATERIALUI_THEME_OZONE_DARK: + return &materialui_theme_ozone_dark; + case MATERIALUI_THEME_NORD: + return &materialui_theme_nord; + case MATERIALUI_THEME_GRUVBOX_DARK: + return &materialui_theme_gruvbox_dark; + case MATERIALUI_THEME_SOLARIZED_DARK: + return &materialui_theme_solarized_dark; + case MATERIALUI_THEME_CUTIE_BLUE: + return &materialui_theme_cutie_blue; + case MATERIALUI_THEME_CUTIE_CYAN: + return &materialui_theme_cutie_cyan; + case MATERIALUI_THEME_CUTIE_GREEN: + return &materialui_theme_cutie_green; + case MATERIALUI_THEME_CUTIE_ORANGE: + return &materialui_theme_cutie_orange; + case MATERIALUI_THEME_CUTIE_PINK: + return &materialui_theme_cutie_pink; + case MATERIALUI_THEME_CUTIE_PURPLE: + return &materialui_theme_cutie_purple; + case MATERIALUI_THEME_CUTIE_RED: + return &materialui_theme_cutie_red; + case MATERIALUI_THEME_VIRTUAL_BOY: + return &materialui_theme_virtual_boy; + case MATERIALUI_THEME_HACKING_THE_KERNEL: + return &materialui_theme_hacking_the_kernel; + case MATERIALUI_THEME_GRAY_DARK: + return &materialui_theme_gray_dark; + case MATERIALUI_THEME_GRAY_LIGHT: + return &materialui_theme_gray_light; + default: + break; + } + + return &materialui_theme_blue; } static void materialui_prepare_colors( diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 12443ed441..6fe3736df8 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -123,6 +123,48 @@ #define RGUI_BATTERY_WARN_THRESHOLD 20 +#define RGUI_SYMBOL_WIDTH FONT_WIDTH +#define RGUI_SYMBOL_HEIGHT FONT_HEIGHT +#define RGUI_SYMBOL_WIDTH_STRIDE (RGUI_SYMBOL_WIDTH + 1) +#define RGUI_SYMBOL_HEIGHT_STRIDE (RGUI_SYMBOL_HEIGHT + 1) + +/* Defines all possible entry value types + * > Note: These are not necessarily 'values', + * but they correspond to the object drawn in + * the 'value' location when rendering + * menu lists */ +enum rgui_entry_value_type +{ + RGUI_ENTRY_VALUE_NONE = 0, + RGUI_ENTRY_VALUE_TEXT, + RGUI_ENTRY_VALUE_SWITCH_ON, + RGUI_ENTRY_VALUE_SWITCH_OFF, + RGUI_ENTRY_VALUE_CHECKMARK +}; + +enum rgui_symbol_type +{ + RGUI_SYMBOL_BACKSPACE = 0, + RGUI_SYMBOL_ENTER, + RGUI_SYMBOL_SHIFT_UP, + RGUI_SYMBOL_SHIFT_DOWN, + RGUI_SYMBOL_NEXT, + RGUI_SYMBOL_TEXT_CURSOR, + RGUI_SYMBOL_CHARGING, + RGUI_SYMBOL_BATTERY_100, + RGUI_SYMBOL_BATTERY_80, + RGUI_SYMBOL_BATTERY_60, + RGUI_SYMBOL_BATTERY_40, + RGUI_SYMBOL_BATTERY_20, + RGUI_SYMBOL_CHECKMARK, + RGUI_SYMBOL_SWITCH_ON_LEFT, + RGUI_SYMBOL_SWITCH_ON_CENTRE, + RGUI_SYMBOL_SWITCH_ON_RIGHT, + RGUI_SYMBOL_SWITCH_OFF_LEFT, + RGUI_SYMBOL_SWITCH_OFF_CENTRE, + RGUI_SYMBOL_SWITCH_OFF_RIGHT +}; + typedef struct { uint32_t hover_color; @@ -136,6 +178,167 @@ typedef struct uint32_t particle_color; } rgui_theme_t; +typedef struct +{ + uint16_t hover_color; + uint16_t normal_color; + uint16_t title_color; + uint16_t bg_dark_color; + uint16_t bg_light_color; + uint16_t border_dark_color; + uint16_t border_light_color; + uint16_t shadow_color; + uint16_t particle_color; + /* Screensaver colors */ + uint16_t ss_bg_color; + uint16_t ss_particle_color; +} rgui_colors_t; + +typedef struct +{ + unsigned start_x; + unsigned start_y; + unsigned width; + unsigned height; + unsigned value_maxlen; +} rgui_term_layout_t; + +typedef struct +{ + video_viewport_t viewport; /* int alignment */ + unsigned aspect_ratio_idx; +} rgui_video_settings_t; + +/* A 'particle' is just 4 float variables that can + * be used for any purpose - e.g.: + * > a = x pos + * > b = y pos + * > c = x velocity + * or: + * > a = radius + * > b = theta + * etc. */ +typedef struct +{ + float a; + float b; + float c; + float d; +} rgui_particle_t; + +typedef struct +{ + uint16_t *data; + unsigned max_width; + unsigned max_height; + unsigned width; + unsigned height; + char path[PATH_MAX_LENGTH]; + bool is_valid; +} thumbnail_t; + +typedef struct +{ + uint16_t *data; + unsigned width; + unsigned height; +} frame_buf_t; + +typedef struct +{ + retro_time_t thumbnail_load_trigger_time; /* uint64_t */ + + gfx_thumbnail_path_data_t *thumbnail_path_data; + + struct + { + bitmapfont_lut_t *regular; + +#ifdef HAVE_LANGEXTRA + bitmapfont_lut_t *eng_6x10; + bitmapfont_lut_t *lse_6x10; + bitmapfont_lut_t *eng_10x10; + bitmapfont_lut_t *chn_10x10; + bitmapfont_lut_t *jpn_10x10; + bitmapfont_lut_t *kor_10x10; + bitmapfont_lut_t *rus_10x10; +#endif + } fonts; + + frame_buf_t frame_buf; + frame_buf_t background_buf; + frame_buf_t upscale_buf; + + thumbnail_t fs_thumbnail; + thumbnail_t mini_thumbnail; + thumbnail_t mini_left_thumbnail; + + rgui_video_settings_t menu_video_settings; /* int alignment */ + rgui_video_settings_t content_video_settings; /* int alignment */ + + unsigned font_width; + unsigned font_height; + unsigned font_width_stride; + unsigned font_height_stride; + + unsigned mini_thumbnail_max_width; + unsigned mini_thumbnail_max_height; + unsigned last_width; + unsigned last_height; + unsigned window_width; + unsigned window_height; + unsigned particle_effect; + unsigned color_theme; + unsigned menu_aspect_ratio; + unsigned menu_aspect_ratio_lock; + unsigned language; + + rgui_term_layout_t term_layout; + + uint32_t thumbnail_queue_size; + uint32_t left_thumbnail_queue_size; + + rgui_particle_t particles[RGUI_NUM_PARTICLES]; /* float alignment */ + + int16_t scroll_y; + rgui_colors_t colors; /* int16_t alignment */ + + struct scaler_ctx image_scaler; + menu_input_pointer_t pointer; + + char msgbox[1024]; + char theme_preset_path[PATH_MAX_LENGTH]; /* Must be a fixed length array... */ + char theme_dynamic_path[PATH_MAX_LENGTH]; /* Must be a fixed length array... */ + char last_theme_dynamic_path[PATH_MAX_LENGTH]; /* Must be a fixed length array... */ + char menu_title[255]; /* Must be a fixed length array... */ + char menu_sublabel[MENU_SUBLABEL_MAX_LENGTH]; /* Must be a fixed length array... */ + + bool bg_modified; + bool force_redraw; + bool force_menu_refresh; + bool restore_aspect_lock; + bool show_mouse; + bool show_screensaver; + bool ignore_resize_events; + bool bg_thickness; + bool border_thickness; + bool border_enable; + bool transparency_supported; + bool transparency_enable; + bool shadow_enable; + bool extended_ascii_enable; + bool is_playlist; + bool entry_has_thumbnail; + bool entry_has_left_thumbnail; + bool show_fs_thumbnail; + bool thumbnail_load_pending; + bool show_wallpaper; + bool aspect_update_pending; +#ifdef HAVE_GFX_WIDGETS + bool widgets_supported; +#endif +} rgui_t; + static const rgui_theme_t rgui_theme_classic_red = { 0xFFFF362B, /* hover_color */ 0xFFFFFFFF, /* normal_color */ @@ -976,454 +1179,10 @@ static const rgui_theme_t rgui_theme_opaque_gray_light = { 0xE0202020 /* particle_color */ }; -typedef struct -{ - uint16_t hover_color; - uint16_t normal_color; - uint16_t title_color; - uint16_t bg_dark_color; - uint16_t bg_light_color; - uint16_t border_dark_color; - uint16_t border_light_color; - uint16_t shadow_color; - uint16_t particle_color; - /* Screensaver colors */ - uint16_t ss_bg_color; - uint16_t ss_particle_color; -} rgui_colors_t; - -typedef struct -{ - unsigned start_x; - unsigned start_y; - unsigned width; - unsigned height; - unsigned value_maxlen; -} rgui_term_layout_t; - -typedef struct -{ - video_viewport_t viewport; /* int alignment */ - unsigned aspect_ratio_idx; -} rgui_video_settings_t; - -/* A 'particle' is just 4 float variables that can - * be used for any purpose - e.g.: - * > a = x pos - * > b = y pos - * > c = x velocity - * or: - * > a = radius - * > b = theta - * etc. */ -typedef struct -{ - float a; - float b; - float c; - float d; -} rgui_particle_t; - -/* Defines all possible entry value types - * > Note: These are not necessarily 'values', - * but they correspond to the object drawn in - * the 'value' location when rendering - * menu lists */ -enum rgui_entry_value_type -{ - RGUI_ENTRY_VALUE_NONE = 0, - RGUI_ENTRY_VALUE_TEXT, - RGUI_ENTRY_VALUE_SWITCH_ON, - RGUI_ENTRY_VALUE_SWITCH_OFF, - RGUI_ENTRY_VALUE_CHECKMARK -}; - -typedef struct -{ - uint16_t *data; - unsigned max_width; - unsigned max_height; - unsigned width; - unsigned height; - char path[PATH_MAX_LENGTH]; - bool is_valid; -} thumbnail_t; - -typedef struct -{ - uint16_t *data; - unsigned width; - unsigned height; -} frame_buf_t; - -typedef struct -{ - retro_time_t thumbnail_load_trigger_time; /* uint64_t */ - - gfx_thumbnail_path_data_t *thumbnail_path_data; - - struct - { - bitmapfont_lut_t *regular; - -#ifdef HAVE_LANGEXTRA - bitmapfont_lut_t *eng_6x10; - bitmapfont_lut_t *lse_6x10; - bitmapfont_lut_t *eng_10x10; - bitmapfont_lut_t *chn_10x10; - bitmapfont_lut_t *jpn_10x10; - bitmapfont_lut_t *kor_10x10; - bitmapfont_lut_t *rus_10x10; -#endif - } fonts; - - frame_buf_t frame_buf; - frame_buf_t background_buf; - frame_buf_t upscale_buf; - - thumbnail_t fs_thumbnail; - thumbnail_t mini_thumbnail; - thumbnail_t mini_left_thumbnail; - - rgui_video_settings_t menu_video_settings; /* int alignment */ - rgui_video_settings_t content_video_settings; /* int alignment */ - - unsigned font_width; - unsigned font_height; - unsigned font_width_stride; - unsigned font_height_stride; - - unsigned mini_thumbnail_max_width; - unsigned mini_thumbnail_max_height; - unsigned last_width; - unsigned last_height; - unsigned window_width; - unsigned window_height; - unsigned particle_effect; - unsigned color_theme; - unsigned menu_aspect_ratio; - unsigned menu_aspect_ratio_lock; - unsigned language; - - rgui_term_layout_t term_layout; - - uint32_t thumbnail_queue_size; - uint32_t left_thumbnail_queue_size; - - rgui_particle_t particles[RGUI_NUM_PARTICLES]; /* float alignment */ - - int16_t scroll_y; - rgui_colors_t colors; /* int16_t alignment */ - - struct scaler_ctx image_scaler; - menu_input_pointer_t pointer; - - char msgbox[1024]; - char theme_preset_path[PATH_MAX_LENGTH]; /* Must be a fixed length array... */ - char theme_dynamic_path[PATH_MAX_LENGTH]; /* Must be a fixed length array... */ - char last_theme_dynamic_path[PATH_MAX_LENGTH]; /* Must be a fixed length array... */ - char menu_title[255]; /* Must be a fixed length array... */ - char menu_sublabel[MENU_SUBLABEL_MAX_LENGTH]; /* Must be a fixed length array... */ - - bool bg_modified; - bool force_redraw; - bool force_menu_refresh; - bool restore_aspect_lock; - bool show_mouse; - bool show_screensaver; - bool ignore_resize_events; - bool bg_thickness; - bool border_thickness; - bool border_enable; - bool transparency_supported; - bool transparency_enable; - bool shadow_enable; - bool extended_ascii_enable; - bool is_playlist; - bool entry_has_thumbnail; - bool entry_has_left_thumbnail; - bool show_fs_thumbnail; - bool thumbnail_load_pending; - bool show_wallpaper; - bool aspect_update_pending; -#ifdef HAVE_GFX_WIDGETS - bool widgets_supported; -#endif -} rgui_t; - /* Particle effect animations update at a base rate * of 60Hz (-> 16.666 ms update period) */ static const float particle_effect_period = (1.0f / 60.0f) * 1000.0f; -/* ============================== - * Custom Symbols (glyphs) START - * ============================== */ - -#define RGUI_SYMBOL_WIDTH FONT_WIDTH -#define RGUI_SYMBOL_HEIGHT FONT_HEIGHT -#define RGUI_SYMBOL_WIDTH_STRIDE (RGUI_SYMBOL_WIDTH + 1) -#define RGUI_SYMBOL_HEIGHT_STRIDE (RGUI_SYMBOL_HEIGHT + 1) - -enum rgui_symbol_type -{ - RGUI_SYMBOL_BACKSPACE = 0, - RGUI_SYMBOL_ENTER, - RGUI_SYMBOL_SHIFT_UP, - RGUI_SYMBOL_SHIFT_DOWN, - RGUI_SYMBOL_NEXT, - RGUI_SYMBOL_TEXT_CURSOR, - RGUI_SYMBOL_CHARGING, - RGUI_SYMBOL_BATTERY_100, - RGUI_SYMBOL_BATTERY_80, - RGUI_SYMBOL_BATTERY_60, - RGUI_SYMBOL_BATTERY_40, - RGUI_SYMBOL_BATTERY_20, - RGUI_SYMBOL_CHECKMARK, - RGUI_SYMBOL_SWITCH_ON_LEFT, - RGUI_SYMBOL_SWITCH_ON_CENTRE, - RGUI_SYMBOL_SWITCH_ON_RIGHT, - RGUI_SYMBOL_SWITCH_OFF_LEFT, - RGUI_SYMBOL_SWITCH_OFF_CENTRE, - RGUI_SYMBOL_SWITCH_OFF_RIGHT -}; - -/* All custom symbols must have dimensions - * of exactly RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT */ -static const uint8_t rgui_symbol_data_backspace[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, - 1, 1, 1, 1, 1, - 0, 1, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_enter[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, - 0, 0, 0, 0, 1, - 0, 0, 0, 0, 1, - 0, 0, 1, 0, 1, - 0, 1, 0, 0, 1, - 1, 1, 1, 1, 1, - 0, 1, 0, 0, 0, /* Baseline */ - 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_shift_up[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, - 0, 1, 1, 1, 0, - 1, 1, 0, 1, 1, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 1, 1, 1, 0, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_shift_down[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 1, 1, 0, 1, 1, - 0, 1, 1, 1, 0, - 0, 0, 1, 0, 0, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_next[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 1, 0, 1, - 1, 1, 1, 1, 1, - 1, 0, 1, 0, 1, - 0, 1, 1, 1, 0, - 0, 0, 0, 0, 0, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_text_cursor[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, /* Baseline */ - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1}; - -static const uint8_t rgui_symbol_data_charging[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 1, 0, 1, 0, - 0, 1, 0, 1, 0, - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - 0, 1, 1, 1, 0, - 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_battery_100[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, - 0, 1, 1, 1, 1, - 0, 1, 1, 1, 1, - 0, 1, 1, 1, 1, - 0, 1, 1, 1, 1, - 0, 1, 1, 1, 1, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_battery_80[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, - 0, 1, 0, 0, 1, - 0, 1, 1, 1, 1, - 0, 1, 1, 1, 1, - 0, 1, 1, 1, 1, - 0, 1, 1, 1, 1, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_battery_60[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, - 0, 1, 0, 0, 1, - 0, 1, 0, 0, 1, - 0, 1, 1, 1, 1, - 0, 1, 1, 1, 1, - 0, 1, 1, 1, 1, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_battery_40[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, - 0, 1, 0, 0, 1, - 0, 1, 0, 0, 1, - 0, 1, 0, 0, 1, - 0, 1, 1, 1, 1, - 0, 1, 1, 1, 1, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_battery_20[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, - 0, 1, 1, 1, 1, - 0, 1, 0, 0, 1, - 0, 1, 0, 0, 1, - 0, 1, 0, 0, 1, - 0, 1, 0, 0, 1, - 0, 1, 1, 1, 1, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -/* Note: This is not actually a 'checkmark' - we don't - * have enough pixels to draw one effectively. The 'icon' - * is merely named according to its function... */ -static const uint8_t rgui_symbol_data_checkmark[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, - 0, 1, 1, 0, 0, /* Baseline */ - 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_switch_on_left[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - 0, 1, 1, 1, 1, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_switch_on_centre[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 1, 1, 1, 1, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_switch_on_right[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - 0, 1, 1, 1, 0, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_switch_off_left[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 0, - 1, 0, 0, 0, 1, - 1, 0, 0, 0, 1, - 1, 0, 0, 0, 1, - 1, 0, 0, 0, 1, - 1, 0, 0, 0, 1, - 0, 1, 1, 1, 0, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_switch_off_centre[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, - 0, 1, 0, 0, 0, - 0, 1, 1, 1, 1, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -static const uint8_t rgui_symbol_data_switch_off_right[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 1, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, /* Baseline */ - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; - -/* ============================== - * Custom Symbols (glyphs) END - * ============================== */ - /* ============================== * pixel format conversion START * ============================== */ @@ -1853,22 +1612,19 @@ static void rgui_fill_rect( bool thickness) { unsigned x_index, y_index; - unsigned x_start = x <= fb_width ? x : fb_width; - unsigned y_start = y <= fb_height ? y : fb_height; - unsigned x_end = x + width; - unsigned y_end = y + height; - size_t x_size; uint16_t scanline_even[RGUI_MAX_FB_WIDTH]; /* Initial values don't matter here */ uint16_t scanline_odd[RGUI_MAX_FB_WIDTH]; - + unsigned x_start = x <= fb_width ? x : fb_width; + unsigned y_start = y <= fb_height ? y : fb_height; + unsigned x_end_i = x + width; + unsigned y_end_i = y + height; /* Note: unlike rgui_color_rect() and rgui_draw_particle(), * this function is frequently used to fill large areas. * We therefore gain significant performance benefits * from using memcpy() tricks... */ - - x_end = x_end <= fb_width ? x_end : fb_width; - y_end = y_end <= fb_height ? y_end : fb_height; - x_size = (x_end - x_start) * sizeof(uint16_t); + unsigned x_end = x_end_i <= fb_width ? x_end_i : fb_width; + unsigned y_end = y_end_i <= fb_height ? y_end_i : fb_height; + size_t x_size = (x_end - x_start) * sizeof(uint16_t); /* Sanity check */ if (x_size == 0) @@ -1998,8 +1754,8 @@ static void rgui_color_rect( unsigned x_end = x + width; unsigned y_end = y + height; - x_end = x_end <= fb_width ? x_end : fb_width; - y_end = y_end <= fb_height ? y_end : fb_height; + x_end = x_end <= fb_width ? x_end : fb_width; + y_end = y_end <= fb_height ? y_end : fb_height; for (y_index = y_start; y_index < y_end; y_index++) { @@ -2012,17 +1768,9 @@ static void rgui_color_rect( static void rgui_render_border(rgui_t *rgui, uint16_t *data, unsigned fb_width, unsigned fb_height) { - uint16_t dark_color; - uint16_t light_color; - bool thickness; - - /* Sanity check */ - if (!rgui || !data) - return; - - dark_color = rgui->colors.border_dark_color; - light_color = rgui->colors.border_light_color; - thickness = rgui->border_thickness; + uint16_t dark_color = rgui->colors.border_dark_color; + uint16_t light_color = rgui->colors.border_light_color; + bool thickness = rgui->border_thickness; /* Draw border */ rgui_fill_rect(data, fb_width, fb_height, @@ -2067,19 +1815,18 @@ static bool INLINE rgui_draw_particle( /* This great convoluted mess just saves us * having to perform comparisons on every * iteration of the for loops... */ - int x_start = x > 0 ? x : 0; - int y_start = y > 0 ? y : 0; - int x_end = x + width; - int y_end = y + height; + int x_start_i = (x > 0) ? x : 0; + int y_start_i = (y > 0) ? y : 0; + int x_end = x + width; + int y_end = y + height; + int x_start = (x_start_i <= (int)fb_width) ? x_start_i : fb_width; + int y_start = (y_start_i <= (int)fb_height) ? y_start_i : fb_height; - x_start = x_start <= (int)fb_width ? x_start : fb_width; - y_start = y_start <= (int)fb_height ? y_start : fb_height; + x_end = (x_end > 0) ? x_end : 0; + x_end = (x_end <= (int)fb_width) ? x_end : fb_width; - x_end = x_end > 0 ? x_end : 0; - x_end = x_end <= (int)fb_width ? x_end : fb_width; - - y_end = y_end > 0 ? y_end : 0; - y_end = y_end <= (int)fb_height ? y_end : fb_height; + y_end = (y_end > 0) ? y_end : 0; + y_end = (y_end <= (int)fb_height) ? y_end : fb_height; for (y_index = (unsigned)y_start; y_index < (unsigned)y_end; y_index++) { @@ -2191,6 +1938,9 @@ static void rgui_init_particle_effect(rgui_t *rgui, static void rgui_render_particle_effect( rgui_t *rgui, gfx_animation_t *p_anim, + uint16_t *frame_buf_data, + float particle_effect_speed, + bool particle_effect_screensaver, unsigned fb_width, unsigned fb_height) { @@ -2200,22 +1950,6 @@ static void rgui_render_particle_effect( * risk of clashing with specific particle effect * implementation variables... */ float global_speed_factor = 1.0f; - settings_t *settings = config_get_ptr(); - float particle_effect_speed = 0.0f; - bool particle_effect_screensaver = false; - uint16_t *frame_buf_data = NULL; - - if (settings) - { - particle_effect_speed = settings->floats.menu_rgui_particle_effect_speed; - particle_effect_screensaver = settings->bools.menu_rgui_particle_effect_screensaver; - } - - /* Sanity check */ - if (!rgui || !rgui->frame_buf.data) - return; - - frame_buf_data = rgui->frame_buf.data; /* Check whether screensaver is currently active */ if (rgui->show_screensaver) @@ -2478,7 +2212,7 @@ static void rgui_render_particle_effect( rgui_render_border(rgui, frame_buf_data, fb_width, fb_height); } -static void process_wallpaper(rgui_t *rgui, struct texture_image *image) +static void rgui_process_wallpaper(rgui_t *rgui, struct texture_image *image) { unsigned x, y; unsigned x_crop_offset; @@ -2519,12 +2253,11 @@ static void process_wallpaper(rgui_t *rgui, struct texture_image *image) } rgui->show_wallpaper = true; - /* Tell menu that a display update is required */ - rgui->force_redraw = true; + rgui->force_redraw = true; } -static bool request_thumbnail( +static bool rgui_request_thumbnail( thumbnail_t *thumbnail, enum gfx_thumbnail_id thumbnail_id, uint32_t *queue_size, @@ -2537,10 +2270,10 @@ static bool request_thumbnail( return true; /* 'Reset' current thumbnail */ - thumbnail->width = 0; - thumbnail->height = 0; + thumbnail->width = 0; + thumbnail->height = 0; thumbnail->is_valid = false; - thumbnail->path[0] = '\0'; + thumbnail->path[0] = '\0'; /* Ensure that new path is valid... */ if (!string_is_empty(path)) @@ -2567,57 +2300,57 @@ static bool request_thumbnail( return false; } -static bool downscale_thumbnail(rgui_t *rgui, +/* TODO/FIXME - we can remove the dependency on rgui struct here */ + +static bool rgui_downscale_thumbnail( + rgui_t *rgui, unsigned max_width, unsigned max_height, - struct texture_image *image_src, struct texture_image *image_dst) + unsigned thumbnail_downscaler, + struct texture_image *image_src, + struct texture_image *image_dst) { /* Determine output dimensions */ float display_aspect_ratio = (float)max_width / (float)max_height; float aspect_ratio = (float)image_src->width / (float)image_src->height; - settings_t *settings = config_get_ptr(); - unsigned thumbnail_downscaler = settings->uints.menu_rgui_thumbnail_downscaler; if (aspect_ratio > display_aspect_ratio) { - image_dst->width = max_width; - image_dst->height = image_src->height * max_width / image_src->width; + image_dst->width = max_width; + image_dst->height = image_src->height * max_width / image_src->width; /* Account for any possible rounding errors... */ - image_dst->height = (image_dst->height < 1) ? 1 : image_dst->height; - image_dst->height = (image_dst->height > max_height) ? max_height : image_dst->height; + image_dst->height = (image_dst->height < 1) ? 1 : image_dst->height; + image_dst->height = (image_dst->height > max_height) ? max_height : image_dst->height; } else { - image_dst->height = max_height; - image_dst->width = image_src->width * max_height / image_src->height; + image_dst->height = max_height; + image_dst->width = image_src->width * max_height / image_src->height; /* Account for any possible rounding errors... */ - image_dst->width = (image_dst->width < 1) ? 1 : image_dst->width; - image_dst->width = (image_dst->width > max_width) ? max_width : image_dst->width; + image_dst->width = (image_dst->width < 1) ? 1 : image_dst->width; + image_dst->width = (image_dst->width > max_width) ? max_width : image_dst->width; } /* Allocate pixel buffer */ - image_dst->pixels = (uint32_t*)calloc(image_dst->width * image_dst->height, sizeof(uint32_t)); + image_dst->pixels = (uint32_t*)calloc(image_dst->width * image_dst->height, sizeof(uint32_t)); if (!image_dst->pixels) return false; /* Determine scaling method */ if (thumbnail_downscaler == RGUI_THUMB_SCALE_POINT) { - uint32_t x_ratio, y_ratio; - unsigned x_src, y_src; unsigned x_dst, y_dst; - /* Perform nearest neighbour resampling * > Fastest method, minimal performance impact */ - x_ratio = ((image_src->width << 16) / image_dst->width); - y_ratio = ((image_src->height << 16) / image_dst->height); + uint32_t x_ratio = ((image_src->width << 16) / image_dst->width); + uint32_t y_ratio = ((image_src->height << 16) / image_dst->height); for (y_dst = 0; y_dst < image_dst->height; y_dst++) { - y_src = (y_dst * y_ratio) >> 16; + unsigned y_src = (y_dst * y_ratio) >> 16; for (x_dst = 0; x_dst < image_dst->width; x_dst++) { - x_src = (x_dst * x_ratio) >> 16; + unsigned x_src = (x_dst * x_ratio) >> 16; image_dst->pixels[(y_dst * image_dst->width) + x_dst] = image_src->pixels[(y_src * image_src->width) + x_src]; } } @@ -2663,7 +2396,11 @@ static bool downscale_thumbnail(rgui_t *rgui, return true; } -static void process_thumbnail(rgui_t *rgui, thumbnail_t *thumbnail, uint32_t *queue_size, struct texture_image *image_src) +static void rgui_process_thumbnail( + rgui_t *rgui, thumbnail_t *thumbnail, + uint32_t *queue_size, + unsigned menu_rgui_thumbnail_downscaler, + struct texture_image *image_src) { unsigned x, y; struct texture_image *image = NULL; @@ -2678,9 +2415,8 @@ static void process_thumbnail(rgui_t *rgui, thumbnail_t *thumbnail, uint32_t *qu * thumbnail image (i.e. don't waste CPU cycles processing * old images if we have a backlog) */ if (*queue_size > 0) - *queue_size = *queue_size - 1; - if (*queue_size > 0) - return; + if ((*queue_size = *queue_size - 1) > 0) + return; /* Sanity check */ if (!image_src->pixels || (image_src->width < 1) || (image_src->height < 1) || !thumbnail->data) @@ -2689,39 +2425,37 @@ static void process_thumbnail(rgui_t *rgui, thumbnail_t *thumbnail, uint32_t *qu /* Downscale thumbnail if it exceeds maximum size limits */ if ((image_src->width > thumbnail->max_width) || (image_src->height > thumbnail->max_height)) { - if (!downscale_thumbnail(rgui, thumbnail->max_width, thumbnail->max_height, image_src, &image_resampled)) + if (!rgui_downscale_thumbnail(rgui, thumbnail->max_width, thumbnail->max_height, + menu_rgui_thumbnail_downscaler, + image_src, &image_resampled)) { if (image_resampled.pixels) free(image_resampled.pixels); return; } - image = &image_resampled; + image = &image_resampled; } else - { - image = image_src; - } + image = image_src; - thumbnail->width = image->width; - thumbnail->height = image->height; + thumbnail->width = image->width; + thumbnail->height = image->height; /* Copy image to thumbnail buffer, performing pixel format conversion */ for (x = 0; x < thumbnail->width; x++) { for (y = 0; y < thumbnail->height; y++) - { thumbnail->data[x + (y * thumbnail->width)] = argb32_to_pixel_platform_format(image->pixels[x + (y * thumbnail->width)]); - } } - thumbnail->is_valid = true; + thumbnail->is_valid = true; /* Tell menu that a display update is required */ - rgui->force_redraw = true; + rgui->force_redraw = true; /* Clean up */ - image = NULL; + image = NULL; if (image_resampled.pixels) free(image_resampled.pixels); image_resampled.pixels = NULL; @@ -2730,9 +2464,8 @@ static void process_thumbnail(rgui_t *rgui, thumbnail_t *thumbnail, uint32_t *qu static bool rgui_load_image(void *userdata, void *data, enum menu_image_type type) { rgui_t *rgui = (rgui_t*)userdata; - settings_t *settings = config_get_ptr(); - if (!rgui || !settings) + if (!rgui) return false; if (!data) @@ -2762,19 +2495,25 @@ static bool rgui_load_image(void *userdata, void *data, enum menu_image_type typ switch (type) { case MENU_IMAGE_WALLPAPER: - { - struct texture_image *image = (struct texture_image*)data; - process_wallpaper(rgui, image); - } + rgui_process_wallpaper(rgui, (struct texture_image*)data); break; case MENU_IMAGE_THUMBNAIL: { - struct texture_image *image = (struct texture_image*)data; + struct texture_image *image = (struct texture_image*)data; + settings_t *settings = config_get_ptr(); + bool menu_rgui_inline_thumbnails = + settings->bools.menu_rgui_inline_thumbnails; + unsigned menu_rgui_thumbnail_downscaler = + settings->uints.menu_rgui_thumbnail_downscaler; if (rgui->show_fs_thumbnail) - process_thumbnail(rgui, &rgui->fs_thumbnail, &rgui->thumbnail_queue_size, image); - else if (settings->bools.menu_rgui_inline_thumbnails) - process_thumbnail(rgui, &rgui->mini_thumbnail, &rgui->thumbnail_queue_size, image); + rgui_process_thumbnail(rgui, &rgui->fs_thumbnail, &rgui->thumbnail_queue_size, + menu_rgui_thumbnail_downscaler, + image); + else if (menu_rgui_inline_thumbnails) + rgui_process_thumbnail(rgui, &rgui->mini_thumbnail, &rgui->thumbnail_queue_size, + menu_rgui_thumbnail_downscaler, + image); else { /* If user toggles settings rapidly on very slow systems, @@ -2789,8 +2528,13 @@ static bool rgui_load_image(void *userdata, void *data, enum menu_image_type typ break; case MENU_IMAGE_LEFT_THUMBNAIL: { - struct texture_image *image = (struct texture_image*)data; - process_thumbnail(rgui, &rgui->mini_left_thumbnail, &rgui->left_thumbnail_queue_size, image); + struct texture_image *image = (struct texture_image*)data; + settings_t *settings = config_get_ptr(); + unsigned menu_rgui_thumbnail_downscaler = + settings->uints.menu_rgui_thumbnail_downscaler; + rgui_process_thumbnail(rgui, &rgui->mini_left_thumbnail, &rgui->left_thumbnail_queue_size, + menu_rgui_thumbnail_downscaler, + image); } break; default: @@ -2933,16 +2677,12 @@ static unsigned INLINE rgui_get_mini_thumbnail_fullwidth(rgui_t *rgui) } static void rgui_render_mini_thumbnail( - rgui_t *rgui, thumbnail_t *thumbnail, enum gfx_thumbnail_id thumbnail_id, + rgui_t *rgui, thumbnail_t *thumbnail, + uint16_t *frame_buf_data, + enum gfx_thumbnail_id thumbnail_id, unsigned fb_width, unsigned fb_height, - size_t fb_pitch) + size_t fb_pitch, bool menu_rgui_swap_thumbnails) { - settings_t *settings = config_get_ptr(); - uint16_t *frame_buf_data = rgui->frame_buf.data; - - if (!thumbnail || !settings) - return; - if (thumbnail->is_valid && frame_buf_data && thumbnail->data) { unsigned y; @@ -2962,8 +2702,8 @@ static void rgui_render_mini_thumbnail( fb_x_offset = (rgui->term_layout.start_x + term_width) - (thumbnail->width + ((thumbnail_fullwidth - thumbnail->width) >> 1)); - if (((thumbnail_id == GFX_THUMBNAIL_RIGHT) && !settings->bools.menu_rgui_swap_thumbnails) || - ((thumbnail_id == GFX_THUMBNAIL_LEFT) && settings->bools.menu_rgui_swap_thumbnails)) + if (((thumbnail_id == GFX_THUMBNAIL_RIGHT) && !menu_rgui_swap_thumbnails) || + ((thumbnail_id == GFX_THUMBNAIL_LEFT) && menu_rgui_swap_thumbnails)) fb_y_offset = rgui->term_layout.start_y + ((thumbnail->max_height - thumbnail->height) >> 1); else fb_y_offset = (rgui->term_layout.start_y + term_height) - @@ -3173,7 +2913,10 @@ static void update_dynamic_theme_path(rgui_t *rgui, const char *theme_dir) "default.cfg", sizeof(rgui->theme_dynamic_path)); } -static void load_custom_theme(rgui_t *rgui, rgui_theme_t *theme_colors, const char *theme_path) +static void rgui_load_custom_theme( + rgui_t *rgui, rgui_theme_t *theme_colors, + const char *theme_path, + unsigned menu_rgui_aspect_ratio) { char wallpaper_file[PATH_MAX_LENGTH]; unsigned normal_color = 0; @@ -3189,14 +2932,11 @@ static void load_custom_theme(rgui_t *rgui, rgui_theme_t *theme_colors, const ch const char *wallpaper_key = NULL; bool success = false; #if defined(DINGUX) - unsigned aspect_ratio = RGUI_DINGUX_ASPECT_RATIO; -#else - settings_t *settings = config_get_ptr(); - unsigned aspect_ratio = settings->uints.menu_rgui_aspect_ratio; + menu_rgui_aspect_ratio = RGUI_DINGUX_ASPECT_RATIO; #endif /* Determine which type of wallpaper to load */ - switch (aspect_ratio) + switch (menu_rgui_aspect_ratio) { case RGUI_ASPECT_RATIO_16_9: case RGUI_ASPECT_RATIO_16_9_CENTRE: @@ -3330,10 +3070,6 @@ static void rgui_cache_background(rgui_t *rgui, { frame_buf_t *background_buf = &rgui->background_buf; - /* Only regenerate the background if we are *not* - * currently showing a wallpaper image */ - if (rgui->show_wallpaper) - return; /* Sanity check */ if ((fb_width != background_buf->width) || (fb_height != background_buf->height) || @@ -3351,29 +3087,34 @@ static void rgui_cache_background(rgui_t *rgui, rgui_render_border(rgui, background_buf->data, fb_width, fb_height); } -static void prepare_rgui_colors(rgui_t *rgui, settings_t *settings) +static void prepare_rgui_colors(rgui_t *rgui, + unsigned menu_rgui_color_theme, + const char *path_rgui_theme_preset, + bool menu_rgui_transparency, + unsigned menu_rgui_aspect_ratio) { rgui_theme_t theme_colors; - uint32_t ss_particle_color_argb32; - unsigned rgui_color_theme = settings->uints.menu_rgui_color_theme; - const char *rgui_theme_preset = settings->paths.path_rgui_theme_preset; - bool rgui_transparency = settings->bools.menu_rgui_transparency; + uint32_t ss_particle_color_argb32 = 0; - rgui->color_theme = rgui_color_theme; - rgui->transparency_enable = rgui_transparency; - rgui->show_wallpaper = false; + rgui->color_theme = menu_rgui_color_theme; + rgui->transparency_enable = menu_rgui_transparency; + rgui->show_wallpaper = false; if (rgui->color_theme == RGUI_THEME_CUSTOM) { - strlcpy(rgui->theme_preset_path, rgui_theme_preset, + strlcpy(rgui->theme_preset_path, + path_rgui_theme_preset, sizeof(rgui->theme_preset_path)); - load_custom_theme(rgui, &theme_colors, rgui_theme_preset); + rgui_load_custom_theme(rgui, &theme_colors, + path_rgui_theme_preset, + menu_rgui_aspect_ratio); } else if (rgui->color_theme == RGUI_THEME_DYNAMIC) { strlcpy(rgui->last_theme_dynamic_path, rgui->theme_dynamic_path, sizeof(rgui->last_theme_dynamic_path)); - load_custom_theme(rgui, &theme_colors, rgui->theme_dynamic_path); + rgui_load_custom_theme(rgui, &theme_colors, rgui->theme_dynamic_path, + menu_rgui_aspect_ratio); } else { @@ -3555,8 +3296,8 @@ static void blit_line_extended( else { unsigned i, j; - bool *symbol_lut; - uint32_t symbol = utf8_walk(&message); + bool *symbol_lut = NULL; + uint32_t symbol = utf8_walk(&message); /* Stupid cretinous hack: 'oe' ligatures are not * really standard extended ASCII, so we have to @@ -3594,16 +3335,16 @@ static void blit_line_extended_shadow( unsigned fb_width, int x, int y, const char *message, uint16_t color, uint16_t shadow_color) { - uint16_t *frame_buf_data = rgui->frame_buf.data; - bool **lut = rgui->fonts.regular->lut; uint16_t color_buf[2]; uint16_t shadow_color_buf[2]; + uint16_t *frame_buf_data = rgui->frame_buf.data; + bool **lut = rgui->fonts.regular->lut; - color_buf[0] = color; - color_buf[1] = shadow_color; + color_buf[0] = color; + color_buf[1] = shadow_color; - shadow_color_buf[0] = shadow_color; - shadow_color_buf[1] = shadow_color; + shadow_color_buf[0] = shadow_color; + shadow_color_buf[1] = shadow_color; while (!string_is_empty(message)) { @@ -3613,8 +3354,8 @@ static void blit_line_extended_shadow( else { unsigned i, j; - bool *symbol_lut; - uint32_t symbol = utf8_walk(&message); + bool *symbol_lut = NULL; + uint32_t symbol = utf8_walk(&message); /* Stupid cretinous hack: 'oe' ligatures are not * really standard extended ASCII, so we have to @@ -3676,8 +3417,8 @@ static void blit_line_cjk( else { unsigned i, j; - bool *symbol_lut; - uint32_t symbol = utf8_walk(&message); + bool *symbol_lut = NULL; + uint32_t symbol = utf8_walk(&message); /* TODO/FIXME: check if really needed */ if (symbol == 339) /* Latin small ligature oe */ @@ -3718,19 +3459,19 @@ static void blit_line_cjk_shadow( unsigned fb_width, int x, int y, const char *message, uint16_t color, uint16_t shadow_color) { + uint16_t color_buf[2]; + uint16_t shadow_color_buf[2]; uint16_t *frame_buf_data = rgui->frame_buf.data; bitmapfont_lut_t *font_eng = rgui->fonts.eng_10x10; bitmapfont_lut_t *font_chn = rgui->fonts.chn_10x10; bitmapfont_lut_t *font_jpn = rgui->fonts.jpn_10x10; bitmapfont_lut_t *font_kor = rgui->fonts.kor_10x10; - uint16_t color_buf[2]; - uint16_t shadow_color_buf[2]; - color_buf[0] = color; - color_buf[1] = shadow_color; + color_buf[0] = color; + color_buf[1] = shadow_color; - shadow_color_buf[0] = shadow_color; - shadow_color_buf[1] = shadow_color; + shadow_color_buf[0] = shadow_color; + shadow_color_buf[1] = shadow_color; while (!string_is_empty(message)) { @@ -3740,8 +3481,8 @@ static void blit_line_cjk_shadow( else { unsigned i, j; - bool *symbol_lut; - uint32_t symbol = utf8_walk(&message); + bool *symbol_lut = NULL; + uint32_t symbol = utf8_walk(&message); /* TODO/FIXME: check if really needed */ if (symbol == 339) /* Latin small ligature oe */ @@ -3803,8 +3544,8 @@ static void blit_line_rus( else { unsigned i, j; - bool *symbol_lut; - uint32_t symbol = utf8_walk(&message); + bool *symbol_lut = NULL; + uint32_t symbol = utf8_walk(&message); /* TODO/FIXME: check if really needed */ if (symbol == 339) /* Latin small ligature oe */ @@ -3841,17 +3582,17 @@ static void blit_line_rus_shadow( unsigned fb_width, int x, int y, const char *message, uint16_t color, uint16_t shadow_color) { + uint16_t color_buf[2]; + uint16_t shadow_color_buf[2]; uint16_t *frame_buf_data = rgui->frame_buf.data; bitmapfont_lut_t *font_eng = rgui->fonts.eng_10x10; bitmapfont_lut_t *font_rus = rgui->fonts.rus_10x10; - uint16_t color_buf[2]; - uint16_t shadow_color_buf[2]; - color_buf[0] = color; - color_buf[1] = shadow_color; + color_buf[0] = color; + color_buf[1] = shadow_color; - shadow_color_buf[0] = shadow_color; - shadow_color_buf[1] = shadow_color; + shadow_color_buf[0] = shadow_color; + shadow_color_buf[1] = shadow_color; while (!string_is_empty(message)) { @@ -3861,8 +3602,8 @@ static void blit_line_rus_shadow( else { unsigned i, j; - bool *symbol_lut; - uint32_t symbol = utf8_walk(&message); + bool *symbol_lut = NULL; + uint32_t symbol = utf8_walk(&message); /* TODO/FIXME: check if really needed */ if (symbol == 339) /* Latin small ligature oe */ @@ -3920,8 +3661,8 @@ static void blit_line_6x10( else { unsigned i, j; - bool *symbol_lut; - uint32_t symbol = utf8_walk(&message); + bool *symbol_lut = NULL; + uint32_t symbol = utf8_walk(&message); /* Find glyph LUT data */ if (symbol <= font_eng->glyph_max) @@ -3952,17 +3693,17 @@ static void blit_line_6x10_shadow( unsigned fb_width, int x, int y, const char *message, uint16_t color, uint16_t shadow_color) { + uint16_t color_buf[2]; + uint16_t shadow_color_buf[2]; uint16_t *frame_buf_data = rgui->frame_buf.data; bitmapfont_lut_t *font_eng = rgui->fonts.eng_6x10; bitmapfont_lut_t *font_lse = rgui->fonts.lse_6x10; - uint16_t color_buf[2]; - uint16_t shadow_color_buf[2]; - color_buf[0] = color; - color_buf[1] = shadow_color; + color_buf[0] = color; + color_buf[1] = shadow_color; - shadow_color_buf[0] = shadow_color; - shadow_color_buf[1] = shadow_color; + shadow_color_buf[0] = shadow_color; + shadow_color_buf[1] = shadow_color; while (!string_is_empty(message)) { @@ -3972,8 +3713,8 @@ static void blit_line_6x10_shadow( else { unsigned i, j; - bool *symbol_lut; - uint32_t symbol = utf8_walk(&message); + bool *symbol_lut = NULL; + uint32_t symbol = utf8_walk(&message); /* Find glyph LUT data */ if (symbol <= font_eng->glyph_max) @@ -4016,51 +3757,284 @@ static void (*blit_line)(rgui_t *rgui, unsigned fb_width, int x, int y, static const uint8_t *rgui_get_symbol_data(enum rgui_symbol_type symbol) { - switch (symbol) - { - case RGUI_SYMBOL_BACKSPACE: - return rgui_symbol_data_backspace; - case RGUI_SYMBOL_ENTER: - return rgui_symbol_data_enter; - case RGUI_SYMBOL_SHIFT_UP: - return rgui_symbol_data_shift_up; - case RGUI_SYMBOL_SHIFT_DOWN: - return rgui_symbol_data_shift_down; - case RGUI_SYMBOL_NEXT: - return rgui_symbol_data_next; - case RGUI_SYMBOL_TEXT_CURSOR: - return rgui_symbol_data_text_cursor; - case RGUI_SYMBOL_CHARGING: - return rgui_symbol_data_charging; - case RGUI_SYMBOL_BATTERY_100: - return rgui_symbol_data_battery_100; - case RGUI_SYMBOL_BATTERY_80: - return rgui_symbol_data_battery_80; - case RGUI_SYMBOL_BATTERY_60: - return rgui_symbol_data_battery_60; - case RGUI_SYMBOL_BATTERY_40: - return rgui_symbol_data_battery_40; - case RGUI_SYMBOL_BATTERY_20: - return rgui_symbol_data_battery_20; - case RGUI_SYMBOL_CHECKMARK: - return rgui_symbol_data_checkmark; - case RGUI_SYMBOL_SWITCH_ON_LEFT: - return rgui_symbol_data_switch_on_left; - case RGUI_SYMBOL_SWITCH_ON_CENTRE: - return rgui_symbol_data_switch_on_centre; - case RGUI_SYMBOL_SWITCH_ON_RIGHT: - return rgui_symbol_data_switch_on_right; - case RGUI_SYMBOL_SWITCH_OFF_LEFT: - return rgui_symbol_data_switch_off_left; - case RGUI_SYMBOL_SWITCH_OFF_CENTRE: - return rgui_symbol_data_switch_off_centre; - case RGUI_SYMBOL_SWITCH_OFF_RIGHT: - return rgui_symbol_data_switch_off_right; - default: - break; - } + /* All custom symbols must have dimensions + * of exactly RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT */ + static const uint8_t rgui_symbol_data_backspace[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, + 0, 1, 0, 0, 0, + 1, 1, 1, 1, 1, + 0, 1, 0, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; - return NULL; + static const uint8_t rgui_symbol_data_enter[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, + 0, 0, 0, 0, 1, + 0, 0, 0, 0, 1, + 0, 0, 1, 0, 1, + 0, 1, 0, 0, 1, + 1, 1, 1, 1, 1, + 0, 1, 0, 0, 0, /* Baseline */ + 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_shift_up[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, + 0, 1, 1, 1, 0, + 1, 1, 0, 1, 1, + 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, + 0, 1, 1, 1, 0, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_shift_down[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 1, 1, 1, 0, + 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, + 1, 1, 0, 1, 1, + 0, 1, 1, 1, 0, + 0, 0, 1, 0, 0, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_next[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 1, 1, 1, 0, + 1, 0, 1, 0, 1, + 1, 1, 1, 1, 1, + 1, 0, 1, 0, 1, + 0, 1, 1, 1, 0, + 0, 0, 0, 0, 0, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_text_cursor[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, /* Baseline */ + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1}; + + static const uint8_t rgui_symbol_data_charging[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 0, 1, 1, 1, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_battery_100[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 1, 1, 0, + 0, 1, 1, 1, 1, + 0, 1, 1, 1, 1, + 0, 1, 1, 1, 1, + 0, 1, 1, 1, 1, + 0, 1, 1, 1, 1, + 0, 1, 1, 1, 1, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_battery_80[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 1, 1, 0, + 0, 1, 1, 1, 1, + 0, 1, 0, 0, 1, + 0, 1, 1, 1, 1, + 0, 1, 1, 1, 1, + 0, 1, 1, 1, 1, + 0, 1, 1, 1, 1, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_battery_60[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 1, 1, 0, + 0, 1, 1, 1, 1, + 0, 1, 0, 0, 1, + 0, 1, 0, 0, 1, + 0, 1, 1, 1, 1, + 0, 1, 1, 1, 1, + 0, 1, 1, 1, 1, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_battery_40[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 1, 1, 0, + 0, 1, 1, 1, 1, + 0, 1, 0, 0, 1, + 0, 1, 0, 0, 1, + 0, 1, 0, 0, 1, + 0, 1, 1, 1, 1, + 0, 1, 1, 1, 1, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_battery_20[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 1, 1, 0, + 0, 1, 1, 1, 1, + 0, 1, 0, 0, 1, + 0, 1, 0, 0, 1, + 0, 1, 0, 0, 1, + 0, 1, 0, 0, 1, + 0, 1, 1, 1, 1, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + /* Note: This is not actually a 'checkmark' - we don't + * have enough pixels to draw one effectively. The 'icon' + * is merely named according to its function... */ + static const uint8_t rgui_symbol_data_checkmark[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 1, 1, 0, 0, + 0, 1, 1, 0, 0, + 0, 1, 1, 0, 0, + 0, 1, 1, 0, 0, + 0, 1, 1, 0, 0, + 0, 1, 1, 0, 0, + 0, 1, 1, 0, 0, + 0, 1, 1, 0, 0, /* Baseline */ + 0, 1, 1, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_switch_on_left[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 0, 1, 1, 1, 1, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_switch_on_centre[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 1, 1, 0, + 1, 1, 1, 1, 0, + 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_switch_on_right[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 1, 1, 1, 0, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 0, 1, 1, 1, 0, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_switch_off_left[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 1, 1, 1, 0, + 1, 0, 0, 0, 1, + 1, 0, 0, 0, 1, + 1, 0, 0, 0, 1, + 1, 0, 0, 0, 1, + 1, 0, 0, 0, 1, + 0, 1, 1, 1, 0, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_switch_off_centre[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, + 0, 1, 0, 0, 0, + 0, 1, 1, 1, 1, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + static const uint8_t rgui_symbol_data_switch_off_right[RGUI_SYMBOL_WIDTH * RGUI_SYMBOL_HEIGHT] = { + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 1, 1, 0, + 0, 0, 0, 0, 1, + 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, /* Baseline */ + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; + + switch (symbol) + { + case RGUI_SYMBOL_BACKSPACE: + return rgui_symbol_data_backspace; + case RGUI_SYMBOL_ENTER: + return rgui_symbol_data_enter; + case RGUI_SYMBOL_SHIFT_UP: + return rgui_symbol_data_shift_up; + case RGUI_SYMBOL_SHIFT_DOWN: + return rgui_symbol_data_shift_down; + case RGUI_SYMBOL_NEXT: + return rgui_symbol_data_next; + case RGUI_SYMBOL_TEXT_CURSOR: + return rgui_symbol_data_text_cursor; + case RGUI_SYMBOL_CHARGING: + return rgui_symbol_data_charging; + case RGUI_SYMBOL_BATTERY_100: + return rgui_symbol_data_battery_100; + case RGUI_SYMBOL_BATTERY_80: + return rgui_symbol_data_battery_80; + case RGUI_SYMBOL_BATTERY_60: + return rgui_symbol_data_battery_60; + case RGUI_SYMBOL_BATTERY_40: + return rgui_symbol_data_battery_40; + case RGUI_SYMBOL_BATTERY_20: + return rgui_symbol_data_battery_20; + case RGUI_SYMBOL_CHECKMARK: + return rgui_symbol_data_checkmark; + case RGUI_SYMBOL_SWITCH_ON_LEFT: + return rgui_symbol_data_switch_on_left; + case RGUI_SYMBOL_SWITCH_ON_CENTRE: + return rgui_symbol_data_switch_on_centre; + case RGUI_SYMBOL_SWITCH_ON_RIGHT: + return rgui_symbol_data_switch_on_right; + case RGUI_SYMBOL_SWITCH_OFF_LEFT: + return rgui_symbol_data_switch_off_left; + case RGUI_SYMBOL_SWITCH_OFF_CENTRE: + return rgui_symbol_data_switch_off_centre; + case RGUI_SYMBOL_SWITCH_OFF_RIGHT: + return rgui_symbol_data_switch_off_right; + default: + break; + } + + return NULL; } static void blit_symbol_regular(rgui_t *rgui, unsigned fb_width, int x, int y, @@ -4089,16 +4063,16 @@ static void blit_symbol_shadow(rgui_t *rgui, unsigned fb_width, int x, int y, enum rgui_symbol_type symbol, uint16_t color, uint16_t shadow_color) { unsigned i, j; - uint16_t *frame_buf_data = rgui->frame_buf.data; - const uint8_t *symbol_data = rgui_get_symbol_data(symbol); uint16_t color_buf[2]; uint16_t shadow_color_buf[2]; + uint16_t *frame_buf_data = rgui->frame_buf.data; + const uint8_t *symbol_data = rgui_get_symbol_data(symbol); - color_buf[0] = color; - color_buf[1] = shadow_color; + color_buf[0] = color; + color_buf[1] = shadow_color; - shadow_color_buf[0] = shadow_color; - shadow_color_buf[1] = shadow_color; + shadow_color_buf[0] = shadow_color; + shadow_color_buf[1] = shadow_color; if (!symbol_data) return; @@ -4230,17 +4204,14 @@ static void rgui_render_messagebox(rgui_t *rgui, const char *message, { int x, y; size_t i; + char wrapped_message[MENU_SUBLABEL_MAX_LENGTH]; unsigned width = 0; unsigned glyphs_width = 0; unsigned height = 0; struct string_list list = {0}; uint16_t *frame_buf_data = rgui->frame_buf.data; - char wrapped_message[MENU_SUBLABEL_MAX_LENGTH]; - wrapped_message[0] = '\0'; - - if (string_is_empty(message)) - return; + wrapped_message[0] = '\0'; /* Split message into lines */ word_wrap( @@ -4258,22 +4229,21 @@ static void rgui_render_messagebox(rgui_t *rgui, const char *message, for (i = 0; i < list.size; i++) { - unsigned line_width; - char *msg = list.elems[i].data; - unsigned msglen = (unsigned)utf8len(msg); - - line_width = msglen * rgui->font_width_stride - 1 + 6 + 10; - width = MAX(width, line_width); - glyphs_width = MAX(glyphs_width, msglen); + char *msg = list.elems[i].data; + unsigned msglen = (unsigned)utf8len(msg); + unsigned line_width = msglen * rgui->font_width_stride - 1 + 6 + 10; + width = MAX(width, line_width); + glyphs_width = MAX(glyphs_width, msglen); } - height = (unsigned)(rgui->font_height_stride * list.size + 6 + 10); - x = ((int)fb_width - (int)width) / 2; - y = ((int)fb_height - (int)height) / 2; + height = (unsigned)(rgui->font_height_stride * list.size + 6 + 10); + x = ((int)fb_width - (int)width) / 2; + y = ((int)fb_height - (int)height) / 2; - height = (height > fb_height) ? fb_height : height; - x = (x < 0) ? 0 : x; - y = (y < 0) ? 0 : y; + if (height > fb_height) + height = fb_height; + x = (x < 0) ? 0 : x; + y = (y < 0) ? 0 : y; if (frame_buf_data) { @@ -4383,16 +4353,16 @@ static int rgui_osk_ptr_at_pos(void *data, int x, int y, fb_width = p_disp->framebuf_width; fb_height = p_disp->framebuf_height; - osk_x = (fb_width - osk_width) / 2; - osk_y = (fb_height - osk_height) / 2; + osk_x = (fb_width - osk_width) / 2; + osk_y = (fb_height - osk_height) / 2; for (key_index = 0; key_index < 44; key_index++) { - unsigned key_row = (unsigned)(key_index / OSK_CHARS_PER_LINE); - unsigned key_column = (unsigned)(key_index - (key_row * OSK_CHARS_PER_LINE)); + unsigned key_row = (unsigned)(key_index / OSK_CHARS_PER_LINE); + unsigned key_column = (unsigned)(key_index - (key_row * OSK_CHARS_PER_LINE)); - unsigned osk_ptr_x = osk_x + keyboard_offset_x + ptr_offset_x + (key_column * key_width); - unsigned osk_ptr_y = osk_y + keyboard_offset_y + ptr_offset_y + (key_row * key_height); + unsigned osk_ptr_x = osk_x + keyboard_offset_x + ptr_offset_x + (key_column * key_width); + unsigned osk_ptr_y = osk_y + keyboard_offset_y + ptr_offset_y + (key_row * key_height); if (x > osk_ptr_x && x < osk_ptr_x + ptr_width && y > osk_ptr_y && y < osk_ptr_y + ptr_height) @@ -4404,6 +4374,7 @@ static int rgui_osk_ptr_at_pos(void *data, int x, int y, static void rgui_render_osk( rgui_t *rgui, + uint16_t *frame_buf_data, gfx_animation_ctx_ticker_t *ticker, gfx_animation_ctx_ticker_smooth_t *ticker_smooth, bool use_smooth_ticker, @@ -4432,11 +4403,9 @@ static void rgui_render_osk( char **osk_grid = input_st->osk_grid; const char *input_str = menu_input_dialog_get_buffer(); const char *input_label = menu_input_dialog_get_label_buffer(); - - uint16_t *frame_buf_data = rgui->frame_buf.data; - + /* Sanity check 1 */ - if (!frame_buf_data || osk_ptr < 0 || osk_ptr >= 44 || !osk_grid[0]) + if (osk_ptr < 0 || osk_ptr >= 44 || !osk_grid[0]) return; key_text_offset_x = 8; @@ -4468,10 +4437,8 @@ static void rgui_render_osk( * fallback to old style 'message box' implementation */ char msg[255]; msg[0] = '\0'; - snprintf(msg, sizeof(msg), "%s\n%s", input_label, input_str); rgui_render_messagebox(rgui, msg, fb_width, fb_height); - return; } @@ -4490,7 +4457,7 @@ static void rgui_render_osk( /* Draw drop shadow, if required */ if (rgui->shadow_enable) { - uint16_t shadow_color = rgui->colors.shadow_color; + uint16_t shadow_color = rgui->colors.shadow_color; /* Frame */ rgui_color_rect(frame_buf_data, fb_width, fb_height, @@ -4548,10 +4515,10 @@ static void rgui_render_osk( } else { - ticker->s = input_label_buf; - ticker->len = input_label_max_length; - ticker->str = input_label; - ticker->selected = true; + ticker->s = input_label_buf; + ticker->len = input_label_max_length; + ticker->str = input_label; + ticker->selected = true; gfx_animation_ticker(ticker); } @@ -4566,31 +4533,29 @@ static void rgui_render_osk( /* Draw input buffer text */ { - unsigned input_str_char_offset; int input_str_x, input_str_y; int text_cursor_x; - unsigned input_str_length = (unsigned)utf8len(input_str); - const char *input_str_visible = NULL; + unsigned input_str_char_offset = 0; + unsigned input_str_length = (unsigned)utf8len(input_str); + const char *input_str_visible = NULL; if (input_str_length > input_str_max_length) { - input_str_char_offset = input_str_length - input_str_max_length; - input_str_length = input_str_max_length; + input_str_char_offset = input_str_length - input_str_max_length; + input_str_length = input_str_max_length; } - else - input_str_char_offset = 0; - input_str_x = osk_x + input_offset_x; - input_str_y = osk_y + input_offset_y + rgui->font_height_stride; - - input_str_visible = utf8skip(input_str, input_str_char_offset); + input_str_x = osk_x + input_offset_x; + input_str_y = osk_y + input_offset_y + rgui->font_height_stride; + input_str_visible = utf8skip(input_str, input_str_char_offset); if (!string_is_empty(input_str_visible)) blit_line(rgui, fb_width, input_str_x, input_str_y, input_str_visible, rgui->colors.hover_color, rgui->colors.shadow_color); /* Draw text cursor */ - text_cursor_x = osk_x + input_offset_x + (input_str_length * rgui->font_width_stride); + text_cursor_x = osk_x + input_offset_x + + (input_str_length * rgui->font_width_stride); blit_symbol(rgui, fb_width, text_cursor_x, input_str_y, RGUI_SYMBOL_TEXT_CURSOR, rgui->colors.normal_color, rgui->colors.shadow_color); @@ -4708,28 +4673,24 @@ static enum rgui_entry_value_type rgui_get_entry_value_type( const char *entry_value, bool entry_checked, bool switch_icons_enabled) { - enum rgui_entry_value_type value_type = RGUI_ENTRY_VALUE_NONE; - if (!string_is_empty(entry_value)) { - value_type = RGUI_ENTRY_VALUE_TEXT; - if (switch_icons_enabled) { /* Toggle switch off */ if (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_DISABLED)) || string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))) - value_type = RGUI_ENTRY_VALUE_SWITCH_OFF; + return RGUI_ENTRY_VALUE_SWITCH_OFF; /* Toggle switch on */ else if (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_ENABLED)) || string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))) - value_type = RGUI_ENTRY_VALUE_SWITCH_ON; + return RGUI_ENTRY_VALUE_SWITCH_ON; } + return RGUI_ENTRY_VALUE_TEXT; } else if (entry_checked) - value_type = RGUI_ENTRY_VALUE_CHECKMARK; - - return value_type; + return RGUI_ENTRY_VALUE_CHECKMARK; + return RGUI_ENTRY_VALUE_NONE; } #if defined(GEKKO) @@ -4773,14 +4734,17 @@ static void rgui_render(void *data, bool menu_mouse_enable = settings->bools.menu_mouse_enable; bool menu_core_enable = settings->bools.menu_core_enable; bool menu_timedate_enable = settings->bools.menu_timedate_enable; - bool current_display_cb = false; + bool menu_rgui_swap_thumbnails = settings->bools.menu_rgui_swap_thumbnails; + float menu_rgui_particle_effect_speed = settings->floats.menu_rgui_particle_effect_speed; + bool menu_rgui_particle_effect_screensaver = settings->bools.menu_rgui_particle_effect_screensaver; + bool current_display_cb = false; - bool show_fs_thumbnail = + bool show_fs_thumbnail = rgui->show_fs_thumbnail && rgui->entry_has_thumbnail && (rgui->fs_thumbnail.is_valid || (rgui->thumbnail_queue_size > 0)); - gfx_animation_t *p_anim = anim_get_ptr(); - gfx_display_t *p_disp = disp_get_ptr(); + gfx_animation_t *p_anim = anim_get_ptr(); + gfx_display_t *p_disp = disp_get_ptr(); /* Sanity check */ if (!rgui || !rgui->frame_buf.data) @@ -4846,7 +4810,10 @@ static void rgui_render(void *data, if (rgui->bg_modified || fb_size_changed) { - rgui_cache_background(rgui, fb_width, fb_height, fb_pitch); + /* Only regenerate the background if we are *not* + * currently showing a wallpaper image */ + if (!rgui->show_wallpaper) + rgui_cache_background(rgui, fb_width, fb_height, fb_pitch); /* Reinitialise particle effect, if required */ if (fb_size_changed && @@ -4931,7 +4898,10 @@ static void rgui_render(void *data, /* Render particle effect, if required */ if (rgui->particle_effect != RGUI_PARTICLE_EFFECT_NONE) - rgui_render_particle_effect(rgui, p_anim, fb_width, fb_height); + rgui_render_particle_effect(rgui, p_anim, rgui->frame_buf.data, + menu_rgui_particle_effect_speed, + menu_rgui_particle_effect_screensaver, + fb_width, fb_height); /* If screensaver is active, skip drawing of * text/thumbnails */ @@ -4959,7 +4929,8 @@ static void rgui_render(void *data, /* Note: On-screen keyboard takes precedence over * normal menu thumbnail/text list display modes */ if (current_display_cb) - rgui_render_osk(rgui, &ticker, &ticker_smooth, use_smooth_ticker, + rgui_render_osk(rgui, rgui->frame_buf.data, + &ticker, &ticker_smooth, use_smooth_ticker, fb_width, fb_height); else if (show_fs_thumbnail) { @@ -5047,7 +5018,7 @@ static void rgui_render(void *data, if (show_mini_thumbnails) { /* Get whether each thumbnail type is enabled */ - show_thumbnail = rgui->entry_has_thumbnail && + show_thumbnail = rgui->entry_has_thumbnail && (rgui->mini_thumbnail.is_valid || (rgui->thumbnail_queue_size > 0)); show_left_thumbnail = rgui->entry_has_left_thumbnail && (rgui->mini_left_thumbnail.is_valid || (rgui->left_thumbnail_queue_size > 0)); @@ -5400,13 +5371,18 @@ static void rgui_render(void *data, /* Draw mini thumbnails, if required */ if (show_mini_thumbnails) { - if (show_thumbnail) - rgui_render_mini_thumbnail(rgui, &rgui->mini_thumbnail, GFX_THUMBNAIL_RIGHT, - fb_width, fb_height, fb_pitch); - - if (show_left_thumbnail) - rgui_render_mini_thumbnail(rgui, &rgui->mini_left_thumbnail, GFX_THUMBNAIL_LEFT, - fb_width, fb_height, fb_pitch); + thumbnail_t *thumbnail1 = &rgui->mini_thumbnail; + thumbnail_t *thumbnail2 = &rgui->mini_left_thumbnail; + if (show_thumbnail && thumbnail1) + rgui_render_mini_thumbnail(rgui, thumbnail1, + rgui->frame_buf.data, + GFX_THUMBNAIL_RIGHT, + fb_width, fb_height, fb_pitch, menu_rgui_swap_thumbnails); + if (show_left_thumbnail && thumbnail2) + rgui_render_mini_thumbnail(rgui, thumbnail2, + rgui->frame_buf.data, + GFX_THUMBNAIL_LEFT, + fb_width, fb_height, fb_pitch, menu_rgui_swap_thumbnails); } /* Print menu sublabel/core name (if required) */ @@ -5558,41 +5534,31 @@ static void rgui_thumbnail_free(thumbnail_t *thumbnail) bool rgui_is_video_config_equal( rgui_video_settings_t *config_a, rgui_video_settings_t *config_b) { - return (config_a->aspect_ratio_idx == config_b->aspect_ratio_idx) && - (config_a->viewport.width == config_b->viewport.width) && - (config_a->viewport.height == config_b->viewport.height) && - (config_a->viewport.x == config_b->viewport.x) && - (config_a->viewport.y == config_b->viewport.y); + return (config_a->aspect_ratio_idx == config_b->aspect_ratio_idx) + && (config_a->viewport.width == config_b->viewport.width) + && (config_a->viewport.height == config_b->viewport.height) + && (config_a->viewport.x == config_b->viewport.x) + && (config_a->viewport.y == config_b->viewport.y); } -static void rgui_get_video_config(rgui_video_settings_t *video_settings) +static void rgui_get_video_config(rgui_video_settings_t *video_settings, unsigned video_aspect_ratio_idx) { - settings_t *settings = config_get_ptr(); /* Could use settings->video_viewport_custom directly, * but this seems to be the standard way of doing it... */ - video_viewport_t *custom_vp = video_viewport_get_custom(); - - if (!settings) - return; - - video_settings->aspect_ratio_idx = settings->uints.video_aspect_ratio_idx; + video_viewport_t *custom_vp = video_viewport_get_custom(); + video_settings->aspect_ratio_idx = video_aspect_ratio_idx; video_settings->viewport.width = custom_vp->width; video_settings->viewport.height = custom_vp->height; video_settings->viewport.x = custom_vp->x; video_settings->viewport.y = custom_vp->y; } -static void rgui_set_video_config(rgui_t *rgui, +static void rgui_set_video_config(rgui_t *rgui, settings_t *settings, rgui_video_settings_t *video_settings, bool delay_update) { - settings_t *settings = config_get_ptr(); /* Could use settings->video_viewport_custom directly, * but this seems to be the standard way of doing it... */ - video_viewport_t *custom_vp = video_viewport_get_custom(); - - if (!settings) - return; - + video_viewport_t *custom_vp = video_viewport_get_custom(); settings->uints.video_aspect_ratio_idx = video_settings->aspect_ratio_idx; custom_vp->width = video_settings->viewport.width; custom_vp->height = video_settings->viewport.height; @@ -6068,7 +6034,7 @@ static bool rgui_set_aspect_ratio(rgui_t *rgui, !rgui->ignore_resize_events) { rgui_update_menu_viewport(rgui, p_disp); - rgui_set_video_config(rgui, &rgui->menu_video_settings, delay_update); + rgui_set_video_config(rgui, settings, &rgui->menu_video_settings, delay_update); } return true; @@ -6145,7 +6111,7 @@ static void *rgui_init(void **userdata, bool video_is_threaded) goto error; /* Cache initial video settings */ - rgui_get_video_config(&rgui->content_video_settings); + rgui_get_video_config(&rgui->content_video_settings, settings->uints.video_aspect_ratio_idx); /* Get initial 'window' dimensions */ video_driver_get_viewport_info(&vp); @@ -6171,10 +6137,15 @@ static void *rgui_init(void **userdata, bool video_is_threaded) rgui->last_theme_dynamic_path[0] = '\0'; if (rgui_color_theme == RGUI_THEME_DYNAMIC) update_dynamic_theme_path(rgui, dynamic_theme_dir); - prepare_rgui_colors(rgui, settings); + prepare_rgui_colors(rgui, + settings->uints.menu_rgui_color_theme, + settings->paths.path_rgui_theme_preset, + settings->bools.menu_rgui_transparency, + settings->uints.menu_rgui_aspect_ratio + ); menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &start); - rgui->scroll_y = 0; + rgui->scroll_y = 0; rgui->bg_thickness = settings->bools.menu_rgui_background_filler_thickness_enable; rgui->border_thickness = settings->bools.menu_rgui_border_filler_thickness_enable; @@ -6391,20 +6362,18 @@ static void rgui_navigation_clear(void *data, bool pending_push) static void rgui_set_thumbnail_system(void *userdata, char *s, size_t len) { rgui_t *rgui = (rgui_t*)userdata; - if (!rgui) - return; - gfx_thumbnail_set_system( - rgui->thumbnail_path_data, s, playlist_get_cached()); + if (rgui) + gfx_thumbnail_set_system( + rgui->thumbnail_path_data, s, playlist_get_cached()); } static void rgui_get_thumbnail_system(void *userdata, char *s, size_t len) { rgui_t *rgui = (rgui_t*)userdata; const char *system = NULL; - if (!rgui) - return; - if (gfx_thumbnail_get_system(rgui->thumbnail_path_data, &system)) - strlcpy(s, system, len); + if (rgui) + if (gfx_thumbnail_get_system(rgui->thumbnail_path_data, &system)) + strlcpy(s, system, len); } static void rgui_load_current_thumbnails(rgui_t *rgui, bool download_missing) @@ -6417,7 +6386,7 @@ static void rgui_load_current_thumbnails(rgui_t *rgui, bool download_missing) if (gfx_thumbnail_get_path(rgui->thumbnail_path_data, GFX_THUMBNAIL_RIGHT, &thumbnail_path)) { - rgui->entry_has_thumbnail = request_thumbnail( + rgui->entry_has_thumbnail = rgui_request_thumbnail( rgui->show_fs_thumbnail ? &rgui->fs_thumbnail : &rgui->mini_thumbnail, GFX_THUMBNAIL_RIGHT, &rgui->thumbnail_queue_size, @@ -6433,7 +6402,7 @@ static void rgui_load_current_thumbnails(rgui_t *rgui, bool download_missing) if (gfx_thumbnail_get_path(rgui->thumbnail_path_data, GFX_THUMBNAIL_LEFT, &left_thumbnail_path)) { - rgui->entry_has_left_thumbnail = request_thumbnail( + rgui->entry_has_left_thumbnail = rgui_request_thumbnail( &rgui->mini_left_thumbnail, GFX_THUMBNAIL_LEFT, &rgui->left_thumbnail_queue_size, @@ -6467,7 +6436,7 @@ static void rgui_scan_selected_entry_thumbnail(rgui_t *rgui, bool force_load) { bool has_thumbnail = false; settings_t *settings = config_get_ptr(); - bool rgui_inline_thumbnails = settings->bools.menu_rgui_inline_thumbnails; + bool menu_rgui_inline_thumbnails = settings->bools.menu_rgui_inline_thumbnails; unsigned menu_rgui_thumbnail_delay= settings->uints.menu_rgui_thumbnail_delay; bool network_on_demand_thumbnails = settings->bools.network_on_demand_thumbnails; rgui->entry_has_thumbnail = false; @@ -6475,7 +6444,7 @@ static void rgui_scan_selected_entry_thumbnail(rgui_t *rgui, bool force_load) rgui->thumbnail_load_pending = false; /* Update thumbnail content/path */ - if ((rgui->show_fs_thumbnail || rgui_inline_thumbnails) + if ((rgui->show_fs_thumbnail || menu_rgui_inline_thumbnails) && rgui->is_playlist) { size_t selection = menu_navigation_get_selection(); @@ -6500,7 +6469,7 @@ static void rgui_scan_selected_entry_thumbnail(rgui_t *rgui, bool force_load) if (gfx_thumbnail_is_enabled(rgui->thumbnail_path_data, GFX_THUMBNAIL_RIGHT)) has_thumbnail = gfx_thumbnail_update_path(rgui->thumbnail_path_data, GFX_THUMBNAIL_RIGHT); - if (rgui_inline_thumbnails && + if (menu_rgui_inline_thumbnails && gfx_thumbnail_is_enabled(rgui->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) has_thumbnail = gfx_thumbnail_update_path(rgui->thumbnail_path_data, GFX_THUMBNAIL_LEFT) || has_thumbnail; @@ -6522,23 +6491,17 @@ static void rgui_scan_selected_entry_thumbnail(rgui_t *rgui, bool force_load) } } -static void rgui_toggle_fs_thumbnail(void *userdata) +static void rgui_toggle_fs_thumbnail(rgui_t *rgui, + bool menu_rgui_inline_thumbnails) { - rgui_t *rgui = (rgui_t*)userdata; - settings_t *settings = config_get_ptr(); - bool rgui_inline_thumbnails = settings->bools.menu_rgui_inline_thumbnails; - - if (!rgui) - return; - - rgui->show_fs_thumbnail = !rgui->show_fs_thumbnail; + rgui->show_fs_thumbnail = !rgui->show_fs_thumbnail; /* It is possible that we are waiting for a 'right' thumbnail * image to load at this point. If so, and we are displaying * inline thumbnails, then 'fs_thumbnail' and 'mini_thumbnail' * can get mixed up. To avoid this, we simply 'reset' the * currently inactive right thumbnail. */ - if (rgui_inline_thumbnails) + if (menu_rgui_inline_thumbnails) { if (rgui->show_fs_thumbnail) { @@ -6787,11 +6750,11 @@ static void rgui_populate_entries(void *data, /* Make sure that any changes made while accessing * the video settings menu are preserved */ rgui_video_settings_t current_video_settings = {{0}}; - rgui_get_video_config(¤t_video_settings); + rgui_get_video_config(¤t_video_settings, settings->uints.video_aspect_ratio_idx); if (rgui_is_video_config_equal(¤t_video_settings, &rgui->menu_video_settings)) { - rgui_set_video_config(rgui, &rgui->content_video_settings, false); + rgui_set_video_config(rgui, settings, &rgui->content_video_settings, false); /* Menu viewport has been overridden - must ignore * resize events until the menu is next toggled off */ rgui->ignore_resize_events = true; @@ -6879,10 +6842,9 @@ static int rgui_pointer_up(void *data, * - Must provide a mechanism for toggling it off * - A normal mouse press should just select the current * entry (for which the thumbnail is being shown) */ - if (y < header_height) - rgui_toggle_fs_thumbnail(rgui); - else + if (y >= header_height) return rgui_menu_entry_action(rgui, entry, selection, MENU_ACTION_SELECT); + rgui_toggle_fs_thumbnail(rgui, config_get_ptr()->bools.menu_rgui_inline_thumbnails); } else { @@ -7001,19 +6963,34 @@ static void rgui_frame(void *data, video_frame_info_t *video_info) update_dynamic_theme_path(rgui, settings->paths.directory_dynamic_wallpapers); - prepare_rgui_colors(rgui, settings); + prepare_rgui_colors(rgui, + settings->uints.menu_rgui_color_theme, + settings->paths.path_rgui_theme_preset, + settings->bools.menu_rgui_transparency, + settings->uints.menu_rgui_aspect_ratio + ); } else if (settings->uints.menu_rgui_color_theme == RGUI_THEME_CUSTOM) { if (!string_is_equal(settings->paths.path_rgui_theme_preset, rgui->theme_preset_path)) - prepare_rgui_colors(rgui, settings); + prepare_rgui_colors(rgui, + settings->uints.menu_rgui_color_theme, + settings->paths.path_rgui_theme_preset, + settings->bools.menu_rgui_transparency, + settings->uints.menu_rgui_aspect_ratio + ); } else if (settings->uints.menu_rgui_color_theme == RGUI_THEME_DYNAMIC) { if (!string_is_equal(rgui->last_theme_dynamic_path, rgui->theme_dynamic_path)) - prepare_rgui_colors(rgui, settings); + prepare_rgui_colors(rgui, + settings->uints.menu_rgui_color_theme, + settings->paths.path_rgui_theme_preset, + settings->bools.menu_rgui_transparency, + settings->uints.menu_rgui_aspect_ratio + ); } /* Note: both rgui_set_aspect_ratio() and rgui_set_video_config() @@ -7044,7 +7021,7 @@ static void rgui_frame(void *data, video_frame_info_t *video_info) rgui->menu_aspect_ratio_lock = aspect_ratio_lock; if (aspect_ratio_lock == RGUI_ASPECT_RATIO_LOCK_NONE) - rgui_set_video_config(rgui, &rgui->content_video_settings, true); + rgui_set_video_config(rgui, settings, &rgui->content_video_settings, true); else { /* As with changes in aspect ratio, if we reach this point @@ -7053,7 +7030,7 @@ static void rgui_frame(void *data, video_frame_info_t *video_info) rgui->ignore_resize_events = false; rgui_update_menu_viewport(rgui, p_disp); - rgui_set_video_config(rgui, &rgui->menu_video_settings, true); + rgui_set_video_config(rgui, settings, &rgui->menu_video_settings, true); } /* Clear any pending 'restore aspect lock' flags */ @@ -7112,7 +7089,7 @@ static void rgui_frame(void *data, video_frame_info_t *video_info) !rgui->ignore_resize_events) { rgui_update_menu_viewport(rgui, p_disp); - rgui_set_video_config(rgui, &rgui->menu_video_settings, true); + rgui_set_video_config(rgui, settings, &rgui->menu_video_settings, true); } rgui->window_width = video_width; @@ -7169,13 +7146,13 @@ static void rgui_toggle(void *userdata, bool menu_on) if (menu_on) { /* Cache content video settings */ - rgui_get_video_config(&rgui->content_video_settings); + rgui_get_video_config(&rgui->content_video_settings, settings->uints.video_aspect_ratio_idx); /* Update menu viewport */ rgui_update_menu_viewport(rgui, p_disp); /* Apply menu video settings */ - rgui_set_video_config(rgui, &rgui->menu_video_settings, false); + rgui_set_video_config(rgui, settings, &rgui->menu_video_settings, false); } else { @@ -7183,10 +7160,10 @@ static void rgui_toggle(void *userdata, bool menu_on) * has not changed video settings since menu was * last toggled on */ rgui_video_settings_t current_video_settings = {{0}}; - rgui_get_video_config(¤t_video_settings); + rgui_get_video_config(¤t_video_settings, settings->uints.video_aspect_ratio_idx); if (rgui_is_video_config_equal(¤t_video_settings, &rgui->menu_video_settings)) - rgui_set_video_config(rgui, &rgui->content_video_settings, false); + rgui_set_video_config(rgui, settings, &rgui->content_video_settings, false); /* Any modified video scaling settings have now been * registered, so it is again 'safe' to respond to window @@ -7256,8 +7233,9 @@ static enum menu_action rgui_parse_menu_entry_action( (entry->enum_idx == MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG) || (entry->enum_idx == MENU_ENUM_LABEL_SAVE_NEW_CONFIG))) { + settings_t *settings = config_get_ptr(); rgui_video_settings_t current_video_settings = {{0}}; - rgui_get_video_config(¤t_video_settings); + rgui_get_video_config(¤t_video_settings, settings->uints.video_aspect_ratio_idx); if (rgui_is_video_config_equal(¤t_video_settings, &rgui->menu_video_settings)) { @@ -7268,7 +7246,7 @@ static enum menu_action rgui_parse_menu_entry_action( * until the menu is next toggled off; this is a * one-shot 'fix' that should only be active * during the config save operation */ - rgui_set_video_config(rgui, &rgui->content_video_settings, false); + rgui_set_video_config(rgui, settings, &rgui->content_video_settings, false); /* Schedule a restoration of the aspect ratio * lock on the next frame */ rgui->restore_aspect_lock = true; @@ -7294,7 +7272,7 @@ static enum menu_action rgui_parse_menu_entry_action( * button) */ if (rgui->is_playlist) { - rgui_toggle_fs_thumbnail(rgui); + rgui_toggle_fs_thumbnail(rgui, config_get_ptr()->bools.menu_rgui_inline_thumbnails); new_action = MENU_ACTION_NOOP; } break;