/*************************************************************************** * Copyright (c) 2003-2006, Broadcom Corporation * All Rights Reserved * Confidential Property of Broadcom Corporation * * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. * * $brcm_Workfile: $ * $brcm_Revision: $ * $brcm_Date: $ * * Module Description: * * Revision History: * * $brcm_Log: $ * ***************************************************************************/ #include "bapp.h" #include "bstd.h" #include "bapp_util.h" #include "bgfx.h" #include "chan_mgr.h" #include "bsmart.h" BDBG_MODULE(bscreen); /* Register software module with debug interface */ //#define TEST_RRT /* local function declarations */ void screen_null_draw(void *v_app, void *v_screen); void banner_null_draw(void *v_app, void *v_screen); void popup_null_draw(void *v_app, void *v_screen); void bscreen_popup_draw(void *v_app, void *v_screen, btext_id_t title, btext_id_t desc); static void adjust_button_orientation(void *v_app, bbutton_t *p_button); #define SCREEN_MIN(a,b) ((a)<(b) ? (a) : (b)) /* min macro */ screensaver_state_t g_screensaver_state = { 0 }; banner_state_t g_banner_state = { { 0, 0, 0}, { 0, 0, 0}, 0, 0, false, false, eLS_BANNER_OFF, { eS_EVENT_MAX, 0, 0}, 0, 0, 0, 0, 0, 0 }; /* Summary: screen button arrays. */ bbutton_t g_buttons_main[] = { {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 0 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_GUIDE_BUTTON,eTEXT_GUIDE_INFO,eSCREEN_GUIDE, eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 1 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_AV_BUTTON,eTEXT_AV_INFO,eSCREEN_AV, eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 2 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RATINGS_BUTTON,eTEXT_RATINGS_INFO,eSCREEN_PIN_VERIFY_RATINGS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #ifdef CONFIG_EIA_708 {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 3 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_BUTTON,eTEXT_CAPTIONS_INFO,eSCREEN_CAPTIONS_ADVANCED,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 4 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SETUP_BUTTON,eTEXT_SETUP_INFO,eSCREEN_SETUP,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #else {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 3 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SETUP_BUTTON,eTEXT_SETUP_INFO,eSCREEN_SETUP,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 4 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RESET_BUTTON,eTEXT_RESET_INFO,eSCREEN_PIN_VERIFY_RESET,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #endif }; bbutton_t g_buttons_picture[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_PICTURES_FIRST_BUTTON_X,eMENU_PICTURES_FIRST_BUTTON_Y,eMENU_PICTURES_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_WIDESCREEN_BUTTON,eTEXT_WIDESCREEN_INFO,eSCREEN_AV,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_PICTURES_FIRST_BUTTON_X,eMENU_PICTURES_FIRST_BUTTON_Y + eMENU_PICTURES_BUTTON_INC_Y,eMENU_PICTURES_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_FULLSCREEN_BUTTON,eTEXT_FULLSCREEN_INFO,eSCREEN_AV,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_timezone[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_AUTO_BUTTON,eTEXT_TIMEZONE_AUTO_BUTTON_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 1 * eMENU_TIMEZONE_BUTTON_INC_Y,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_EAST_BUTTON,eTEXT_TIMEZONE_EAST_BUTTON_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 2 * eMENU_TIMEZONE_BUTTON_INC_Y-6,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_CENTRAL_BUTTON,eTEXT_TIMEZONE_CENTRAL_BUTTON_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 3 * eMENU_TIMEZONE_BUTTON_INC_Y-6,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_MOUNTAIN_BUTTON,eTEXT_TIMEZONE_MOUNTAIN_BUTTON_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 4 * eMENU_TIMEZONE_BUTTON_INC_Y-6,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_PACIFIC_BUTTON,eTEXT_TIMEZONE_PACIFIC_BUTTON_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 5 * eMENU_TIMEZONE_BUTTON_INC_Y-6,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_DST_BUTTON,eTEXT_TIMEZONE_DST_BUTTON_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_sound[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_SOUND_FIRST_BUTTON_X,eMENU_SOUND_FIRST_BUTTON_Y,eMENU_SOUND_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_STEREO_BUTTON,eTEXT_STEREO_INFO ,eSCREEN_AV,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_SOUND_FIRST_BUTTON_X,eMENU_SOUND_FIRST_BUTTON_Y + 1 * eMENU_SOUND_BUTTON_INC_Y,eMENU_SOUND_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SAP_BUTTON,eTEXT_SAP_INFO,eSCREEN_AV,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_av[] = { {eBUTTON_MENU,eMENU_AV_FIRST_BUTTON_X,eMENU_AV_FIRST_BUTTON_Y,eMENU_AV_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_PICTURE_BUTTON,eTEXT_PICTURE_INFO ,eSCREEN_PICTURE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_AV_FIRST_BUTTON_X,eMENU_AV_FIRST_BUTTON_Y + eMENU_AV_BUTTON_INC_Y,eMENU_AV_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SOUND_BUTTON,eTEXT_SOUND_INFO,eSCREEN_SOUND,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_language[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_ENGLISH_BUTTON,eTEXT_ENGLISH_INFO ,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y + eMENU_LANGUAGE_BUTTON_INC_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SPANISH_BUTTON,eTEXT_SPANISH_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y + 2 * eMENU_LANGUAGE_BUTTON_INC_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_FRENCH_BUTTON,eTEXT_FRENCH_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_advanced[] = { {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,(eMENU_CAPTIONS_FIRST_BUTTON_Y),eMENU_CAPTIONS_ADVANCED_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_OPTIONS_BUTTON,eTEXT_CAPTIONS_FONT_OPTIONS_INFO,eSCREEN_CAPTIONS_FONT_OPTIONS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,(eMENU_CAPTIONS_FIRST_BUTTON_Y + 12) + eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_ADVANCED_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_BACK_OPTIONS_BUTTON,eTEXT_CAPTIONS_BACK_OPTIONS_INFO,eSCREEN_CAPTIONS_BACK_OPTIONS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,(eMENU_CAPTIONS_FIRST_BUTTON_Y + 12) + 2 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_ADVANCED_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_DEFAULT_BUTTON,eTEXT_CAPTIONS_DEFAULT_INFO,eSCREEN_CAPTIONS_RESET,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_font_options[] = { {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_OPTIONS_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_BUTTON,eTEXT_CAPTIONS_FONT_INFO,eSCREEN_CAPTIONS_FONT,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_OPTIONS_FIRST_BUTTON_Y + eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_SIZE_BUTTON,eTEXT_CAPTIONS_FONT_SIZE_INFO,eSCREEN_CAPTIONS_FONT_SIZE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_OPTIONS_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_STYLE_BUTTON,eTEXT_CAPTIONS_FONT_STYLE_INFO,eSCREEN_CAPTIONS_FONT_STYLE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_OPTIONS_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_COLOR_BUTTON,eTEXT_CAPTIONS_FONT_COLOR_INFO,eSCREEN_CAPTIONS_FONT_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_OPTIONS_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_OPACITY_BUTTON,eTEXT_CAPTIONS_FONT_OPACITY_INFO,eSCREEN_CAPTIONS_FONT_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_back_options[] = { {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_BACK_OPTIONS_FIRST_BUTTON_Y,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_EDGE_COLOR_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_INFO,eSCREEN_CAPTIONS_EDGE_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_BACK_OPTIONS_FIRST_BUTTON_Y + eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_EDGE_TYPE_BUTTON,eTEXT_CAPTIONS_EDGE_TYPE_INFO,eSCREEN_CAPTIONS_EDGE_TYPE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_BACK_OPTIONS_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_BACKGROUND_COLOR_BUTTON,eTEXT_CAPTIONS_BACKGROUND_COLOR_INFO,eSCREEN_CAPTIONS_BACK_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_BACK_OPTIONS_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_BACKGROUND_OPACITY_BUTTON,eTEXT_CAPTIONS_BACKGROUND_OPACITY_INFO,eSCREEN_CAPTIONS_BACK_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_font[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_FONT_DEFAULT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_MONO_SERIF_BUTTON,eTEXT_CAPTIONS_FONT_MONO_SERIF_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_PROP_SERIF_BUTTON,eTEXT_CAPTIONS_FONT_PROP_SERIF_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_MONOSPACE_BUTTON,eTEXT_CAPTIONS_FONT_MONOSPACE_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_PROPORTIONAL_BUTTON,eTEXT_CAPTIONS_FONT_PROPORTIONAL_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 5 * eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_CASUAL_BUTTON,eTEXT_CAPTIONS_FONT_CASUAL_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 6 * eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_CURSIVE_BUTTON,eTEXT_CAPTIONS_FONT_CURSIVE_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 7 * eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_SMALL_CAPS_BUTTON,eTEXT_CAPTIONS_FONT_SMALL_CAPS_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_font_size[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_SIZE_BUTTON_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_FONT_DEFAULT_SIZE_INFO ,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_SIZE_BUTTON_Y + 1 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_SMALL_BUTTON,eTEXT_CAPTIONS_FONT_SMALL_INFO ,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_SIZE_BUTTON_Y + 2 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_STANDARD_BUTTON,eTEXT_CAPTIONS_FONT_STANDARD_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_SIZE_BUTTON_Y + 3 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_LARGE_BUTTON,eTEXT_CAPTIONS_FONT_LARGE_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_font_style[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_STYLE_BUTTON_Y + 0 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_NORMAL_BUTTON,eTEXT_CAPTIONS_FONT_NORMAL_INFO ,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_STYLE_BUTTON_Y + 1 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_ITALIC_BUTTON,eTEXT_CAPTIONS_FONT_ITALIC_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_STYLE_BUTTON_Y + 2 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_UNDERLINE_BUTTON,eTEXT_CAPTIONS_FONT_UNDERLINE_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_font_color[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_COLOR_DEFAULT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_WHITE_BUTTON,eTEXT_CAPTIONS_COLOR_WHITE_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_BLACK_BUTTON,eTEXT_CAPTIONS_COLOR_BLACK_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_RED_BUTTON,eTEXT_CAPTIONS_COLOR_RED_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_GREEN_BUTTON,eTEXT_CAPTIONS_COLOR_GREEN_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 5 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_BLUE_BUTTON,eTEXT_CAPTIONS_COLOR_BLUE_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 6 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_YELLOW_BUTTON,eTEXT_CAPTIONS_COLOR_YELLOW_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 7 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_MAGENTA_BUTTON,eTEXT_CAPTIONS_COLOR_MAGENTA_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 8 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_CYAN_BUTTON,eTEXT_CAPTIONS_COLOR_CYAN_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_edge_color[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_DEFAULT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_WHITE_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_WHITE_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_BLACK_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_BLACK_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_RED_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_RED_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_GREEN_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_GREEN_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 5 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_BLUE_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_BLUE_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 6 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_YELLOW_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_YELLOW_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 7 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_MAGENTA_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_MAGENTA_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 8 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_CYAN_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_CYAN_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_color[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_DEFAULT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_WHITE_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_WHITE_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_BLACK_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_BLACK_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_RED_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_RED_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_GREEN_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_GREEN_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 5 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_BLUE_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_BLUE_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 6 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_YELLOW_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_YELLOW_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 7 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_MAGENTA_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_MAGENTA_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 8 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_CYAN_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_CYAN_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_font_opacity[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_FONT_OPACITY_DEFAULT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_TRANSPARENT_BUTTON,eTEXT_CAPTIONS_FONT_TRANSPARENT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_TRANSLUCENT_BUTTON,eTEXT_CAPTIONS_FONT_TRANSLUCENT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_SOLID_BUTTON,eTEXT_CAPTIONS_FONT_SOLID_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FLASHING_BUTTON,eTEXT_CAPTIONS_FONT_FLASHING_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_back_opacity[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_FONT_OPACITY_DEFAULT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_TRANSPARENT_BUTTON,eTEXT_CAPTIONS_BACK_TRANSPARENT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_TRANSLUCENT_BUTTON,eTEXT_CAPTIONS_BACK_TRANSLUCENT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_SOLID_BUTTON,eTEXT_CAPTIONS_BACK_SOLID_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FLASHING_BUTTON,eTEXT_CAPTIONS_BACK_FLASHING_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_edge_type[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_EDGE_TYPE_FIRST_BUTTON_Y,eMENU_CAPTIONS_EDGE_TYPE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_EDGE_TYPE_DEFAULT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_EDGE_TYPE_FIRST_BUTTON_Y + eMENU_CAPTIONS_EDGE_TYPE_BUTTON_INC_Y,eMENU_CAPTIONS_EDGE_TYPE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_RAISED_BUTTON,eTEXT_CAPTIONS_RAISED_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_EDGE_TYPE_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_EDGE_TYPE_BUTTON_INC_Y,eMENU_CAPTIONS_EDGE_TYPE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_DEPRESSED_BUTTON,eTEXT_CAPTIONS_DEPRESSED_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_EDGE_TYPE_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_EDGE_TYPE_BUTTON_INC_Y,eMENU_CAPTIONS_EDGE_TYPE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_UNIFORM_BUTTON,eTEXT_CAPTIONS_UNIFORM_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_EDGE_TYPE_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_EDGE_TYPE_BUTTON_INC_Y,eMENU_CAPTIONS_EDGE_TYPE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_SHADOW_LEFT_BUTTON,eTEXT_CAPTIONS_SHADOW_LEFT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_EDGE_TYPE_FIRST_BUTTON_Y + 5 * eMENU_CAPTIONS_EDGE_TYPE_BUTTON_INC_Y,eMENU_CAPTIONS_EDGE_TYPE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_SHADOW_RIGHT_BUTTON,eTEXT_CAPTIONS_SHADOW_RIGHT_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_reset[] = { {eBUTTON_MENU,eMENU_RESET_FIRST_BUTTON_X,eMENU_CAPTIONS_RESET_FIRST_BUTTON_Y,eMENU_RESET_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO ,eSCREEN_SETUP,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RESET_FIRST_BUTTON_X,eMENU_CAPTIONS_RESET_FIRST_BUTTON_Y + eMENU_RESET_BUTTON_INC_Y,eMENU_RESET_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RESET_CONFIRM_BUTTON,eTEXT_RESET_CAPTIONS_CONFIRM_INFO,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_setup[] = { {eBUTTON_MENU,eMENU_SETUP_FIRST_BUTTON_X,eMENU_SETUP_FIRST_BUTTON_Y,eMENU_SETUP_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CH_SCAN_BUTTON,eTEXT_CH_SCAN_INFO ,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_SETUP_FIRST_BUTTON_X,eMENU_SETUP_FIRST_BUTTON_Y + eMENU_SETUP_BUTTON_INC_Y,eMENU_SETUP_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_LANGUAGE_BUTTON,eTEXT_LANGUAGE_INFO,eSCREEN_LANGUAGE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_SETUP_FIRST_BUTTON_X,eMENU_SETUP_FIRST_BUTTON_Y + 2 * eMENU_SETUP_BUTTON_INC_Y,eMENU_SETUP_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_AUTO_POWER_BUTTON,eTEXT_AUTO_POWER_INFO,eSCREEN_AUTO_POWER,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_SETUP_FIRST_BUTTON_X,eMENU_SETUP_FIRST_BUTTON_Y + 3 * eMENU_SETUP_BUTTON_INC_Y,eMENU_SETUP_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_ANTENNA_BUTTON,eTEXT_ANTENNA_INFO,eSCREEN_ANTENNA,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_SETUP_FIRST_BUTTON_X,eMENU_SETUP_FIRST_BUTTON_Y + 4 * eMENU_SETUP_BUTTON_INC_Y,eMENU_SETUP_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SETTINGS_TIMEZONE_BUTTON,eTEXT_SETTINGS_TIMEZONE_INFO,eSCREEN_TIMEZONE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #ifdef CONFIG_EIA_708 {eBUTTON_MENU,eMENU_SETUP_FIRST_BUTTON_X,eMENU_SETUP_FIRST_BUTTON_Y + 5 * eMENU_SETUP_BUTTON_INC_Y,eMENU_SETUP_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RESET_BUTTON,eTEXT_RESET_INFO,eSCREEN_PIN_VERIFY_RESET,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #endif }; bbutton_t g_buttons_ch_scan[] = { {eBUTTON_MENU,eMENU_CH_SCAN_FIRST_BUTTON_X,eMENU_CH_SCAN_FIRST_BUTTON_Y,eMENU_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_BEGIN_BUTTON,eTEXT_BEGIN_SCAN_INFO ,eSCREEN_CH_SCAN_PROGRESS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK,eMENU_CH_SCAN_FIRST_BUTTON_X,eMENU_CH_SCAN_FIRST_BUTTON_Y + eMENU_SMART_CH_SCAN_BUTTON_INC_Y,eMENU_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SCAN_ADD_BUTTON,eTEXT_SCAN_ADD_INFO ,eSCREEN_CH_SCAN_PROGRESS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_smart_ch_scan[] = { {eBUTTON_MENU,eMENU_SMART_CH_SCAN_FIRST_BUTTON_X,eMENU_SMART_CH_SCAN_FIRST_BUTTON_Y,eMENU_SMART_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_QUICK_SCAN_BUTTON,eTEXT_QUICK_SCAN_INFO ,eSCREEN_CH_SCAN_PROGRESS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_SMART_CH_SCAN_FIRST_BUTTON_X,eMENU_SMART_CH_SCAN_FIRST_BUTTON_Y + eMENU_SMART_CH_SCAN_BUTTON_INC_Y,eMENU_SMART_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_FULL_SCAN_BUTTON,eTEXT_FULL_SCAN_INFO,eSCREEN_CH_SCAN_PROGRESS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK,eMENU_SMART_CH_SCAN_FIRST_BUTTON_X,eMENU_SMART_CH_SCAN_FIRST_BUTTON_Y + 2 * eMENU_SMART_CH_SCAN_BUTTON_INC_Y,eMENU_SMART_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SCAN_ADD_BUTTON,eTEXT_SCAN_ADD_INFO ,eSCREEN_CH_SCAN_PROGRESS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_reset[] = { {eBUTTON_MENU,eMENU_RESET_FIRST_BUTTON_X,eMENU_RESET_FIRST_BUTTON_Y,eMENU_RESET_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO ,eSCREEN_SETUP,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RESET_FIRST_BUTTON_X,eMENU_RESET_FIRST_BUTTON_Y + eMENU_RESET_BUTTON_INC_Y,eMENU_RESET_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RESET_CONFIRM_BUTTON,eTEXT_RESET_CONFIRM_INFO,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wiz_welcome[] = { {eBUTTON_MENU,eMENU_WIZ_WELCOME_FIRST_BUTTON_X,eMENU_WIZ_WELCOME_FIRST_BUTTON_Y,eMENU_WIZ_WELCOME_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_BEGIN_BUTTON,eTEXT_BEGIN_INFO ,eSCREEN_WIZ_LANGUAGE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wiz_language[] = { {eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_ENGLISH_BUTTON,eTEXT_ENGLISH_INFO ,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y + eMENU_LANGUAGE_BUTTON_INC_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SPANISH_BUTTON,eTEXT_SPANISH_INFO,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y + 2 * eMENU_LANGUAGE_BUTTON_INC_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_FRENCH_BUTTON,eTEXT_FRENCH_INFO,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wiz_ch_scan[] = { {eBUTTON_MENU,eMENU_WIZ_CH_SCAN_FIRST_BUTTON_X,eMENU_WIZ_CH_SCAN_FIRST_BUTTON_Y,eMENU_WIZ_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_BEGIN_BUTTON,eTEXT_BEGIN_SCAN_INFO ,eSCREEN_CH_SCAN_PROGRESS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_WIZ_CH_SCAN_FIRST_BUTTON_X,eMENU_WIZ_CH_SCAN_FIRST_BUTTON_Y + eMENU_WIZ_CH_SCAN_BUTTON_INC_Y,eMENU_WIZ_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_DONE_BUTTON,eTEXT_DONE_INFO,eSCREEN_GUIDE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wiz_smart_ch_scan[] = { {eBUTTON_MENU,eMENU_WIZ_SMART_CH_SCAN_FIRST_BUTTON_X,eMENU_WIZ_SMART_CH_SCAN_FIRST_BUTTON_Y,eMENU_WIZ_SMART_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_QUICK_SCAN_BUTTON,eTEXT_QUICK_SCAN_INFO ,eSCREEN_CH_SCAN_PROGRESS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_WIZ_SMART_CH_SCAN_FIRST_BUTTON_X,eMENU_WIZ_SMART_CH_SCAN_FIRST_BUTTON_Y + eMENU_WIZ_SMART_CH_SCAN_BUTTON_INC_Y,eMENU_WIZ_SMART_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_FULL_SCAN_BUTTON,eTEXT_FULL_SCAN_INFO,eSCREEN_CH_SCAN_PROGRESS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_WIZ_SMART_CH_SCAN_FIRST_BUTTON_X,eMENU_WIZ_SMART_CH_SCAN_FIRST_BUTTON_Y + 2 * eMENU_WIZ_SMART_CH_SCAN_BUTTON_INC_Y,eMENU_WIZ_SMART_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_DONE_BUTTON,eTEXT_DONE_INFO,eSCREEN_GUIDE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_auto_power[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_AUTO_POWER_FIRST_BUTTON_X,eMENU_AUTO_POWER_FIRST_BUTTON_Y,eMENU_AUTO_POWER_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_AUTO_POWER_ON_BUTTON_4H,eTEXT_AUTO_POWER_ON_INFO_4H ,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_AUTO_POWER_FIRST_BUTTON_X,eMENU_AUTO_POWER_FIRST_BUTTON_Y + eMENU_AUTO_POWER_BUTTON_INC_Y,eMENU_AUTO_POWER_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_AUTO_POWER_ON_BUTTON_8H,eTEXT_AUTO_POWER_ON_INFO_8H,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_AUTO_POWER_FIRST_BUTTON_X,eMENU_AUTO_POWER_FIRST_BUTTON_Y + 2 * eMENU_AUTO_POWER_BUTTON_INC_Y,eMENU_AUTO_POWER_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_AUTO_POWER_ON_BUTTON_12H,eTEXT_AUTO_POWER_ON_INFO_12H,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_AUTO_POWER_FIRST_BUTTON_X,eMENU_AUTO_POWER_FIRST_BUTTON_Y + 3 * eMENU_AUTO_POWER_BUTTON_INC_Y,eMENU_AUTO_POWER_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_OFF_BUTTON,eTEXT_AUTO_POWER_OFF_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wiz_mismatched_pins[] = { {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y,eMENU_RETRY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RETRY_BUTTON,eTEXT_RETRY_INFO,eSCREEN_WIZ_PIN_NEW,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wiz_done[] = { {eBUTTON_MENU,eMENU_WIZ_DONE_FIRST_BUTTON_X,eMENU_WIZ_DONE_FIRST_BUTTON_Y,eMENU_WIZ_DONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_FINISH_BUTTON,eTEXT_FINISH_INFO ,eSCREEN_NULL,eSCREEN_NULL, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_ratings[] = { {eBUTTON_MENU,eMENU_RATINGS_FIRST_BUTTON_X,eMENU_RATINGS_FIRST_BUTTON_Y,eMENU_RATINGS_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_LOCK_UNLOCK_BUTTON,eTEXT_LOCK_UNLOCK_INFO ,eSCREEN_RATINGS_LOCK,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_FIRST_BUTTON_X,eMENU_RATINGS_FIRST_BUTTON_Y + eMENU_RATINGS_BUTTON_INC_Y,eMENU_RATINGS_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_LIMITS_BUTTON,eTEXT_LIMITS_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_FIRST_BUTTON_X,eMENU_RATINGS_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_BUTTON_INC_Y,eMENU_RATINGS_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CHANGE_PIN_BUTTON,eTEXT_CHANGE_PIN_INFO,eSCREEN_PIN_NEW,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_ratings_lock[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_RATINGS_LOCK_FIRST_BUTTON_X,eMENU_RATINGS_LOCK_FIRST_BUTTON_Y + 0 * eMENU_RATINGS_LOCK_BUTTON_INC_Y,eMENU_RATINGS_LOCK_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_OFF_BUTTON,eTEXT_OFF_INFO,eSCREEN_RATINGS,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_RATINGS_LOCK_FIRST_BUTTON_X,eMENU_RATINGS_LOCK_FIRST_BUTTON_Y + 1 * eMENU_RATINGS_LOCK_BUTTON_INC_Y,eMENU_RATINGS_LOCK_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_ON_BUTTON,eTEXT_ON_INFO,eSCREEN_RATINGS,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_RATINGS_LOCK_FIRST_BUTTON_X,eMENU_RATINGS_LOCK_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_LOCK_BUTTON_INC_Y,eMENU_RATINGS_LOCK_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_ON_RRT_BUTTON,eTEXT_ON_RRT_INFO,eSCREEN_RATINGS,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_ratings_limits[] = { {eBUTTON_MENU,eMENU_RATINGS_LIMITS_FIRST_BUTTON_X,eMENU_RATINGS_LIMITS_FIRST_BUTTON_Y,eMENU_RATINGS_LIMITS_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TV_SHOWS_BUTTON,eTEXT_TV_SHOWS_INFO ,eSCREEN_RATINGS_TV,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_LIMITS_FIRST_BUTTON_X,eMENU_RATINGS_LIMITS_FIRST_BUTTON_Y + eMENU_RATINGS_LIMITS_BUTTON_INC_Y,eMENU_RATINGS_LIMITS_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_MOVIES_BUTTON,eTEXT_MOVIES_INFO,eSCREEN_RATINGS_MOVIES,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_LIMITS_FIRST_BUTTON_X,eMENU_RATINGS_LIMITS_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_LIMITS_BUTTON_INC_Y,eMENU_RATINGS_LIMITS_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RRT_DIM_BUTTON,eTEXT_RRT_DIM_INFO,eSCREEN_RATINGS_RRT_DIM,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_ratings_tv[] = { {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_FIRST_BUTTON_X, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 0 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_GRID_BUTTON_WIDTH, eBUTTON_HEIGHT_RATINGS,eTEXT_TV_Y_BUTTON,eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_FIRST_BUTTON_X ,eMENU_RATINGS_TV_FIRST_BUTTON_Y + 1 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_GRID_BUTTON_WIDTH, eBUTTON_HEIGHT_RATINGS,eTEXT_TV_Y7_BUTTON,eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 5 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 1 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_FV_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_FIRST_BUTTON_X ,eMENU_RATINGS_TV_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_GRID_BUTTON_WIDTH, eBUTTON_HEIGHT_RATINGS,eTEXT_TV_G_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_FIRST_BUTTON_X ,eMENU_RATINGS_TV_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_GRID_BUTTON_WIDTH, eBUTTON_HEIGHT_RATINGS,eTEXT_TV_PG_BUTTON,eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 1 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_D_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 2 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_L_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 3 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_S_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 4 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_V_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_FIRST_BUTTON_X ,eMENU_RATINGS_TV_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_GRID_BUTTON_WIDTH, eBUTTON_HEIGHT_RATINGS,eTEXT_TV_14_BUTTON,eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 1 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_D_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 2 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_L_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 3 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_S_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 4 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_V_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_FIRST_BUTTON_X ,eMENU_RATINGS_TV_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_GRID_BUTTON_WIDTH, eBUTTON_HEIGHT_RATINGS,eTEXT_TV_MA_BUTTON,eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 2 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_L_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 3 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_S_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 4 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_V_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_ratings_movies[] = { {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_G_BUTTON,eTEXT_G_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y + eMENU_RATINGS_MOVIES_BUTTON_INC_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_PG_BUTTON,eTEXT_PG_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_MOVIES_BUTTON_INC_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_PG_13_BUTTON,eTEXT_PG_13_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_MOVIES_BUTTON_INC_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_R_BUTTON,eTEXT_R_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_MOVIES_BUTTON_INC_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_NC_17_BUTTON,eTEXT_NC_17_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_MOVIES_BUTTON_INC_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_X_BUTTON,eTEXT_X_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y + 6 * eMENU_RATINGS_MOVIES_BUTTON_INC_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_NOT_RATED_BUTTON,eTEXT_NOT_RATED_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, }; /* this button array changes dynamically based on received RRT dimension data */ bbutton_t g_buttons_ratings_rrt_dim[] = { {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 1 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 6 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 7 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 8 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; /* this button array changes dynamically based on received RRT value data */ bbutton_t g_buttons_ratings_rrt_val[] = { {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 1 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 6 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 7 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 8 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_ratings_rrt_update[] = { {eBUTTON_MENU,eMENU_RATINGS_RRT_UPDATE_FIRST_BUTTON_X,eMENU_RATINGS_RRT_UPDATE_FIRST_BUTTON_Y,eMENU_RATINGS_RRT_UPDATE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_LIMITS_BUTTON,eTEXT_LIMITS_INFO,eSCREEN_PIN_VERIFY_RATINGS,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_UPDATE_FIRST_BUTTON_X,eMENU_RATINGS_RRT_UPDATE_FIRST_BUTTON_Y + eMENU_RATINGS_RRT_UPDATE_BUTTON_INC_Y,eMENU_RATINGS_RRT_UPDATE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wrong_pin_live[] = { {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y,eMENU_WRONG_PIN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RETRY_BUTTON,eTEXT_RETRY_INFO ,eSCREEN_PIN_VERIFY_LIVE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wrong_pin_ratings[] = { {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y,eMENU_WRONG_PIN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO ,eSCREEN_MAIN,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y + eMENU_WRONG_PIN_BUTTON_INC_Y,eMENU_RETRY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RETRY_BUTTON,eTEXT_RETRY_INFO,eSCREEN_PIN_VERIFY_RATINGS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wrong_pin_reset[] = { {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y,eMENU_WRONG_PIN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO ,eSCREEN_MAIN,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y + eMENU_WRONG_PIN_BUTTON_INC_Y,eMENU_RETRY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RETRY_BUTTON,eTEXT_RETRY_INFO,eSCREEN_PIN_VERIFY_RESET,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_mismatched_pins[] = { {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y,eMENU_WRONG_PIN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO ,eSCREEN_RATINGS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y + eMENU_WRONG_PIN_BUTTON_INC_Y,eMENU_RETRY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RETRY_BUTTON,eTEXT_RETRY_INFO,eSCREEN_PIN_NEW,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; /* Summary: show/hide banner Description: if mode is eLS_BANNER_MAX then the last banner mode used when it lasted timed out is displayed returns 1 if banner mode changed, 0 otherwise */ static int set_banner(bscreen_t *p_screen, banner_mode_t mode, bool save_last_mode) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; static banner_mode_t last_mode = eLS_BANNER_SMALL; if ((save_last_mode) && ((p_bs->mode == eLS_BANNER_SMALL) || (p_bs->mode == eLS_BANNER_BIG))) last_mode = p_bs->mode; if (mode == eLS_BANNER_MAX) mode = last_mode; if (mode == p_bs->mode) return 0; p_bs->mode = mode; return 1; } /* Summary: copy string and remove spaces. . */ void strncpy_no_spaces(char* dst_str, char* src_str,int len) { int idx = 0; int dst_idx = 0; while (src_str[idx] && (idx < len)) { if (src_str[idx] != ' ') { dst_str[dst_idx++] = src_str[idx]; } idx++; } dst_str[dst_idx] = 0; } /* Summary: If a button is selected set the next screen_id. Description: If a button is selected set the next screen_id. Return non- zero on sucess and 0 when no selection exists */ static int select_button( void *v_app, /* Opaque app reference */ void *v_screen /* Opaque screen reference */ ) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int retval = 1; if (p_screen->p_button_array[p_screen->button_selection].type & eBUTTON_RADIO) { if (p_screen->button_checked == p_screen->button_selection) retval = 0; else { int prev_checked; const bbutton_t *p_button; prev_checked = p_screen->button_checked; p_screen->button_checked = p_screen->button_selection; p_button = &(p_screen->p_button_array[prev_checked]); bapp_sync(p_app); bscreen_draw_button(p_app,p_button, 0,0,prev_checked); p_button = &(p_screen->p_button_array[p_screen->button_checked]); bscreen_draw_button(p_app,p_button, 1,1,p_screen->button_checked); bapp_flush_screen(p_app); if (p_screen->p_button_array[p_screen->button_selection].type & eBUTTON_MENU) bapp_sleep(250); /* slight delay so user can see radio/check box change displayed */ retval = 1; } } else if (p_screen->p_button_array[p_screen->button_selection].type & eBUTTON_CHECK) { bscreen_event_t event; const bbutton_t *p_button; int checked = 0; event.id = p_screen->button_selection; event.type = eS_EVENT_CHECKED; checked = p_screen->handle_event(p_app,p_screen,&event); p_screen->button_checked = p_screen->button_selection; p_button = &(p_screen->p_button_array[p_screen->button_checked]); /* any time we draw we need to sync first */ bapp_sync(p_app); bscreen_draw_button(p_app,p_button, 1,checked,p_screen->button_checked); bapp_flush_screen(p_app); if (p_screen->p_button_array[p_screen->button_selection].type & eBUTTON_MENU) bapp_sleep(250); /* slight delay so user can see radio/check box change displayed */ retval = 1; } if (p_screen->p_button_array[p_screen->button_selection].type & eBUTTON_MENU) { bapp_set_current_screen(p_app, p_screen->p_button_array[p_screen->button_selection].next_screen_id, p_screen->p_button_array[p_screen->button_selection].next_screen_back_id); retval = 1; } return retval; } /* Summary: Move highlight from one button to another Description: Unfocus the current button and focus the next one. Return non- zero on sucess and 0 when no focus exists */ static int focus_button( void *v_app, /* Opaque app reference */ void *v_screen, /* Opaque screen reference */ int button_idx /* Index into g_buttons_XXX[] to set focus to */ ) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int prev_button = p_screen->button_selection; int checked; bscreen_event_t event; const bbutton_t *p_button; p_screen->button_selection = button_idx; if (prev_button != p_screen->button_selection) { event.id = prev_button; event.type = eS_EVENT_CHECKED; bapp_sync(p_app); checked = p_screen->handle_event(p_app,p_screen,&event); p_button = &(p_screen->p_button_array[prev_button]); bscreen_draw_button(p_app,p_button, 0,checked,prev_button); event.id = p_screen->button_selection; event.type = eS_EVENT_CHECKED; checked = p_screen->handle_event(p_app,p_screen,&event); p_button = &(p_screen->p_button_array[p_screen->button_selection]); bscreen_draw_button(p_app,p_button, 1,checked,p_screen->button_selection); bapp_flush_screen(p_app); return 0; } return 1; } /* Summary: Unselect the current button and select the next one. Description: Unselect the current button and select the next one. Return non- zero on sucess and 0 when no selection exists */ static int next_button( void *v_app, /* Opaque app reference */ void *v_screen, /* Opaque screen reference */ int dir /* 0 - down, 1 - up */ ) { bscreen_t *p_screen = (bscreen_t*)v_screen; int next_button = p_screen->button_selection; if (dir) { if (p_screen->button_selection == 0) next_button = p_screen->num_buttons - 1; else next_button--; } else { if (p_screen->button_selection == (p_screen->num_buttons - 1)) next_button = 0; else next_button++; } return focus_button(v_app,v_screen,next_button); } /* Summary: Use the this function to get a UNI string. */ void bscreen_get_string( bapp_lang_t e_lang, /* Language enum */ btext_id_t e_text_id, /* Text enum */ unsigned int *p_uni_str, /* Buffer to put UNI string into */ unsigned int *str_len /* On input the max length in words on output the actual size in characters. */ ) { char *p_str; if ((e_text_id >= eTEXT_MAX) || (e_lang >= eLANG_MAX)) { *str_len = 0; return; } p_str = (char*)g_p_dsp->ui_comp.str_table[e_lang][e_text_id]; // p_str = (char*)s_str_table[e_lang][e_text_id]; /*BDBG_MSG(("get text id: %d - %s\n", e_text_id, p_str));*/ *str_len = c_to_uni_str(p_str,p_uni_str,*str_len); } /* Summary: Draw the screen background. Description: Draw the screen background. */ void bscreen_draw_background(void *v_app, bgfx_surf_t *p_surf, uint16_t title_area_height) { bapp_t *p_app = (bapp_t*)v_app; int i = 0; int offset = 4; /* adjust title_area_height based on language choice */ if (p_app->lang == eLANG_SPANISH) { switch (p_app->screen_id) { case eSCREEN_PIN_VERIFY_LIVE: case eSCREEN_PIN_VERIFY_RATINGS: case eSCREEN_PIN_VERIFY_RESET: case eSCREEN_MISMATCHED_PINS: case eSCREEN_RATINGS_LOCK: case eSCREEN_RATINGS_LIMITS: case eSCREEN_RATINGS_TV: case eSCREEN_RATINGS_RRT_DIM: case eSCREEN_RATINGS_RRT_UPDATE: case eSCREEN_ANTENNA: case eSCREEN_AUTO_POWER: case eSCREEN_WIZ_PIN_NEW: case eSCREEN_WIZ_MISMATCHED_PINS: case eSCREEN_CH_SCAN: case eSCREEN_WIZ_CH_SCAN: case eSCREEN_SMART_CH_SCAN: case eSCREEN_WIZ_SMART_CH_SCAN: case eSCREEN_CAPTIONS_RESET: case eSCREEN_CAPTIONS_FONT_STYLE: case eSCREEN_CAPTIONS_FONT_SIZE: title_area_height += (eMENU_TITLE_AREA_HEIGHT_1_LINE - eMENU_TITLE_AREA_HEIGHT_0_LINE); break; default: break; } } else if (p_app->lang == eLANG_FRENCH) { switch (p_app->screen_id) { case eSCREEN_PICTURE: case eSCREEN_PIN_VERIFY_LIVE: case eSCREEN_PIN_VERIFY_RATINGS: case eSCREEN_PIN_VERIFY_RESET: case eSCREEN_MISMATCHED_PINS: case eSCREEN_RATINGS_LIMITS: case eSCREEN_RATINGS_TV: case eSCREEN_RATINGS_MOVIES: case eSCREEN_RATINGS_RRT_DIM: case eSCREEN_RATINGS_RRT_VAL: case eSCREEN_AUTO_POWER: case eSCREEN_ANTENNA: case eSCREEN_WIZ_MISMATCHED_PINS: case eSCREEN_SMART_CH_SCAN: case eSCREEN_WIZ_SMART_CH_SCAN: case eSCREEN_CAPTIONS_FONT_STYLE: case eSCREEN_CAPTIONS_BACK_OPTIONS: case eSCREEN_CAPTIONS_FONT_OPTIONS: case eSCREEN_CAPTIONS_FONT_SIZE: case eSCREEN_CAPTIONS_RESET: title_area_height += (eMENU_TITLE_AREA_HEIGHT_1_LINE - eMENU_TITLE_AREA_HEIGHT_0_LINE); break; case eSCREEN_CAPTIONS_BACK_COLOR: title_area_height += (eMENU_TITLE_AREA_HEIGHT_1_LINE - eMENU_TITLE_AREA_HEIGHT_0_LINE - 8); break; case eSCREEN_CAPTIONS_FONT: title_area_height -= 18; break; default: break; } } /* TODO: do we need to do this since video is muted anyways? */ /*bgfx_fill_rect(p_surf,0,0,eWIDTH,eHEIGHT,eCOLOR_BLACK);*/ /* draw 3 window fields */ bgfx_fill_rect(p_surf,eSCREEN_ACTION_SAFE_X+offset,eSCREEN_ACTION_SAFE_Y+offset,eSCREEN_ACTION_SAFE_WIDTH-(2*offset),title_area_height-offset,eCOLOR_LT_BLUE); bgfx_fill_rect(p_surf,eSCREEN_ACTION_SAFE_X+offset,eSCREEN_ACTION_SAFE_Y+offset + title_area_height-offset,eSCREEN_ACTION_SAFE_WIDTH-(2*offset),eSCREEN_ACTION_SAFE_HEIGHT - eINFO_AREA_HEIGHT - title_area_height,eCOLOR_MED_BLUE); bgfx_fill_rect(p_surf,eSCREEN_ACTION_SAFE_X+offset,eINFO_AREA_Y,eSCREEN_ACTION_SAFE_WIDTH-(2*offset),eINFO_AREA_HEIGHT-offset,eCOLOR_DRK_BLUE); /* draw border */ for (i = 3; i < 7; i++) { bgfx_h_draw_line(p_surf,eSCREEN_ACTION_SAFE_X-i+1,eSCREEN_ACTION_SAFE_X+eSCREEN_ACTION_SAFE_WIDTH+i+1,eSCREEN_ACTION_SAFE_Y-i,eCOLOR_WHITE); bgfx_h_draw_line(p_surf,eSCREEN_ACTION_SAFE_X-i+1,eSCREEN_ACTION_SAFE_X+eSCREEN_ACTION_SAFE_WIDTH+i+1,eSCREEN_ACTION_SAFE_Y+eSCREEN_ACTION_SAFE_HEIGHT+i,eCOLOR_WHITE); bgfx_v_draw_line(p_surf,eSCREEN_ACTION_SAFE_X-i,eSCREEN_ACTION_SAFE_Y-i,eSCREEN_ACTION_SAFE_Y+eSCREEN_ACTION_SAFE_HEIGHT+i,eCOLOR_WHITE); bgfx_v_draw_line(p_surf,eSCREEN_ACTION_SAFE_X+eSCREEN_ACTION_SAFE_WIDTH+i,eSCREEN_ACTION_SAFE_Y-i,eSCREEN_ACTION_SAFE_Y+eSCREEN_ACTION_SAFE_HEIGHT+i,eCOLOR_WHITE); } } /* Summary: Picture screen event handler Description: Picture screen event handler. . */ int screen_picture_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = (p_app->settings.picture == 0) ? 1 : 0; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.picture = ((p_screen->button_checked == 0) ? 1 : 0); p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Picture screen event handler Description: Picture screen event handler. . */ extern const char g_tz_map[]; int bscreen_timezone_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.time_zone; BDBG_ERR(("p_app->settings.time_zone = %d\n",p_app->settings.time_zone)); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_CHECKED) { if (p_event->id == 5) { result = (p_app->settings.dst) ? 1 : 0; } else { result = bscreen_default_event(v_app,v_screen,p_event); } } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: if (p_screen->button_selection == 5) { const bbutton_t *p_button; p_app->settings.dst = (p_app->settings.dst) ? 0 : 1; p_button = &(p_screen->p_button_array[5]); bapp_sync(p_app); bscreen_draw_button(p_app,p_button, p_screen->button_selection, p_app->settings.dst,p_screen->button_selection); bapp_flush_screen(p_app); result = 0; } else { result = select_button(v_app,v_screen); p_app->settings.time_zone = p_screen->button_checked; if (p_app->settings.time_zone != 0) { p_app->chm.local_time_source = eTS_FIXED; p_app->chm.local_offset = 0 - (int)g_tz_map[p_app->settings.time_zone]; p_app->chm.local_offset *= 3600; p_app->chm.local_dst_obs = p_app->settings.dst; BDBG_ERR(("### Local time %d Fixed(%d) dst %d ###\n",p_app->chm.local_offset,p_app->settings.time_zone,p_app->chm.local_dst_obs)); } else p_app->chm.local_time_source = eTS_NONE; } p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Sound screen event handler Description: Sound screen event handler. . */ int screen_sound_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.sound; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.sound = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Setup screen event handler Description: Setup screen event handler. . */ int screen_setup_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: if (p_screen->button_selection) { result = select_button(v_app,v_screen); } else { /* decide what type of channel scan to do (quick or full) we cannot blindly call select_button() here since we need to go to different scan screens depending on the type of antenna attached */ bapp_set_current_screen( p_app, (bant_detect() ? eSCREEN_SMART_CH_SCAN : eSCREEN_CH_SCAN), p_screen->p_button_array[p_screen->button_selection].next_screen_back_id); result = 1; } break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ch Scan screen event handler Description: Ch Scan screen event handler. . */ int screen_ch_scan_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ p_screen->button_checked = 0; p_screen->local_state = 0; } else if (p_event->type == eS_EVENT_CHECKED) { result = (p_screen->local_state) ? 1 : 0; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: if (((p_app->screen_id == eSCREEN_CH_SCAN) && (p_screen->button_selection == 1)) || ((p_app->screen_id == eSCREEN_SMART_CH_SCAN) && (p_screen->button_selection == 2))) p_screen->local_state = (p_screen->local_state) ? 0 : 1; result = select_button(v_app,v_screen); if (bant_detect()) p_app->ch_scan_type = (p_screen->button_selection ? eFULL_SCAN : eQUICK_SCAN); else p_app->ch_scan_type = eFULL_SCAN; if ((p_screen->local_state == 1) && (p_app->ch_scan_type < eFULL_RESCAN)) { p_app->ch_scan_type += 2; } break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Antenna screen event handler Description: Antenna screen event handler. . */ int screen_antenna_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; baudio_decode_config config; if (p_event->type == eS_EVENT_SETUP) { p_app->tmp_value = 0; /* progress set at 0% */ result = 1; /* always handle event */ bapp_stop_decode(p_app); chm_cmd(&p_app->chm,eCHM_CHECK_SIGNAL); } else if (p_event->type == eS_EVENT_PROGRESS) { int w, h; unsigned int num_chars; char strPercent[5]; bapp_audio_mute(p_app, 0); baudio_decode_get_config(p_app->audio, &config); config.tone = p_event->id; baudio_decode_set_config(p_app->audio, &config); result = 0; /* don't want top cause redraw */ /* draw progress meter */ bscreen_draw_progress(v_app, ePROGRESS_X, ePROGRESS_Y, ePROGRESS_WIDTH, ePROGRESS_HEIGHT, eBUTTON_PROGRESS_BORDER, eCOLOR_WHITE, eCOLOR_DRK_BLUE, p_event->id); /* draw percent compete text */ num_chars = SCREEN_MAX_STR_WIDTH; snprintf(strPercent, 4, "%3d", p_event->id); strPercent[4] = 0; strPercent[3] = '%'; num_chars = c_to_uni_str(strPercent,p_app->tmp_str,num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_LARGE],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); bapp_sync(p_app); bgfx_fill_rect(&p_app->surf,ePROGRESS_X + ePROGRESS_WIDTH + ePROGRESS_LABEL_SPACING, ePROGRESS_Y + (ePROGRESS_HEIGHT / 2) - (h / 2),w + 12, h + 2,eCOLOR_MED_BLUE); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_MED], ePROGRESS_X + ePROGRESS_WIDTH + ePROGRESS_LABEL_SPACING, ePROGRESS_Y + (ePROGRESS_HEIGHT / 2) - (h / 2), w + 10, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); bapp_flush_screen(p_app); } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: if (p_app->settings.wiz_completed) { bapp_audio_mute(p_app,1); baudio_decode_get_config(p_app->audio, &config); config.tone = 0xFFFFFFFF; baudio_decode_set_config(p_app->audio, &config); bapp_tune(p_app); /* in setup wizard */ result = 1; bapp_set_current_screen(p_app, eSCREEN_NULL, eSCREEN_NULL); } break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_audio_mute(p_app, 1); baudio_decode_get_config(p_app->audio, &config); config.tone = 0xFFFFFFFF; baudio_decode_set_config(p_app->audio, &config); bapp_tune(p_app); bapp_goto_last_screen(p_app); break; } } else if ((p_event->type != eS_EVENT_SELECTED) && (p_event->type != eS_EVENT_CHECKED)) { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } #if 0 /* Summary: Captions screen event handler Description: Captions screen event handler. . */ int screen_captions_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Captions on/off screen event handler Description: Captions on/off screen event handler. . */ int screen_captions_on_off_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = !p_app->settings.captions_on_off; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.captions_on_off = !p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Basic captions screen event handler Description: Basic captions screen event handler. . */ int screen_captions_basic_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.captions_basic; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.captions_basic = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } #endif /* Summary: Advanced captions screen event handler Description: Advanced captions screen event handler. . */ int screen_captions_advanced_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: font options captions screen event handler Description: font options captions screen event handler. . */ int screen_captions_font_options_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: background options captions screen event handler Description: background options captions screen event handler. . */ int screen_captions_back_options_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions font screen event handler Description: Advanced captions font screen event handler. . */ int screen_captions_font_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.captions_font; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.captions_font = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions font size screen event handler Description: Advanced captions font size screen event handler. . */ int screen_captions_font_size_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.captions_font_size; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.captions_font_size = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions font style screen event handler Description: Advanced captions font style screen event handler. . */ int screen_captions_font_style_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.captions_font_style; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.captions_font_style = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions font color screen event handler Description: Advanced captions font color screen event handler. . */ int screen_captions_font_color_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.captions_font_color; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.captions_font_color = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions font opacity screen event handler Description: Advanced captions font opacity screen event handler. . */ int screen_captions_font_opacity_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.captions_font_opacity; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.captions_font_opacity = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions background color screen event handler Description: Advanced captions background color screen event handler. . */ int screen_captions_back_color_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.captions_back_color; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.captions_back_color = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions background opacity screen event handler Description: Advanced captions background opacity screen event handler. . */ int screen_captions_back_opacity_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.captions_back_opacity; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.captions_back_opacity = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: background edge color screen event handler Description: background edge color screen event handler . */ int screen_captions_edge_color_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.captions_edge_color; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.captions_edge_color = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: background edge type screen event handler Description: background edge type screen event handler . */ int screen_captions_edge_type_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.captions_edge_type; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.captions_edge_type = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions reset screen event handler Description: Advanced captions reset screen event handler . */ int screen_captions_reset_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: if (p_screen->p_button_array[p_screen->button_selection].desc_text_id == eTEXT_CANCEL_INFO) { result = 1; /* cannot call select_button() in this case since we do not want to save button history * this is unique for the eTEXT_CANCEL button since the button duplicates the 'back' functionality */ bapp_goto_last_screen(p_app); //bapp_set_current_screen(p_app, p_screen->p_button_array[p_screen->button_selection].next_screen_id, eSCREEN_NULL); } else { bapp_reset_cc_settings(p_app); bapp_save_settings(p_app); bapp_goto_last_screen(p_app); result = 1; } break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ch scan progress screen event handler Description: Ch scan progress screen event handler. . */ int screen_ch_scan_progress_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { p_app->tmp_value = 0; /* progress set at 0% */ p_app->settings_dirty = true; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_SETUP_DONE) { result = 1; /* always handle event */ if (p_app->ch_scan_type == eQUICK_SCAN) { BDBG_MSG(("Doing QUICK scan using smart antenna\n")); } else /* eFULL_SCAN */ { BDBG_MSG(("Doing FULL scan using %s antenna\n", bant_detect() ? "smart" : "basic")); } bapp_channel_scan(p_app); } else if (p_event->type == eS_EVENT_PROGRESS) { int w, h; unsigned int num_chars; char strPercent[5]; char strChFound[5]; /* reset screensaver timeout since we are making progress */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__FUNCTION__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif result = 0; /* don't want top cause redraw */ /* draw progress meter */ bscreen_draw_progress(v_app, ePROGRESS_X, ePROGRESS_Y, ePROGRESS_WIDTH, ePROGRESS_HEIGHT, eBUTTON_PROGRESS_BORDER, eCOLOR_WHITE, eCOLOR_DRK_BLUE, p_event->id); bapp_sync(p_app); /* draw percent compete text */ num_chars = SCREEN_MAX_STR_WIDTH; snprintf(strPercent, 4, "%3d", p_event->id); strPercent[4] = 0; strPercent[3] = '%'; num_chars = c_to_uni_str(strPercent,p_app->tmp_str,num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_LARGE],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); bgfx_fill_rect(&p_app->surf,ePROGRESS_X + ePROGRESS_WIDTH + ePROGRESS_LABEL_SPACING, ePROGRESS_Y + (ePROGRESS_HEIGHT / 2) - (h / 2),w + 12, h + 2,eCOLOR_MED_BLUE); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_MED], ePROGRESS_X + ePROGRESS_WIDTH + ePROGRESS_LABEL_SPACING, ePROGRESS_Y + (ePROGRESS_HEIGHT / 2) - (h / 2), w + 10, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw number of channels found */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_CH_SCAN_FOUND, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); snprintf(strChFound, 4, "%3d", p_app->settings.num_channels); num_chars = c_to_uni_str(strChFound,p_app->tmp_str,num_chars); bgfx_fill_rect(&p_app->surf,ePROGRESS_X + w, ePROGRESS_Y + (ePROGRESS_HEIGHT * 2),ePROGRESS_WIDTH - w - ePROGRESS_X + 2, h + 2,eCOLOR_MED_BLUE); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X + w, ePROGRESS_Y + (ePROGRESS_HEIGHT * 2) , ePROGRESS_WIDTH - w - ePROGRESS_X, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); bapp_flush_screen(p_app); if (p_event->id == 100) { bapp_set_current_screen(p_app, eSCREEN_GUIDE, eSCREEN_CH_SCAN); bapp_new_screen(p_app); /* Because the app event handling for progress will not cause new screen draw */ p_app->settings.wiz_completed = true; result = 1; } } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_LEFT: case eIR_MENU: result = 1; chm_cmd(&p_app->chm,eCHM_CANCEL); bapp_goto_last_screen(p_app); break; } } else if ((p_event->type != eS_EVENT_SELECTED) && (p_event->type != eS_EVENT_CHECKED)) { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Language screen event handler Description: Language screen event handler. . */ int screen_language_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.language; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.language = p_screen->button_checked; p_app->lang = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Reset screen event handler Description: Reset screen event handler. . */ int screen_reset_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: if (p_screen->p_button_array[p_screen->button_selection].desc_text_id == eTEXT_CANCEL_INFO) { result = 1; /* cannot call select_button() in this case since we do not want to save button history * this is unique for the eTEXT_CANCEL button since the button duplicates the 'back' functionality */ bapp_set_current_screen(p_app, p_screen->p_button_array[p_screen->button_selection].next_screen_id, eSCREEN_NULL); } else { bapp_reset_settings(p_app); bapp_av_mute(p_app, 1); bapp_save_settings(p_app); bapp_set_current_screen(p_app, eSCREEN_WIZ_LANGUAGE, eSCREEN_NULL); result = 1; } break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Wiz welcome screen event handler Description: Wiz welcome screen event handler. . */ int screen_wiz_welcome_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_app->settings_dirty = true; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_CH_UP: case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: /*result = 1;*/ /*bapp_goto_last_screen(p_app);*/ break; case eIR_CH_DOWN: result = next_button(v_app,v_screen,0); break; case eIR_UP: case eIR_DOWN: break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Wiz Language screen event handler Description: Wiz Language screen event handler. . */ int screen_wiz_language_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_CH_UP: case eIR_RIGHT: case eIR_SELECT: /* we cannot blindly call select_button() here since we need to go to different scan screens depending on the type of antenna attached */ bapp_set_current_screen( p_app, (bant_detect() ? eSCREEN_WIZ_SMART_CH_SCAN : eSCREEN_WIZ_CH_SCAN), p_screen->p_button_array[p_screen->button_selection].next_screen_back_id); p_app->settings.language = p_screen->button_selection; p_app->lang = p_screen->button_selection; p_app->settings_dirty = true; result = 1; break; case eIR_CH_DOWN: result = next_button(v_app,v_screen,0); break; case eIR_LEFT: case eIR_MENU: /* do nothing since language screen is the 1st screen in thomson's wizard */ break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Wiz ch scan screen event handler Description: Wiz ch scan screen event handler. . */ int screen_wiz_ch_scan_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_CH_UP: case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); if (bant_detect()) p_app->ch_scan_type = (p_screen->button_selection ? eFULL_SCAN : eQUICK_SCAN); else p_app->ch_scan_type = eFULL_SCAN; break; case eIR_CH_DOWN: result = next_button(v_app,v_screen,0); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Wiz done screen event handler Description: Wiz done screen event handler. . */ int screen_wiz_done_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_CH_UP: case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.wiz_completed = true; /* select exits to live tv so we must clear all the button selection history for all screens */ bapp_clear_screen_selection_history(p_app); screen_null_draw(v_app, v_screen); break; case eIR_CH_DOWN: result = next_button(v_app,v_screen,0); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; case eIR_UP: case eIR_DOWN: break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: auto power off screen event handler Description: auto power off screen event handler. . */ int screen_auto_power_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.auto_power; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.auto_power = p_screen->button_checked; p_app->settings_dirty = true; if (p_app->settings.auto_power_off) { p_app->settings.auto_power_off = 0; bapp_save_settings(p_app); bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); } result = 1; break; case eIR_LEFT: case eIR_MENU: result = 1; if (p_app->settings.auto_power_off) { p_app->settings.auto_power_off = 0; bapp_save_settings(p_app); bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); } else bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ratings screen event handler Description: Ratings screen event handler. . */ int screen_ratings_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ratings Lock screen event handler Description: Ratings Lock screen event handler. . */ int screen_ratings_lock_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.ratings_lock; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.ratings_lock = p_screen->button_checked; p_app->settings_dirty = true; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ratings limits screen event handler Description: Ratings limits screen event handler. . */ int screen_ratings_limits_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { /* remove rrt ratings button if unavailable */ if (p_app->settings.ratings_lock != 2) p_screen->num_buttons = g_buttons_ratings_limits_num - 1; else p_screen->num_buttons = g_buttons_ratings_limits_num; bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Convert from button position to RRT TV ratings dimension Description: Convert from button position to RRT TV ratings dimension */ const int screen_ratings_tv_pos2dim(int button_position) { const int pos2dim[g_buttons_ratings_tv_num] = { /* rat D L S V FV */ /* tv-y */ 5, /* tv-y7 */ 5, 6, /* tv-g */ 0, /* tv-pg */ 0, 1, 2, 3, 4, /* tv-14 */ 0, 1, 2, 3, 4, /* tv-ma */ 0, 2, 3, 4 }; if ((button_position < 0) || (button_position > sizeof(pos2dim))) return -1; return(pos2dim[button_position]); } /* Summary: Convert from button position to RRT TV ratings value Description: Convert from button position to RRT TV ratings value */ const int screen_ratings_tv_pos2value(int button_position) { const int pos2value[g_buttons_ratings_tv_num] = { /* rat D L S V FV */ /* tv-y */ 1, /* tv-y7 */ 2, 1, /* tv-g */ 2, /* tv-pg */ 3, 1, 1, 1, 1, /* tv-14 */ 4, 1, 1, 1, 1, /* tv-ma */ 5, 1, 1, 1 }; if ((button_position < 0) || (button_position > sizeof(pos2value))) return -1; return(pos2value[button_position]); } /* Summary: Convert xds tv ratings to psip grid position Description: Convert xds tv ratings to psip grid position */ const int screen_ratings_tv_xds2pos(int xds_tv_rating) { const int tv_xds2pos[8] = { /* none */ -1, /* tv-y */ ePOS_TV_Y, /* tv-y7 */ ePOS_TV_Y7, /* tv-g */ ePOS_TV_G, /* tv-pg */ ePOS_TV_PG, /* tv-14 */ ePOS_TV_14, /* tv-ma */ ePOS_TV_MA, /* none */ -1 }; if ((xds_tv_rating < 0) || (xds_tv_rating > sizeof(tv_xds2pos))) return -1; return(tv_xds2pos[xds_tv_rating]); } /* Summary: Convert xds movie ratings to psip grid position Description: Convert xds movie ratings to psip grid position */ const int screen_ratings_movie_xds2pos(int xds_movie_rating) { const int movie_xds2pos[8] = { /* none */ -1, /* G */ 0, /* PG */ 1, /* PG-13 */ 2, /* R */ 3, /* NC-17 */ 4, /* X */ 5, /* NR */ 6 }; if ((xds_movie_rating < 0) || (xds_movie_rating > sizeof(movie_xds2pos))) return -1; return(movie_xds2pos[xds_movie_rating]); } /* Summary: Ratings TV screen event handler Description: Ratings TV screen event handler. . */ int screen_ratings_tv_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { /* button layout is fixed for US tv ratings. button position is used in the following tables for navigation and auto block/unblock. this is what the button numbering looks like: rat D L S V FV tv-y 0 tv-y7 1 2 tv-g 3 tv-pg 4 5 6 7 8 tv-14 9 10 11 12 13 tv-ma 14 15 16 17 */ /* define button navigation in up direction */ const int up[g_buttons_ratings_tv_num] = { /* rat D L S V FV */ /* tv-y */ 14, /* tv-y7 */ 0, 0, /* tv-g */ 1, /* tv-pg */ 3, 3, 3, 2, 2, /* tv-14 */ 4, 5, 6, 7, 8, /* tv-ma */ 9, 11, 12, 13 }; /* define button navigation in down direction */ const int down[g_buttons_ratings_tv_num] = { /* rat D L S V FV */ /* tv-y */ 1, /* tv-y7 */ 3, 8, /* tv-g */ 4, /* tv-pg */ 9, 10, 11, 12, 13, /* tv-14 */ 14, 14, 15, 16, 17, /* tv-ma */ 0, 0, 0, 0 }; /* define auto block for each button */ const int block[g_buttons_ratings_tv_num][g_buttons_ratings_tv_num + 1] = { /* rat D L S V FV */ /* tv-y */ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1}, /* tv-y7 */ {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1}, {2, -1}, /* tv-g */ {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1}, /* tv-pg */ {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1}, {5, 10, -1}, {6, 11, 15, -1},{7, 12, 16, -1},{8, 13, 17, -1}, /* tv-14 */ {9, 10, 11, 12, 13, 14, 15, 16, 17, -1}, {10, -1}, {11, 15, -1}, {12, 16, -1}, {13, 17, -1}, /* tv-ma */ {14, 15, 16, 17, -1}, {15, -1}, {16, -1}, {17, -1} }; /* define auto unblock for each button */ const int unblock[g_buttons_ratings_tv_num][g_buttons_ratings_tv_num + 1] = { /* rat D L S V FV */ /* tv-y */ {0, -1}, /* tv-y7 */ {0, 1, 2, -1}, {0, 1, 2, -1}, /* tv-g */ {0, 1, 2, 3, -1}, /* tv-pg */ {0, 1, 2, 3, 4, 5, 6, 7, 8, -1}, {0, 1, 3, 4, 5, -1}, {0, 1, 3, 4, 6, -1}, {0, 1, 3, 4, 7, -1}, {0, 1, 3, 4, 8, -1}, /* tv-14 */ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1}, {0, 1, 3, 4, 5, 9, 10, -1}, {0, 1, 3, 4, 6, 9, 11, -1}, {0, 1, 3, 4, 7, 9, 12, -1}, {0, 1, 3, 4, 8, 9, 13, -1}, /* tv-ma */ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1}, {0, 1, 3, 4, 6, 9, 11, 14, 15, -1}, {0, 1, 3, 4, 7, 9, 12, 14, 16, -1}, {0, 1, 3, 4, 8, 9, 13, 14, 17, -1} }; switch (p_event->id) { case eIR_SELECT: { int i = 0; if (p_app->settings.ratings_tv & ((0 | (0x1) << p_screen->button_selection))) { /* selected rating already blocked so unblock it */ for (i = 0; unblock[p_screen->button_selection][i] >= 0; i++) { p_app->settings.ratings_tv &= ~(0 | (0x1) << unblock[p_screen->button_selection][i]); } } else { /* selected rating unblocked so block it */ for (i = 0; block[p_screen->button_selection][i] >= 0; i++) { p_app->settings.ratings_tv |= (0 | (0x1) << block[p_screen->button_selection][i]); } } p_app->settings_dirty = true; result = select_button(v_app,v_screen); p_app->ratings_override = false; /* reset so ratings will be re-evaluated when returned to full tv */ p_app->last_rating_block_status = -1; /* assume psip unblock */ p_app->last_psip_rating_block_status = 0; } break; case eIR_RIGHT: result = next_button(v_app,v_screen,0); break; case eIR_LEFT: result = next_button(v_app,v_screen,1); break; case eIR_UP: result = focus_button(v_app,v_screen,up[p_screen->button_selection]); break; case eIR_DOWN: result = focus_button(v_app,v_screen,down[p_screen->button_selection]); break; case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; case eIR_0: case eIR_1: case eIR_2: case eIR_3: case eIR_4: case eIR_5: case eIR_6: case eIR_7: case eIR_8: case eIR_9: result = 0; break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else if (p_event->type == eS_EVENT_CHECKED) { result = ((p_app->settings.ratings_tv >> p_event->id) & (0 | (0x1))); BDBG_MSG(("checked status button#: %d checked:%d", p_event->id, result)); } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ratings TV screen event handler Description: Ratings TV screen event handler. . */ int screen_ratings_movies_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: { int i = 0; if (p_app->settings.ratings_movies & ((0 | (0x1) << p_screen->button_selection))) { /* selected rating already blocked so unblock it */ for (i = p_screen->button_selection; i >= 0; i--) { p_app->settings.ratings_movies &= ~(0 | (0x1) << i); } } else { /* selected rating unblocked so block it */ for (i = p_screen->button_selection; i < g_buttons_ratings_movies_num; i++) { p_app->settings.ratings_movies |= (0 | (0x1) << i); } } } p_app->settings_dirty = true; result = select_button(v_app,v_screen); /* ratings changed so invalidate current rating */ p_app->last_cad = 0; p_app->last_rating_tick = 0; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else if (p_event->type == eS_EVENT_CHECKED) { result = ((p_app->settings.ratings_movies >> p_event->id) & (0 | (0x1))); } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ratings RRT dimension screen event handler Description: Ratings RRT dimension screen event handler. . */ int screen_ratings_rrt_dim_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; PSIP_RRT_header header; int num_buttons; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); #ifdef TEST_RRT header.dimensions_defined = MAX_RRT_DIM; #else PSIP_RRT_getHeader(p_app->settings.rrt, &header); #endif num_buttons = SCREEN_MIN(p_screen->num_buttons,header.dimensions_defined); if ((p_screen->local_state + MAX_RRT_DIM_BUTTONS) >= header.dimensions_defined) { p_screen->local_state = 0; } if (p_screen->button_selection >= num_buttons) { p_screen->button_selection = 0; } result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; case eIR_UP: { unsigned int next_button = p_screen->button_selection; if (p_screen->button_selection == 0) { if (p_screen->local_state > 0) { p_screen->local_state--; } } else next_button--; p_screen->button_selection = next_button; result = 1; } break; case eIR_DOWN: { unsigned int next_button = p_screen->button_selection; #ifdef TEST_RRT header.dimensions_defined = MAX_RRT_DIM; #else PSIP_RRT_getHeader(p_app->settings.rrt, &header); #endif num_buttons = SCREEN_MIN(p_screen->num_buttons,header.dimensions_defined); if (p_screen->button_selection == (num_buttons - 1)) { #ifdef TEST_RRT if ((p_screen->local_state + MAX_RRT_DIM_BUTTONS) < MAX_RRT_DIM) p_screen->local_state++; #else PSIP_RRT_getHeader(p_app->settings.rrt, &header); if ((p_screen->local_state + MAX_RRT_DIM_BUTTONS) < header.dimensions_defined) p_screen->local_state++; #endif } else next_button++; p_screen->button_selection = next_button; result = 1; } break; case eIR_0: case eIR_1: case eIR_2: case eIR_3: case eIR_4: case eIR_5: case eIR_6: case eIR_7: case eIR_8: case eIR_9: result = 0; break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ratings RRT value screen event handler Description: Ratings RRT value screen event handler. buttons for the rrt value screen are dynamically created - so we cannot use the typical navigation functions other "event" functions use. . */ int screen_ratings_rrt_val_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t * p_app = (bapp_t*)v_app; bscreen_t * p_screen = (bscreen_t*)v_screen; int dim_idx = p_app->p_screens[eSCREEN_RATINGS_RRT_DIM].button_selection + p_app->p_screens[eSCREEN_RATINGS_RRT_DIM].local_state; int result = 0; PSIP_RRT_dimension dim; int i = 0; int grad = 0; unsigned int num_buttons = 0; if (p_event->type != eS_EVENT_IDLE) { #ifdef TEST_RRT dim.values_defined = MAX_RRT_VAL; if (dim_idx & 1) grad = 0 ; else grad = 1; #else if (PSIP_RRT_getDimension(p_app->settings.rrt, dim_idx,&dim) != BERR_SUCCESS) { dim.values_defined = 0; } else { grad = dim.graduated_scale; } #endif num_buttons = SCREEN_MIN(p_screen->num_buttons,dim.values_defined); } if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); if ((p_screen->local_state + MAX_RRT_VAL_BUTTONS) >= dim.values_defined) { p_screen->local_state = 0; } if (p_screen->button_selection >= num_buttons) { p_screen->button_selection = 0; } result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: { BDBG_MSG(("rating dimension graduated_scale:%d\n", grad)); if (p_app->settings.ratings_rrt[dim_idx] & (1 << (p_screen->local_state + p_screen->button_selection))) { /* selected rating already blocked so unblock it */ if (grad) { for (i = (p_screen->local_state + p_screen->button_selection); i >= 0; i--) { p_app->settings.ratings_rrt[dim_idx] &= ~(1 << i); } } else { p_app->settings.ratings_rrt[dim_idx] &= ~(1 << (p_screen->local_state + p_screen->button_selection)); } } else { /* selected rating unblocked so block it */ if (grad) { for (i = (p_screen->local_state + p_screen->button_selection); i < dim.values_defined; i++) { p_app->settings.ratings_rrt[dim_idx] |= (1 << i); } } else { p_app->settings.ratings_rrt[dim_idx] |= (1 << (p_screen->local_state + p_screen->button_selection)); } } p_app->settings_dirty = true; //result = select_button(v_app,v_screen); { bscreen_event_t event; int checked = 0; event.id = p_screen->button_selection; event.type = eS_EVENT_CHECKED; checked = p_screen->handle_event(p_app,p_screen,&event); p_screen->button_checked = p_screen->button_selection; } p_app->ratings_override = false; /* reset so ratings will be re-evaluated when returned to full tv */ p_app->last_rating_block_status = -1; /* assume psip unblock */ p_app->last_psip_rating_block_status = 0; result = 1; /* always handle event */ } break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; case eIR_UP: { unsigned int next_button = p_screen->button_selection; if (p_screen->button_selection == 0) { if (p_screen->local_state > 0) { p_screen->local_state--; } } else next_button--; p_screen->button_selection = next_button; result = 1; } break; case eIR_DOWN: { unsigned int next_button = p_screen->button_selection; if (p_screen->button_selection == (num_buttons - 1)) { #ifdef TEST_RRT if ((p_screen->local_state + MAX_RRT_VAL_BUTTONS) < MAX_RRT_VAL) p_screen->local_state++; #else PSIP_RRT_dimension dim; if (PSIP_RRT_getDimension(p_app->settings.rrt,dim_idx,&dim) != BERR_SUCCESS) dim.values_defined = 0; if ((p_screen->local_state + MAX_RRT_VAL_BUTTONS) < dim.values_defined) p_screen->local_state++; #endif } else next_button++; p_screen->button_selection = next_button; result = 1; } break; case eIR_0: case eIR_1: case eIR_2: case eIR_3: case eIR_4: case eIR_5: case eIR_6: case eIR_7: case eIR_8: case eIR_9: result = 0; break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else if (p_event->type == eS_EVENT_CHECKED) { result = (p_app->settings.ratings_rrt[dim_idx] & (1 << p_screen->button_selection)) ? 1 : 0; } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: RRT Ratings update screen event handler Description: RRT Ratings update screen event handler . */ int screen_ratings_rrt_update_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: pin entry screen event handler Description: pin entry screen event handler. . */ int screen_pin_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static unsigned int pin = 0; static unsigned int pin_pending = 0; static unsigned int pin_override = 0; if (p_event->type == eS_EVENT_SETUP) { /* this popup may display without a corresponding keypress so reset screensaver timeout value manually */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__FUNCTION__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif p_app->tmp_value = 0; /* select first pin digit field */ result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_REDRAW) { bapp_sync(p_app); p_app->p_screens[p_app->screen_id].draw(p_app,(void*)&(p_app->p_screens[p_app->screen_id])); bapp_flush_screen(p_app); } else if (p_event->type == eS_EVENT_IR) { BDBG_MSG(("event ir id: %d\n", p_event->id)); switch (p_event->id) { case eIR_MENU: /* disable 'back' functionality for live pin verification */ if ((p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) || (p_app->screen_id == eSCREEN_WRONG_PIN_LIVE)) { bapp_set_current_screen(p_app, eSCREEN_MAIN, eSCREEN_NULL); } else { bapp_goto_last_screen(p_app); } result = 1; break; case eIR_CH_UP: if (p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) { bapp_change_channel(p_app,1,1); bapp_set_current_screen(p_app, eSCREEN_NULL, eSCREEN_NULL); result = 1; } else if (p_app->screen_id == eSCREEN_WIZ_PIN_NEW) { /* + key will skip pin entry using 0000 as pin, this is to handle operation without remote on ACB335 per Aonvision request. */ bapp_set_current_screen(p_app, eSCREEN_WIZ_DONE, eSCREEN_PIN_NEW); p_app->settings.pin = 0; p_app->settings_dirty = true; result = 1; /* reset pin values */ pin = 0; p_app->tmp_value = 0; /* select first pin digit field */ } break; case eIR_CH_DOWN: if (p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) { bapp_change_channel(p_app,0,1); bapp_set_current_screen(p_app, eSCREEN_NULL, eSCREEN_NULL); result = 1; } break; case eIR_ENTER: if (p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) { /* channel jump - swap last and current channel numbers */ unsigned int tmp_ch_num = p_app->cur_ch_num; p_app->cur_ch_num = p_app->last_ch_num; p_app->last_ch_num = tmp_ch_num; bapp_tune(p_app); bapp_set_current_screen(p_app, eSCREEN_NULL, eSCREEN_NULL); result = 1; } break; case eIR_LEFT: if (p_app->tmp_value > 0) { result = 1; (p_app->tmp_value)--; /* erase one entered pin digit */ pin &= ~(0 | (0xff)<<(p_app->tmp_value * 8)); /* force draw of only changed pin fields */ bscreen_draw_pin(v_app, ePIN_X, ePIN_Y+(p_screen->top_banner_height-eMENU_TITLE_AREA_HEIGHT_1_LINE)/2, ePIN_WIDTH, ePIN_HEIGHT, ePIN_INC_X, p_app->tmp_value, p_app->tmp_value + 1); bscreen_draw_pin(v_app, ePIN_X, ePIN_Y+(p_screen->top_banner_height-eMENU_TITLE_AREA_HEIGHT_1_LINE)/2, ePIN_WIDTH, ePIN_HEIGHT, ePIN_INC_X, p_app->tmp_value, p_app->tmp_value); bapp_flush_screen(p_app); result = 0; } else { /* no pin digits entered so function as 'back' unless verifying pin live */ if ((p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) || (p_app->screen_id == eSCREEN_WRONG_PIN_LIVE)) { bapp_set_current_screen(p_app, eSCREEN_MAIN, eSCREEN_NULL); } else { bapp_goto_last_screen(p_app); } result = 1; } break; case eIR_0: case eIR_1: case eIR_2: case eIR_3: case eIR_4: case eIR_5: case eIR_6: case eIR_7: case eIR_8: case eIR_9: result = 1; pin |= (p_event->id)<<(p_app->tmp_value * 8); (p_app->tmp_value)++; /* force draw of only changed pin fields */ bscreen_draw_pin(v_app, ePIN_X, ePIN_Y+(p_screen->top_banner_height-eMENU_TITLE_AREA_HEIGHT_1_LINE)/2, ePIN_WIDTH, ePIN_HEIGHT, ePIN_INC_X, p_app->tmp_value, p_app->tmp_value - 1); if (p_app->tmp_value < 4) { bscreen_draw_pin(v_app, ePIN_X, ePIN_Y+(p_screen->top_banner_height-eMENU_TITLE_AREA_HEIGHT_1_LINE)/2, ePIN_WIDTH, ePIN_HEIGHT, ePIN_INC_X, p_app->tmp_value, p_app->tmp_value); } bapp_flush_screen(p_app); result = 0; break; } if (p_app->tmp_value == 4) { /* force drawing of last digit indicator */ /* any time we draw we need to sync first */ bscreen_draw_pin(v_app, ePIN_X, ePIN_Y+(p_screen->top_banner_height-eMENU_TITLE_AREA_HEIGHT_1_LINE)/2, ePIN_WIDTH, ePIN_HEIGHT, ePIN_INC_X, p_app->tmp_value, p_app->tmp_value - 1); bapp_sleep(250); /* slight delay so user can see 4th digit displayed */ /* handle all pin based screens */ switch (p_app->screen_id) { case eSCREEN_PIN_NEW: /* save entered pin and query user to confirm entry */ pin_pending = pin; BDBG_MSG(("saving new pin: %x\n", pin_pending)); /* force "last screen" to be identical to that of the eSCREEN_PIN_NEW */ bapp_set_current_screen(p_app, eSCREEN_PIN_CONFIRM, p_screen->last_screen_id); break; case eSCREEN_WIZ_PIN_NEW: /* save entered pin and query user to confirm entry */ pin_pending = pin; BDBG_MSG(("saving new pin: %x\n", pin_pending)); /* force "last screen" to be identical to that of the eSCREEN_PIN_NEW */ bapp_set_current_screen(p_app, eSCREEN_WIZ_PIN_CONFIRM, p_screen->last_screen_id); break; case eSCREEN_PIN_CONFIRM: BDBG_MSG(("comparing new/confirm pins: %x %x\n", pin_pending, pin)); /* verify against previously entered pin */ if (pin == pin_pending) { /* traditional screen flow was interrupted by pin new/confirm windows, so force "last screen" to be main menu screen. */ bapp_set_current_screen(p_app, eSCREEN_RATINGS, eSCREEN_MAIN); p_app->settings.pin = pin; p_app->settings_dirty = true; } else { /* user entered pins do not match...start over */ bapp_set_current_screen(p_app, eSCREEN_MISMATCHED_PINS, p_screen->last_screen_id); } break; case eSCREEN_WIZ_PIN_CONFIRM: BDBG_MSG(("comparing new/confirm pins: %x %x\n", pin_pending, pin)); /* verify against previously entered pin */ if (pin == pin_pending) { /* still in wizard so continue to next step */ bapp_set_current_screen(p_app, eSCREEN_WIZ_DONE, eSCREEN_WIZ_PIN_NEW); p_app->settings.pin = pin; p_app->settings_dirty = true; } else { /* user entered pins do not match...start over */ bapp_set_current_screen(p_app, eSCREEN_WIZ_MISMATCHED_PINS, p_screen->last_screen_id); } break; case eSCREEN_PIN_VERIFY_LIVE: case eSCREEN_PIN_VERIFY_RATINGS: case eSCREEN_PIN_VERIFY_RESET: /* keep count of consecutive pin entries that equal backup pin (thomson = 3308) */ BDBG_ERR(("verify entered/stored pins: %x %x\n", pin, p_app->settings.pin)); BDBG_ERR(("backup_pin: %x\n", g_p_dsp->ui_comp.backup_pin)); if ((pin == g_p_dsp->ui_comp.backup_pin) && (p_app->screen_id == eSCREEN_PIN_VERIFY_RATINGS)) pin_override = 3; else pin_override = 0; /* if user enters BRCM 3 times as the pin allow entry! */ if (pin_override == 3) pin = p_app->settings.pin; BDBG_MSG(("verify entered/stored pins: %x %x\n", pin, p_app->settings.pin)); /* verify against previously stored pin */ if (pin == p_app->settings.pin) { if (p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) { p_app->ratings_override = true; /* will be reset when changing channels */ p_app->ratings_override_set = true; bapp_set_current_screen(p_app, eSCREEN_NULL, eSCREEN_NULL); } else if (p_app->screen_id == eSCREEN_PIN_VERIFY_RATINGS) { bapp_set_current_screen(p_app, eSCREEN_RATINGS, eSCREEN_MAIN); } else if (p_app->screen_id == eSCREEN_PIN_VERIFY_RESET) { bapp_set_current_screen(p_app, eSCREEN_RESET, eSCREEN_SETUP); } } else { // This is not necessary JPF bapp_sleep(3000); /* slow down possible brute force attack */ /* user entered pin is incorrect */ if (p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) { bapp_set_current_screen(p_app, eSCREEN_WRONG_PIN_LIVE, eSCREEN_NULL); } else if (p_app->screen_id == eSCREEN_PIN_VERIFY_RATINGS) { bapp_set_current_screen(p_app, eSCREEN_WRONG_PIN_RATINGS, p_screen->last_screen_id); } else if (p_app->screen_id == eSCREEN_PIN_VERIFY_RESET) { bapp_set_current_screen(p_app, eSCREEN_WRONG_PIN_RESET, p_screen->last_screen_id); } } break; default: BDBG_ASSERT(0); } /* reset pin values */ pin = 0; p_app->tmp_value = 0; /* select first pin digit field */ result = 1; /* always handle event */ } } else if ((p_event->type != eS_EVENT_SELECTED) && (p_event->type != eS_EVENT_CHECKED)) { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Wrong PIN screen event handler Description: Wrong PIN screen event handler. . */ int screen_wrong_pin_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { /* this popup may display without a corresponding keypress so reset screensaver timeout value manually */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__FUNCTION__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: if (p_screen->p_button_array[p_screen->button_selection].desc_text_id == eTEXT_CANCEL_INFO) { result = 1; /* cannot call select_button() in this case since we do not want to save button history * this is unique for the eTEXT_CANCEL button since the button duplicates the 'back' functionality */ bapp_goto_last_screen(p_app); } else /* retry */ { bapp_set_current_screen(p_app, p_screen->p_button_array[p_screen->button_selection].next_screen_id, p_screen->last_screen_id); result = 1; } break; case eIR_LEFT: case eIR_MENU: if (p_app->screen_id == eSCREEN_WIZ_MISMATCHED_PINS) { /* cancel option not available in wizard so retry */ bapp_set_current_screen(p_app, p_screen->p_button_array[p_screen->button_selection].next_screen_id, p_screen->last_screen_id); result = 1; } else /* disable 'back' functionality for live pin verification */ if (p_app->screen_id != eSCREEN_WRONG_PIN_LIVE) { result = 1; bapp_goto_last_screen(p_app); } break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } #if 0 /* Summary: Setup RRT ratings screen. . */ int bscreen_rrt_init(void *v_app) { bapp_t *p_app = (bapp_t*)v_app; /* setup rrt screen buttons */ PSIP_RRT_header header; PSIP_RRT_dimension dim; int dim_idx = 0; int num_rrt_dim = 0; PSIP_RRT_getHeader(p_app->settings.rrt, &header); for (dim_idx = 0; dim_idx < header.dimensions_defined; dim_idx++) { if (PSIP_RRT_getDimension(p_app->settings.rrt,dim_idx,&dim) == BERR_SUCCESS) { /* create button on rrt dimensions screen */ if (dim_idx < MAX_RRT_DIM_BUTTONS) { g_buttons_ratings_rrt_dim[dim_idx].type = eBUTTON_MENU; g_buttons_ratings_rrt_dim[dim_idx].x = eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X; g_buttons_ratings_rrt_dim[dim_idx].y = eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + dim_idx * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y; g_buttons_ratings_rrt_dim[dim_idx].width = eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH; g_buttons_ratings_rrt_dim[dim_idx].height = eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT; g_buttons_ratings_rrt_dim[dim_idx].text_id = eTEXT_MAX; g_buttons_ratings_rrt_dim[dim_idx].desc_text_id = eTEXT_MAX; g_buttons_ratings_rrt_dim[dim_idx].next_screen_id = eSCREEN_RATINGS_RRT_VAL; g_buttons_ratings_rrt_dim[dim_idx].next_screen_back_id = eSCREEN_MAX; g_buttons_ratings_rrt_dim[dim_idx].right_justify_text = 1; g_buttons_ratings_rrt_dim[dim_idx].background_color = eCOLOR_MED_BLUE; num_rrt_dim++; } } } return num_rrt_dim; } #endif /* Summary: Default screen idle handler Description: Default screen idle handler. . */ int bscreen_default_idle(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; uint32_t current_tick = bos_getticks(); bool show_screensaver = false; /* check for auto power off */ if ((p_app->screen_id != eSCREEN_POWER_OFF) && (p_app->settings.auto_power != 3) && (current_tick >= (p_app->last_keypress_tick + MS_TO_TICKS(AUTO_POWER_OFF_TIMEOUT) * (1 + p_app->settings.auto_power)))) { bapp_power(p_app, false); return 0; } /* check for screen timeout when 'no signal' popup is displayed */ if ((p_app->screen_id == eSCREEN_BANNER_SMALL) && (!bapp_get_signal_status(p_app)) && (current_tick >= (p_app->last_keypress_tick + MS_TO_TICKS(SCREEN_DEFAULT_TIMEOUT)))) { show_screensaver = true; } else /* check for screen timeout when 'mute' popup is displayed */ if ((p_app->screen_id == eSCREEN_BANNER_SMALL) && (p_app->audio_mute) && (current_tick >= (p_app->last_keypress_tick + MS_TO_TICKS(SCREEN_DEFAULT_TIMEOUT)))) { show_screensaver = true; } else /* check for screen timeout when a menu screen is displayed */ if ((p_app->screen_id != eSCREEN_SCREENSAVER) && (p_app->screen_id != eSCREEN_POWER_OFF) && (p_app->screen_id != eSCREEN_NULL) && (p_app->screen_id != eSCREEN_BANNER_SMALL) && (p_screen->idle_timeout > 0) && (current_tick >= (p_app->last_keypress_tick + MS_TO_TICKS(p_screen->idle_timeout)))) { show_screensaver = true; } #ifndef CONFIG_SCREENSAVER if (show_screensaver) { return 0; /* don't cause screen redraw */ } #else //#error "No screensaver mode for Thomson" if (show_screensaver) { bapp_set_current_screen(p_app, eSCREEN_SCREENSAVER, eSCREEN_MAX); p_app->last_keypress_tick = current_tick; printf("#### %s:%d 0x%08x ####\n",__FUNCTION__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); return 1; /* cause screen redraw */ } #endif return 0; } static void reset_volume_timeout(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; if (p_bs->volume_dirty) p_bs->volume_timeout = bos_getticks() + MS_TO_TICKS(BANNER_VOLUME_TIMEOUT); else p_bs->volume_timeout = 0; } static void reset_SAP_timeout(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; if (p_bs->SAP_dirty) p_bs->SAP_timeout = bos_getticks() + MS_TO_TICKS(BANNER_SAP_TIMEOUT); else p_bs->SAP_timeout = 0; } static void reset_CC_timeout(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; if (p_bs->CC_dirty) p_bs->CC_timeout = bos_getticks() + MS_TO_TICKS(BANNER_CC_TIMEOUT); else p_bs->CC_timeout = 0; } static void reset_auto_power_restart_timeout(bapp_t *p_app, bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; if (p_app->settings.auto_power_off) p_bs->auto_power_restart_timeout = bos_getticks() + MS_TO_TICKS(AUTO_POWER_OFF_RESTART_TIMEOUT); else p_bs->auto_power_restart_timeout = 0; } static void reset_10_key_timeout(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; if (p_bs->majorChIndex > 0) p_bs->ten_key_timeout = bos_getticks() + MS_TO_TICKS(BANNER_10_KEY_TIMEOUT); else p_bs->ten_key_timeout = 0; } static void reset_banner_timeout(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; /* reset banner timeout */ if (p_bs->mode == eLS_BANNER_SMALL) p_bs->timeout = bos_getticks() + MS_TO_TICKS(BANNER_SMALL_TIMEOUT); else if (p_bs->mode == eLS_BANNER_BIG) p_bs->timeout = bos_getticks() + MS_TO_TICKS(BANNER_BIG_TIMEOUT); else p_bs->timeout = 0; } static void reset_10_key(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; BDBG_ASSERT(p_bs); memset(p_bs->majorCh, 0, sizeof(p_bs->majorCh)); memset(p_bs->minorCh, 0, sizeof(p_bs->minorCh)); p_bs->majorChIndex = 0; p_bs->minorChIndex = 0; p_bs->dot = false; p_bs->enter = false; reset_10_key_timeout(p_screen); } static int my_atoi(const char *s) { int i=0; while ((*s >= '0') && (*s <='9')) i = i*10 + *(s++) - '0'; return i; } /* Summary: Banner screen event handler Description: Banner screen event handler. . */ int screen_banner_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; banner_state_t *p_bs; int result = 0; p_bs = (banner_state_t*)p_screen->local_state; BDBG_ASSERT(p_bs); switch (p_event->type) { case eS_EVENT_REDRAW: if (!bapp_eia708_enabled(p_app->eia708) && (p_bs->mode > eLS_BANNER_OFF)) { BDBG_MSG(("%s bapp_eia708_enabled %d, mode = %d\n",__FUNCTION__,bapp_eia708_enabled(p_app->eia708),p_bs->mode)); bapp_sync(p_app); p_app->p_screens[p_app->screen_id].draw(p_app,(void*)&(p_app->p_screens[p_app->screen_id])); bapp_flush_screen(p_app); } break; case eS_EVENT_SETUP: { result = 1; /* always handle event */ /* if showing banner because of 10key, do not reset value */ if (!((p_event->id >= eIR_0) && (p_event->id <= eIR_9))) reset_10_key(p_screen); set_banner(p_screen, eLS_BANNER_MAX, false); /* reset key repeat timeout */ p_bs->repeat_rate = 1; p_bs->repeat_timeout = DEFAULT_REPEAT_TIMEOUT/p_bs->repeat_rate; reset_banner_timeout(p_screen); reset_10_key_timeout(p_screen); screen_null_draw(v_app, v_screen); if (p_app->settings_dirty) { /* user settings have changed so update and retune */ bapp_save_settings(p_app); bapp_apply_settings(p_app); } bapp_tune(p_app); bapp_av_mute(p_app, 0); bapp_audio_mute(p_app, p_app->audio_mute); } break; case eS_EVENT_SETUP_DONE: break; case eS_EVENT_IDLE: { uint32_t current_tick = bos_getticks(); if ((p_bs->auto_power_one_min_warning) && (current_tick < (p_app->last_keypress_tick + MS_TO_TICKS(AUTO_POWER_OFF_TIMEOUT) * (1 + p_app->settings.auto_power) - MS_TO_TICKS(1000 * 60)))) { /* auto power off cancelled */ p_bs->auto_power_one_min_warning = false; bscreen_popup(v_app,v_screen); } else if ((p_app->settings.auto_power != 3) && (current_tick >= (p_app->last_keypress_tick + MS_TO_TICKS(AUTO_POWER_OFF_TIMEOUT) * (1 + p_app->settings.auto_power) - MS_TO_TICKS(1000 * 60)))) { /* show one minute warning before auto power off */ p_bs->auto_power_one_min_warning = true; bscreen_popup(v_app,v_screen); } /* Handle repeating when key is held down */ if (p_bs->repeat_timeout < current_tick) { BDBG_MSG(("%s repeat %d\n",__FUNCTION__,p_bs->event.id)); if (p_bs->event.type == eS_EVENT_IR) { switch (p_bs->event.id) { case eIR_UP: case eIR_CH_UP: bapp_change_channel(p_app,1,1); reset_banner_timeout(p_screen); result = 1; break; case eIR_DOWN: case eIR_CH_DOWN: bapp_change_channel(p_app,0,1); reset_banner_timeout(p_screen); result = 1; break; case eIR_VOL_UP: bapp_set_audio_volume(p_app, p_app->audio_vol + VOLUME_INCREMENT); p_bs->volume_dirty = true; reset_volume_timeout(p_screen); bscreen_popup_draw(v_app,v_screen,eTEXT_VOLUME_TITLE,eTEXT_MAX); break; case eIR_VOL_DOWN: bapp_set_audio_volume(p_app, p_app->audio_vol - VOLUME_INCREMENT); p_bs->volume_dirty = true; reset_volume_timeout(p_screen); bscreen_popup_draw(v_app,v_screen,eTEXT_VOLUME_TITLE,eTEXT_MAX); break; default: break; } } if (p_bs->repeat_rate < MAX_REPEAT_ACCEL) { p_bs->repeat_rate += REPEAT_INC; } p_bs->repeat_timeout = current_tick + (DEFAULT_REPEAT_TIMEOUT/p_bs->repeat_rate); } /* check signal level */ { static bool last_signal_status = true; bool current_signal_status = false; btuner_ds_status ds_status; /* update banner signal level meter if shown */ ///btuner_get_ds_status(p_app->tuner, &ds_status); ds_status.signal_strength = p_app->signal_level; if (p_bs->mode != eLS_BANNER_OFF) { /* draw signal level */ bscreen_draw_banner_signal_level(p_app, ds_status.signal_strength); } /* check for no signal - display/hide popup as necessary */ current_signal_status = bapp_get_signal_status(p_app); if ((!last_signal_status) && (current_signal_status)) { /* going from no signal to valid signal - hide popup */ set_banner(p_screen, eLS_BANNER_MAX, false); reset_banner_timeout(p_screen); /* no need to re-enable cc since we are displaying banner */ bapp_audio_mute(p_app, p_app->audio_mute); bscreen_popup(v_app,v_screen); result = 1; } else if ((last_signal_status) && (!current_signal_status)) { /* going from valid signal to no signal - show popup */ bscreen_popup(v_app, v_screen); /* reset screensaver timeout since we will show no signal popup */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__FUNCTION__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif } last_signal_status = current_signal_status; } /* handle volume timeout */ if ((p_bs->volume_dirty) && (p_bs->volume_timeout) && (current_tick >= p_bs->volume_timeout)) { p_bs->volume_dirty = false; reset_volume_timeout(p_screen); bscreen_popup(v_app,v_screen); result = 1; } /* handle SAP timeout */ if ((p_bs->SAP_dirty) && (p_bs->SAP_timeout) && (current_tick >= p_bs->SAP_timeout)) { p_bs->SAP_dirty = false; reset_SAP_timeout(p_screen); bscreen_popup(v_app,v_screen); result = 1; } /* handle CC timeout */ if ((p_bs->CC_dirty) && (p_bs->CC_timeout) && (current_tick >= p_bs->CC_timeout)) { bapp_set_captions_options(p_app); p_bs->CC_dirty = false; reset_CC_timeout(p_screen); bscreen_popup(v_app,v_screen); result = 1; } /* handle auto power restart timeout */ if (p_app->settings.auto_power_off) { if (p_bs->auto_power_restart_timeout == 0) { reset_auto_power_restart_timeout(p_app, p_screen); bscreen_popup(v_app,v_screen); } else if (current_tick >= p_bs->auto_power_restart_timeout) { p_app->settings.auto_power_off = 0; p_app->settings_dirty = true; reset_auto_power_restart_timeout(p_app, p_screen); bscreen_popup(v_app,v_screen); } } /* handle 10key timeout */ if ((p_bs->ten_key_timeout) && (current_tick >= p_bs->ten_key_timeout)) { /* user has entered some 10key so attempt tune */ /* force drawing of last digit indicator */ p_bs->enter = true; if (p_bs->minorChIndex == 0) { p_bs->minorCh[0] = '1'; p_bs->minorChIndex = 1; } bapp_set_channel(p_app, my_atoi(p_bs->majorCh), my_atoi(p_bs->minorCh)); reset_10_key(p_screen); set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); result = 1; } /* handle timeout of banner */ if ((p_bs->timeout) && (current_tick >= p_bs->timeout)) { set_banner(p_screen, eLS_BANNER_OFF, true); reset_banner_timeout(p_screen); result = 1; } result |= bscreen_default_idle(v_app, v_screen); } break; case eS_EVENT_IR: { /* cancel auto power restart popup */ if ((p_app->settings.auto_power_off) && ((p_event->id & KEY_UP) == 0)) { p_app->settings.auto_power_off = 0; reset_auto_power_restart_timeout(p_app, p_screen); bscreen_popup(v_app,v_screen); } else if (bos_getticks() < (p_app->last_keypress_tick + MS_TO_TICKS(AUTO_POWER_OFF_TIMEOUT) * (1 + p_app->settings.auto_power))) { /* cancel auto power off popup */ bscreen_popup(v_app,v_screen); } /* cancel partial 10key entry if user presses any invalid key */ if ((p_bs->majorChIndex > 0) && ((p_event->id & KEY_UP) == 0)) { if ((p_event->id != eIR_0) && (p_event->id != eIR_1) && (p_event->id != eIR_2) && (p_event->id != eIR_3) && (p_event->id != eIR_4) && (p_event->id != eIR_5) && (p_event->id != eIR_6) && (p_event->id != eIR_7) && (p_event->id != eIR_8) && (p_event->id != eIR_9) && (p_event->id != eIR_DOT) && (p_event->id != eIR_SELECT) && (p_event->id != eIR_ENTER)) { reset_10_key(p_screen); result = 1; } } switch (p_event->id) { case eIR_VOL_UP: bapp_set_audio_volume(p_app, p_app->audio_vol + VOLUME_INCREMENT); p_bs->volume_dirty = true; reset_volume_timeout(p_screen); p_app->audio_mute = false; bscreen_popup(v_app, v_screen); break; case eIR_VOL_DOWN: bapp_set_audio_volume(p_app, p_app->audio_vol - VOLUME_INCREMENT); p_bs->volume_dirty = true; reset_volume_timeout(p_screen); p_app->audio_mute = false; bscreen_popup(v_app, v_screen); break; case eIR_LEFT: break; case eIR_MENU: result = 1; set_banner(p_screen, eLS_BANNER_OFF, true); reset_banner_timeout(p_screen); bapp_set_current_screen(p_app, eSCREEN_MAIN, eSCREEN_NULL); break; case eIR_INFO: if (p_bs->mode == eLS_BANNER_OFF) set_banner(p_screen, eLS_BANNER_SMALL, false); else if (p_bs->mode == eLS_BANNER_SMALL) set_banner(p_screen, eLS_BANNER_BIG, false); else set_banner(p_screen, eLS_BANNER_OFF, false); reset_banner_timeout(p_screen); result = 1; break; case eIR_GUIDE: #if (BCHP_CHIP==3543) if (!(ReadReg32(BCHP_GIO_DATA_HI) & STRP_PROG_LIST_MASK)) #endif { result = 1; bapp_set_current_screen(p_app, eSCREEN_GUIDE, eSCREEN_NULL); } break; case eIR_UP: case eIR_CH_UP: bapp_change_channel(p_app,1,1); set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); result = 1; break; case eIR_DOWN: case eIR_CH_DOWN: bapp_change_channel(p_app,0,1); set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); result = 1; break; case eIR_DOT: if (p_bs->majorChIndex > 0) { p_bs->dot = true; reset_banner_timeout(p_screen); reset_10_key_timeout(p_screen); result = 1; } #ifdef CONFIG_EIA_708 else { if (p_bs->CC_dirty) { p_app->captions_basic++; if (p_app->captions_basic > MAX_CC_SERVICES) { p_app->captions_basic = 0; } } p_bs->CC_dirty = true; reset_CC_timeout(p_screen); /* reset screensaver timeout since we will show CC popup */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__FUNCTION__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif bscreen_popup(v_app, v_screen); } #endif break; case eIR_0: case eIR_1: case eIR_2: case eIR_3: case eIR_4: case eIR_5: case eIR_6: case eIR_7: case eIR_8: case eIR_9: if (p_bs->majorChIndex >= 2) { /* max number of major channel digits have been entered so skip to minor channel digit entry */ p_bs->dot = true; } if (!p_bs->dot) { /* major channel number digit entered */ p_bs->majorCh[p_bs->majorChIndex] = '0' + (p_event->id - eIR_0); p_bs->majorChIndex++; } else { /* minor channel number digit entered */ p_bs->minorCh[p_bs->minorChIndex] = '0' + (p_event->id - eIR_0); p_bs->minorChIndex++; if (p_bs->minorChIndex >= 2) { /* max number of minor channel digits have been entered so immediately tune */ /* force drawing of last digit indicator */ p_bs->enter = true; if (p_bs->minorChIndex == 0) { p_bs->minorCh[0] = '1'; p_bs->minorChIndex = 1; } bapp_set_channel(p_app, my_atoi(p_bs->majorCh), my_atoi(p_bs->minorCh)); reset_10_key(p_screen); } } set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); reset_10_key_timeout(p_screen); result = 1; break; case eIR_ENTER: if (p_bs->majorChIndex > 0) { /* force drawing of channel without '_' */ p_bs->enter = true; if (p_bs->minorChIndex == 0) { p_bs->minorCh[0] = '1'; p_bs->minorChIndex = 1; } bapp_set_channel(p_app, my_atoi(p_bs->majorCh), my_atoi(p_bs->minorCh)); reset_10_key(p_screen); } else { /* channel jump - swap last and current channel numbers */ unsigned int tmp_ch_num = p_app->cur_ch_num; p_app->cur_ch_num = p_app->last_ch_num; p_app->last_ch_num = tmp_ch_num; bapp_tune(p_app); } set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); result = 1; break; case eIR_PRECH: { /* channel jump - swap last and current channel numbers */ unsigned int tmp_ch_num = p_app->cur_ch_num; p_app->cur_ch_num = p_app->last_ch_num; p_app->last_ch_num = tmp_ch_num; bapp_tune(p_app); set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); result = 1; } break; case eIR_MUTE: p_app->audio_mute = !p_app->audio_mute; bapp_audio_mute(p_app, p_app->audio_mute); p_bs->volume_dirty = false; /* override recent previous volume change */ reset_volume_timeout(p_screen); /* reset screensaver timeout if we will show mute popup */ #ifdef CONFIG_SCREENSAVER if (p_app->audio_mute) p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__FUNCTION__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif bscreen_popup(v_app, v_screen); break; case eIR_SELECT: if (p_bs->majorChIndex > 0) { /* force drawing of channel without '_' */ p_bs->enter = true; if (p_bs->minorChIndex == 0) { p_bs->minorCh[0] = '1'; p_bs->minorChIndex = 1; } bapp_set_channel(p_app, my_atoi(p_bs->majorCh), my_atoi(p_bs->minorCh)); reset_10_key(p_screen); set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); result = 1; } else if (p_app->settings.sound == 1) { bapp_rotate_audio_sap(p_app); p_bs->SAP_dirty = true; reset_SAP_timeout(p_screen); /* reset screensaver timeout since we will show SAP popup */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); #endif bscreen_popup(v_app, v_screen); } break; } } p_bs->event = *p_event; /* reset key repeat timeout */ p_bs->repeat_rate = 1; p_bs->repeat_timeout = bos_getticks() + (DEFAULT_REPEAT_TIMEOUT/p_bs->repeat_rate); /* Since the tuning time can be greater than the repeat timeout increase it to handle these cases */ switch (p_event->id) { case eIR_UP: case eIR_CH_UP: case eIR_DOWN: case eIR_CH_DOWN: p_bs->repeat_timeout += (DEFAULT_REPEAT_TIMEOUT/p_bs->repeat_rate); #ifdef BQAM_SCRIPT /* Since 3409 can take so long to tune increase further */ p_bs->repeat_timeout += (DEFAULT_REPEAT_TIMEOUT/p_bs->repeat_rate); #endif break; default: break; } break; default: case eS_EVENT_SELECTED: case eS_EVENT_CHECKED: { result = bscreen_default_event(v_app,v_screen,p_event); } break; } return result; } /* Summary: screensaver screen event handler Description: screensaver screen event handler. . */ int screen_screensaver_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; screensaver_state_t *p_ss = (screensaver_state_t*)p_screen->local_state; BDBG_ASSERT(p_ss); switch (p_event->type) { case eS_EVENT_IDLE: if (bos_getticks() >= p_ss->image_swap_timeout) { /* redraw window */ result = 1; p_ss->image_swap_timeout = bos_getticks() + MS_TO_TICKS(SCREENSAVER_IMAGE_TIMEOUT); } if (!result) result = bscreen_default_idle(v_app, v_screen); break; case eS_EVENT_SETUP: { p_ss->image_swap_timeout = bos_getticks() + MS_TO_TICKS(SCREENSAVER_IMAGE_TIMEOUT); bapp_set_palette(p_app, ePALETTE_SCREENSAVER); } break; case eS_EVENT_IR: if ((p_event->id & KEY_UP) == 0) { bapp_set_palette(p_app, ePALETTE_DEFAULT); screen_null_draw(v_app, v_screen); bapp_goto_last_screen(p_app); /* recheck ratings block status which may have changed while in screensaver */ bapp_handle_blocking(p_app); result = 1; } break; default: break; } return result; /* always handle event */ } /* Summary: Power off screen event handler Description: Power off screen event handler. . */ int screen_power_off_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { #ifdef CONFIG_SCREENSAVER bapp_t *p_app = (bapp_t*)v_app; #endif int result = 0; switch (p_event->type) { case eS_EVENT_SETUP: #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__FUNCTION__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif result = 1; break; default: break; } return result; /* always handle event */ } /* Summary: Default screen event handler Description: Default screen event handler. . */ int bscreen_default_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; switch (p_event->type) { default: case eS_EVENT_IDLE: result = bscreen_default_idle(v_app,v_screen); break; case eS_EVENT_REDRAW: break; case eS_EVENT_SETUP: bscreen_default_setup(v_app,v_screen); result = 1; break; case eS_EVENT_SELECTED: result = (p_screen->button_selection == p_event->id) ? 1 : 0; break; case eS_EVENT_CHECKED: result = (p_screen->button_checked == p_event->id) ? 1 : 0; break; case eS_EVENT_IR: switch (p_event->id) { case eIR_INFO: break; case eIR_LEFT: case eIR_MENU: result = 1; if (p_app->screen_id == eSCREEN_MAIN) bapp_set_current_screen(p_app, eSCREEN_NULL, eSCREEN_NULL); else bapp_goto_last_screen(p_app); break; case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_UP: result = next_button(v_app,v_screen,1); break; case eIR_DOWN: result = next_button(v_app,v_screen,0); break; case eIR_1: case eIR_2: case eIR_3: case eIR_4: case eIR_5: case eIR_6: case eIR_7: case eIR_8: case eIR_9: if ((p_event->id - 1) < p_screen->num_buttons) { bscreen_event_t event; p_screen->button_selection = p_event->id - 1; event.id = eIR_SELECT; event.type = eS_EVENT_IR; result = p_screen->handle_event(p_app,p_screen,&event); } break; default: /* Do nothing */ break; } break; } return result; /* always handle event */ } /* Summary: NULL screen drawing function Description: NULL screen drawing function. . */ void screen_null_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bgfx_fill_rect(&p_app->surf,0,0,eWIDTH,eHEIGHT,eCOLOR_CLEAR); } /* Summary: NULL screen drawing function for banner Description: NULL screen drawing function for banner . */ void banner_null_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; if (bapp_eia708_enabled(p_app->eia708)) return; bgfx_fill_rect(&p_app->surf,eBANNER_X,eBANNER_Y, eBANNER_WIDTH,eBANNER_SMALL_HEIGHT+eBANNER_LARGE_HEIGHT,eCOLOR_CLEAR); } /* Summary: NULL screen drawing function for status popup Description: NULL screen drawing function for status popup . */ void popup_null_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; // bscreen_t *p_screen = (bscreen_t*)v_screen; bgfx_fill_rect(&p_app->surf,eBANNER_STATUS_X,eBANNER_STATUS_Y, eBANNER_STATUS_WIDTH,eBANNER_STATUS_HEIGHT,eCOLOR_CLEAR); } static void draw_navigation_hints(void *v_app, void *v_screen) { bapp_t * p_app = (bapp_t*)v_app; bscreen_t * p_screen = (bscreen_t*)v_screen; unsigned int num_chars = SCREEN_MAX_STR_WIDTH; int w = 0; int h = 0; int i; bscreen_get_string(p_app->lang,p_screen->help_text_id, p_app->tmp_str, &num_chars); for (i = 0; i < num_chars; ++i) { if (p_app->tmp_str[i] == 0x00000031) { p_app->tmp_str[i] = 0x193;/* up */ } else if (p_app->tmp_str[i] == 0x00000032) { p_app->tmp_str[i] = 0x194;/* down */ } else if (p_app->tmp_str[i] == 0x00000033) { p_app->tmp_str[i] = 0x195;/* left */ } else if (p_app->tmp_str[i] == 0x00000034) { p_app->tmp_str[i] = 0x196;/* right */ } } bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ((eWIDTH/2)-(w/2)), eMENU_INFO_Y, w+5, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); } /* Summary: Default screen setup function Description: Default screen setup function used to set initial state before drawing. */ void bscreen_default_setup(void *v_app, void *v_screen) { bscreen_t *p_screen = (bscreen_t*)v_screen; if ((p_screen->button_selection + 1) > p_screen->num_buttons) p_screen->button_selection = 0; p_screen->button_checked = 0; } /* Summary: Default screen drawing function Description: Default screen drawing function. . */ void bscreen_default_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; int yoff = 0; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); if ((p_app->lang == eLANG_FRENCH) && (p_app->screen_id == eSCREEN_CAPTIONS_FONT)) yoff += 7; /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y - yoff, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); if ((p_app->lang == eLANG_FRENCH) && (p_app->screen_id == eSCREEN_CAPTIONS_FONT)) yoff += 4; /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y - yoff, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); bscreen_draw_buttons(v_app,v_screen); draw_navigation_hints(v_app, v_screen); } /* Summary: Antenna screen drawing function Description: Antenna screen drawing function. . */ void bscreen_antenna_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int w, h; unsigned int num_chars; char strPercent[] = "100%"; static char version[128]; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw progress meter label */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_SIGNAL_LEVEL, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X, ePROGRESS_Y - h - ePROGRESS_LABEL_SPACING, w + 1, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw progress meter */ bscreen_draw_progress(v_app, ePROGRESS_X, ePROGRESS_Y, ePROGRESS_WIDTH, ePROGRESS_HEIGHT, eBUTTON_PROGRESS_BORDER, eCOLOR_WHITE, eCOLOR_DRK_BLUE, p_app->tmp_value); /* draw percent compete text */ num_chars = SCREEN_MAX_STR_WIDTH; snprintf(strPercent, strlen(strPercent), "%3d%%", p_app->tmp_value); num_chars = c_to_uni_str(strPercent,p_app->tmp_str,num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_MED], ePROGRESS_X + ePROGRESS_WIDTH + ePROGRESS_LABEL_SPACING, ePROGRESS_Y + (ePROGRESS_HEIGHT / 2) - (h / 2), w + 10, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); draw_navigation_hints(v_app, v_screen); num_chars = SCREEN_MAX_STR_WIDTH; snprintf(version, 128, "Version: %d.%d.%d, %s", MAJOR_VERSION,MINOR_VERSION,SUB_VERSION,__DATE__); num_chars = c_to_uni_str(version,p_app->tmp_str,num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X, eMENU_INFO_Y - (2 * h), w, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); } /* Summary: Ch scan progress screen drawing function Description: Ch scan progress screen drawing function. . */ void bscreen_ch_scan_progress_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int w, h; unsigned int num_chars; char strPercent[] = "100%"; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw progress meter label */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_CH_SCAN_COMPLETE_LEVEL, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X, ePROGRESS_Y - h - ePROGRESS_LABEL_SPACING, w + 1, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw progress meter */ bscreen_draw_progress(v_app, ePROGRESS_X, ePROGRESS_Y, ePROGRESS_WIDTH, ePROGRESS_HEIGHT, eBUTTON_PROGRESS_BORDER, eCOLOR_WHITE, eCOLOR_DRK_BLUE, p_app->tmp_value); /* draw percent compete text */ num_chars = SCREEN_MAX_STR_WIDTH; snprintf(strPercent, strlen(strPercent), "%3d%%", p_app->tmp_value); num_chars = c_to_uni_str(strPercent,p_app->tmp_str,num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_MED], ePROGRESS_X + ePROGRESS_WIDTH + ePROGRESS_LABEL_SPACING, ePROGRESS_Y + (ePROGRESS_HEIGHT / 2) - (h / 2), w + 10, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw number of channels found */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_CH_SCAN_FOUND, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X, ePROGRESS_Y + (ePROGRESS_HEIGHT * 2) , w + 1, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); draw_navigation_hints(v_app, v_screen); } /* Summary: Wizard welcome screen drawing function Description: Wizard welcome screen drawing function. . */ void bscreen_wiz_welcome_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; #ifndef CONFIG_LOGO #else #error "No Logo" bin_read_t br; br.cnt = 0; br.data = (void*)g_p_dsp->ui_comp.logo; br.size = g_p_dsp->ui_comp.logo_size; #endif bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); bscreen_draw_buttons(v_app,v_screen); /* TODO: draw logo */ #ifdef CONFIG_LOGO bgfx_render_file(&(p_app->surf), eLOGO_X, eLOGO_Y, &br, 0); #endif draw_navigation_hints(v_app, v_screen); } /* Summary: Wizard done screen drawing function Description: Wizard done screen drawing function. . */ void bscreen_wiz_done_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; #ifndef CONFIG_LOGO #else bin_read_t br; br.cnt = 0; br.data = (void*)g_p_dsp->ui_comp.logo; br.size = g_p_dsp->ui_comp.logo_size; #endif bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); bscreen_draw_buttons(v_app,v_screen); /* TODO: draw logo */ #ifdef CONFIG_LOGO bgfx_render_file(&(p_app->surf), eLOGO_X, eLOGO_Y, &br, 0); #endif draw_navigation_hints(v_app, v_screen); } /* Summary: Wiz ch scan screen drawing function Description: Wiz ch scan screen drawing function. . */ void bscreen_wiz_ch_scan_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; int w, h; char strChFound[5]; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); bscreen_draw_buttons(v_app,v_screen); /* draw number of channels found (text) */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_WIZ_CH_SCAN_NUM_CHANNELS, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X, eMENU_INFO_Y - ePROGRESS_HEIGHT + 8 , w + 1, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw number of channels found (number) */ num_chars = SCREEN_MAX_STR_WIDTH; snprintf(strChFound, 4, "%3d", p_app->settings.num_channels); num_chars = c_to_uni_str(strChFound,p_app->tmp_str,num_chars); bgfx_fill_rect(&p_app->surf,ePROGRESS_X + w, eMENU_INFO_Y - ePROGRESS_HEIGHT, 40, eMENU_TITLE_TEXT_HEIGHT,eCOLOR_MED_BLUE); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X + w, eMENU_INFO_Y - ePROGRESS_HEIGHT + 8 , 40, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); draw_navigation_hints(v_app, v_screen); } /* Summary: PIN screen drawing function Description: PIN screen drawing function. . */ void bscreen_pin_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars,w,h; unsigned int field = 0; static char tmp_prog[64]; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); if (p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) { /* draw ratings - show blocked rating, if no blocked ratings then show received xds or psip rating if corresponding rating string exists */ num_chars = SCREEN_MAX_STR_WIDTH; tmp_prog[0] = 0; bscreen_get_string(p_app->lang,eTEXT_RATINGS_BUTTON, p_app->tmp_str, &num_chars); p_app->tmp_str[num_chars++] = (unsigned int)':'; p_app->tmp_str[num_chars++] = (unsigned int)' '; p_app->tmp_str[num_chars++] = (unsigned int)' '; text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_MED], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y + 60, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); if (p_app->prog_rating_str[0] != 0) { strncpy_no_spaces(tmp_prog,(char*)p_app->prog_rating_str,63); BDBG_WRN(("%s - analog: %s\n",__FUNCTION__, tmp_prog)); } if (p_app->psip_rating_str[0] != 0) { strncpy_no_spaces(tmp_prog,(char*)p_app->psip_rating_str,63); BDBG_WRN(("%s - digital: %s\n",__FUNCTION__, tmp_prog)); } num_chars = strlen(tmp_prog); if (num_chars) { num_chars = c_to_uni_str(tmp_prog,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_MED], eMENU_TITLE_DESC_TEXT_X + w, eMENU_TITLE_DESC_TEXT_Y + 60, eMENU_TITLE_DESC_TEXT_WIDTH, eBANNER_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); } else { BDBG_WRN(("%s - rating string empty\n",__FUNCTION__)); } } /* draw pin fields */ for (field = 0; field < 4; field++) { bscreen_draw_pin(v_app, ePIN_X, ePIN_Y+(p_screen->top_banner_height-eMENU_TITLE_AREA_HEIGHT_1_LINE)/2, ePIN_WIDTH, ePIN_HEIGHT, ePIN_INC_X, p_app->tmp_value, field); } draw_navigation_hints(v_app, v_screen); } /* Summary: Popup screen drawing function Description: Popup screen drawing function. If 'desc' is set to eTEXT_MAX then banner height is adjusted to show the title only. If 'title' is set to eTEXT_VOLUME_TITLE then volume slider is displayed next to title. If 'title' and 'desc' are set to eTEXT_MAX then popup is hidden. . */ #define TMP_BUF_CHAR_MAX 16 static char tmp_buf[TMP_BUF_CHAR_MAX]; void bscreen_popup_draw(void *v_app, void *v_screen, btext_id_t title, btext_id_t desc) { bapp_t *p_app = (bapp_t*)v_app; int i = 0; unsigned int progress_width = 0; int w = 0; int h = 0; unsigned int num_chars; unsigned int banner_height = eBANNER_STATUS_HEIGHT; unsigned int banner_y = eBANNER_STATUS_Y; unsigned int banner_title_y = eBANNER_POPUP_TITLE_Y; unsigned int title_newX = eBANNER_POPUP_TITLE_X; static unsigned int last_title = eTEXT_MAX; static bapp_lang_t last_lang = eLANG_MAX; if (bapp_eia708_enabled(p_app->eia708)) return; if (p_app->screen_id != eSCREEN_BANNER_SMALL) return; #ifndef CONFIG_ORIG_SYNC bapp_sync(p_app); #endif if ((title == eTEXT_MAX) && (desc == eTEXT_MAX)) { popup_null_draw(v_app,v_screen); last_title = eTEXT_MAX; last_lang = eLANG_MAX; #ifndef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif return; } if ((last_title != title) || (last_lang != p_app->lang)) popup_null_draw(v_app,v_screen); if (desc == eTEXT_MAX) { /* resize banner for title only display */ banner_y += eBANNER_STATUS_TITLE_ONLY_Y_OFFSET; banner_height = eBANNER_STATUS_TITLE_ONLY_HEIGHT; banner_title_y += eBANNER_STATUS_TITLE_ONLY_Y_OFFSET; } /* do not draw these parts if already shown */ /* JPF if ((last_title != title) || (last_lang != p_app->lang)) */ { #ifdef CONFIG_ORIG_SYNC bapp_sync(p_app); #endif /* draw popup with semi-transparent background */ bgfx_fill_rect(&p_app->surf,eBANNER_STATUS_X,banner_y, eBANNER_STATUS_WIDTH,banner_height,eCOLOR_BLACK); for (i = 0; i < 4; i++) { bgfx_h_draw_line(&p_app->surf,eBANNER_STATUS_X+i,eBANNER_STATUS_X+eBANNER_STATUS_WIDTH-i, banner_y+i,eCOLOR_BLACK); bgfx_h_draw_line(&p_app->surf,eBANNER_STATUS_X+i,eBANNER_STATUS_X+eBANNER_STATUS_WIDTH-i, banner_y+banner_height-1-i,eCOLOR_BLACK); } /* draw popup title */ if (title != eTEXT_MAX) { num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,title, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], title_newX, banner_title_y, eBANNER_POPUP_TITLE_WIDTH, eBANNER_POPUP_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); } #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif /* draw popup description field */ if (desc != eTEXT_MAX) { static char strAutoPower[1024]; char* p_str; #ifdef CONFIG_ORIG_SYNC bapp_sync(p_app); #endif num_chars = MAX_DESC_CHARS; if (desc == eTEXT_AUTO_POWER_RESTART_DESC) { p_str = (char*)g_p_dsp->ui_comp.str_table[p_app->lang][eTEXT_AUTO_POWER_RESTART_DESC]; snprintf(strAutoPower, 1024, p_str, (p_app->settings.auto_power + 1) * 4); num_chars = c_to_uni_str(strAutoPower, p_app->tmp_str, MAX_DESC_CHARS); } else if (desc == eTEXT_AUTO_POWER_POPUP_DESC) { p_str = (char*)g_p_dsp->ui_comp.str_table[p_app->lang][eTEXT_AUTO_POWER_POPUP_DESC]; snprintf(strAutoPower, 1024, p_str, (p_app->settings.auto_power + 1) * 4); num_chars = c_to_uni_str(strAutoPower, p_app->tmp_str, MAX_DESC_CHARS); } else { bscreen_get_string(p_app->lang,desc, p_app->tmp_str, &num_chars); } text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_POPUP_DESC_X, (title == eTEXT_MAX ? banner_title_y : eBANNER_POPUP_DESC_Y), eBANNER_POPUP_DESC_WIDTH, (title == eTEXT_MAX ? eBANNER_POPUP_DESC_HEIGHT + 10 : eBANNER_POPUP_DESC_HEIGHT), p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,5); #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif } } /* add SAP language if necessary */ if ((title == eTEXT_SAP_TITLE) || (title == eTEXT_VOLUME_TITLE)) { w = h = 0; /* move title_newX past title */ num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,title, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); title_newX += w; num_chars = MAX_TITLE_CHARS; if (p_app->settings.ch[p_app->cur_ch_num].has_lang & (1 << p_app->current_sap)) { switch (p_app->current_sap) { case eLANG_SPANISH: bscreen_get_string(p_app->current_sap,eTEXT_SPANISH_BUTTON, p_app->tmp_str, &num_chars); break; case eLANG_FRENCH: bscreen_get_string(p_app->current_sap,eTEXT_FRENCH_BUTTON, p_app->tmp_str, &num_chars); break; case eLANG_ENGLISH: default: bscreen_get_string(p_app->current_sap,eTEXT_ENGLISH_BUTTON, p_app->tmp_str, &num_chars); break; } } else { memset(tmp_buf,0,TMP_BUF_CHAR_MAX); num_chars = TMP_BUF_CHAR_MAX - 1; snprintf(tmp_buf, num_chars, "Audio-%d", p_app->current_sap + 1); num_chars = c_to_uni_str(tmp_buf,p_app->tmp_str,MAX_TITLE_CHARS); } /* add ending parenthesis if volume popup */ if ((title == eTEXT_VOLUME_TITLE) && (num_chars < MAX_TITLE_CHARS)) { c_to_uni_str(")",&p_app->tmp_str[num_chars],2); num_chars++; } /* erase last language text */ bgfx_fill_rect(&p_app->surf,eBANNER_POPUP_TITLE_X + w,banner_title_y, eBANNER_POPUP_TITLE_WIDTH - w, eBANNER_POPUP_TITLE_HEIGHT, eCOLOR_BLACK); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], title_newX, banner_title_y, eBANNER_POPUP_TITLE_WIDTH - w, eBANNER_POPUP_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); } /* add CC language if necessary */ if (title == eTEXT_CC_TITLE) { int w = 0; int h = 0; /* move title_newX past title */ num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,title, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); title_newX += w; num_chars = MAX_TITLE_CHARS; if (p_app->captions_basic > 0) { char strCC[16]; PSIP_CSD_service *cc_service = &(p_app->tmp_info.eit_info[EIT_CURRENT].cc_service[p_app->captions_basic - 1]); if (cc_service->cc_type) { snprintf(strCC, 15, "%d (%c%c%c)", p_app->captions_basic,cc_service->language[0],cc_service->language[1],cc_service->language[2]); } else snprintf(strCC, 15, "%d", p_app->captions_basic); num_chars = c_to_uni_str(strCC, p_app->tmp_str, MAX_TITLE_CHARS); } else { num_chars = c_to_uni_str("Captions Off", p_app->tmp_str, MAX_TITLE_CHARS); } /* erase last caption popup text */ bgfx_fill_rect(&p_app->surf,eBANNER_POPUP_TITLE_X + w,banner_title_y, eBANNER_POPUP_TITLE_WIDTH - w, eBANNER_POPUP_TITLE_HEIGHT, eCOLOR_BLACK); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], title_newX, banner_title_y, eBANNER_POPUP_TITLE_WIDTH - w, eBANNER_POPUP_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); } /* draw volume slider if necessary */ if (title == eTEXT_VOLUME_TITLE) { w = h = 0; bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); title_newX += w + 10; progress_width = eBANNER_STATUS_X + eBANNER_STATUS_WIDTH - title_newX - 75; bscreen_draw_progress(v_app, title_newX, banner_title_y-2, progress_width, ePROGRESS_VOLUME_HEIGHT, eBUTTON_VOL_PROGRESS_BORDER, eCOLOR_WHITE, eCOLOR_BLACK, p_app->audio_vol); /* draw volume level text */ memset(tmp_buf,0,sizeof(TMP_BUF_CHAR_MAX)); num_chars = TMP_BUF_CHAR_MAX - 1; snprintf(tmp_buf, num_chars, "%3u", p_app->audio_vol); num_chars = c_to_uni_str(tmp_buf,p_app->tmp_str,MAX_TITLE_CHARS); #ifdef CONFIG_ORIG_SYNC bapp_sync(p_app); #endif bgfx_fill_rect(&p_app->surf,ePROGRESS_VOLUME_X+ePROGRESS_VOLUME_WIDTH+10,banner_title_y, eBANNER_POPUP_VOL_TITLE_WIDTH,eBANNER_POPUP_TITLE_HEIGHT,eCOLOR_BLACK); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_VOLUME_X+ePROGRESS_VOLUME_WIDTH+10, banner_title_y, eBANNER_POPUP_VOL_TITLE_WIDTH, eBANNER_POPUP_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif } #ifndef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif last_title = title; last_lang = p_app->lang; } /* Summary: RRT dimensions screen drawing function Description: RRT dimensions screen drawing function. . */ void bscreen_rrt_dim_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int idx,selected,checked, max_rrt_num; unsigned int num_chars; bbutton_t tmp_button; PSIP_RRT_dimension dim; PSIP_RRT_header rrt_header; char dim_str[64]; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); #ifdef TEST_RRT max_rrt_num = MAX_RRT_DIM; #else PSIP_RRT_getHeader(p_app->settings.rrt,&rrt_header); max_rrt_num = SCREEN_MIN((p_screen->local_state + MAX_RRT_DIM_BUTTONS), rrt_header.dimensions_defined); #endif /* draw buttons (replace text with strings from the RRT) */ for (idx = p_screen->local_state; idx < max_rrt_num; idx++) { if ((idx - p_screen->local_state) >= MAX_RRT_DIM_BUTTONS) { BDBG_WRN(("%s invalid button index %d, %d, %d\n",__FUNCTION__,idx,p_screen->local_state,max_rrt_num)); break; } tmp_button = p_screen->p_button_array[(idx - p_screen->local_state)]; #ifdef TEST_RRT snprintf(dim_str,64,"DIM-%d",idx); #else if (PSIP_RRT_getDimension(p_app->settings.rrt,idx,&dim) == BERR_SUCCESS) { if (chm_process_mss(&p_app->chm,dim.p_dimension_name_text,dim_str,sizeof(dim_str)) != 0) dim_str[0] = 0; } else dim_str[0] = 0; #endif selected = (p_screen->button_selection == (idx - p_screen->local_state)); checked = 0; bscreen_draw_button_custom_text(p_app,&tmp_button,dim_str,NULL,selected,checked,(idx - p_screen->local_state)); } draw_navigation_hints(v_app, v_screen); } /* Summary: RRT values screen drawing function Description: RRT values screen drawing function. . */ void bscreen_rrt_val_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; int idx,max_val_num,selected,checked; PSIP_RRT_dimension dim; PSIP_RRT_value val; bbutton_t tmp_button; int dim_idx = p_app->p_screens[eSCREEN_RATINGS_RRT_DIM].button_selection + p_app->p_screens[eSCREEN_RATINGS_RRT_DIM].local_state; const int VAL_STR_LEN = 64; char val_str[VAL_STR_LEN]; char abbr_val_str[VAL_STR_LEN]; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); #ifdef TEST_RRT max_val_num = MAX_RRT_VAL; #else if (PSIP_RRT_getDimension(p_app->settings.rrt,dim_idx,&dim) != BERR_SUCCESS) dim.values_defined = 0; max_val_num = SCREEN_MIN((p_screen->local_state + MAX_RRT_VAL_BUTTONS), dim.values_defined); #endif /* draw buttons (replace text with strings from the RRT) */ for (idx = p_screen->local_state; idx < max_val_num; idx++) { if ((idx - p_screen->local_state) >= MAX_RRT_VAL_BUTTONS) { BDBG_WRN(("%s invalid button index %d, %d, %d\n",__FUNCTION__,idx,p_screen->local_state,max_val_num)); break; } tmp_button = p_screen->p_button_array[(idx - p_screen->local_state)]; #ifdef TEST_RRT snprintf(val_str,64,"VALUE-%d",idx); snprintf(abbr_val_str,64,"VAL-%d",idx); #else if (PSIP_RRT_getValue(p_app->settings.rrt,dim_idx,idx,&val) == BERR_SUCCESS) { if (chm_process_mss(&p_app->chm,val.p_rating_value_text,val_str,VAL_STR_LEN) != 0) val_str[0] = 0; if (chm_process_mss(&p_app->chm,val.p_abbrev_rating_value_text,abbr_val_str,VAL_STR_LEN) != 0) abbr_val_str[0] = 0; } else { val_str[0] = 0; abbr_val_str[0] = 0; } #endif BDBG_MSG(("drawing RRT abbr_val_str:%s val_str:%s\n",abbr_val_str, val_str)); selected = (p_screen->button_selection == (idx - p_screen->local_state)); checked = (p_app->settings.ratings_rrt[dim_idx] & (1 << idx)); bscreen_draw_button_custom_text(p_app,&p_screen->p_button_array[(idx - p_screen->local_state)],abbr_val_str,NULL,selected,checked,(idx - p_screen->local_state)); } draw_navigation_hints(v_app, v_screen); } void bscreen_popup(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; bool signal_status = false; btuner_ds_status ds_status; banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; BDBG_ASSERT(p_bs); if (p_app->screen_id != eSCREEN_BANNER_SMALL) return; signal_status = bapp_get_signal_status(p_app); // btuner_get_ds_status(p_app->tuner, &ds_status); ds_status.signal_strength = p_app->signal_level; /* set CC state */ if ((p_bs->volume_dirty) || (!signal_status) || (p_app->audio_mute) || (p_bs->SAP_dirty) || (p_bs->CC_dirty) || (p_bs->mode != eLS_BANNER_OFF)) bapp_enable_cc(p_app, 0); else bapp_enable_cc(p_app, 1); #ifdef CONFIG_ORIG_SYNC /* resync because enable/disable cc takes a long time */ bapp_flush_screen(p_app); bapp_sync(p_app); #endif if (bapp_eia708_enabled(p_app->eia708)) return; /* draw popup - order dictates priority */ if (p_bs->volume_dirty) { BDBG_MSG(("%s p_bs->volume_dirty %d\n",__FUNCTION__,p_bs->volume_dirty)); /* draw 'volume' popup if necessary */ bscreen_popup_draw(v_app,v_screen,eTEXT_VOLUME_TITLE,eTEXT_MAX); } else if (p_bs->SAP_dirty) { BDBG_MSG(("%s p_bs->SAP_dirty %d\n",__FUNCTION__,p_bs->SAP_dirty)); /* draw SAP popup if necessary */ bscreen_popup_draw(v_app,v_screen,eTEXT_SAP_TITLE,eTEXT_MAX); } else if (p_bs->CC_dirty) { BDBG_MSG(("%s p_bs->SAP_dirty %d\n",__FUNCTION__,p_bs->CC_dirty)); /* draw CC popup if necessary */ bscreen_popup_draw(v_app,v_screen,eTEXT_CC_TITLE,eTEXT_MAX); } else if (p_app->settings.auto_power_off) { /* show auto power off reason on startup */ BDBG_MSG(("%s p_app->settings.auto_power_off %d\n",__FUNCTION__,p_app->settings.auto_power_off)); bscreen_popup_draw(v_app,v_screen,eTEXT_MAX,eTEXT_AUTO_POWER_RESTART_DESC); } else if (p_bs->auto_power_one_min_warning && (bos_getticks() >= (p_app->last_keypress_tick + MS_TO_TICKS(AUTO_POWER_OFF_TIMEOUT) * (1 + p_app->settings.auto_power) - MS_TO_TICKS(1000 * 60)))) { /* one minute warning before auto power off */ bscreen_popup_draw(v_app,v_screen,eTEXT_AUTO_POWER_MENU,eTEXT_AUTO_POWER_POPUP_DESC); } else if (!signal_status && (p_app->settings.ch[p_app->cur_ch_num].freq_idx != 0x7F)) { /* draw 'no signal' popup if necessary */ BDBG_MSG(("%s signal_status %d\n",__FUNCTION__,signal_status)); bapp_audio_mute(p_app, 1); bscreen_popup_draw(v_app,v_screen,eTEXT_NO_SIGNAL_TITLE,eTEXT_NO_SIGNAL_DESC); } else if (p_app->audio_mute) { /* draw 'mute' popup if necessary */ bscreen_popup_draw(v_app,v_screen,eTEXT_MAX,eTEXT_MAX); bscreen_popup_draw(v_app,v_screen,eTEXT_MUTE_TITLE,eTEXT_MAX); } else { BDBG_MSG(("%s%d bscreen_popup_draw\n",__FUNCTION__,__LINE__)); bscreen_popup_draw(v_app,v_screen,eTEXT_MAX,eTEXT_MAX); } } /* Summary: Banner screen drawing function Description: Banner screen drawing function. . */ void bscreen_banner_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars,w,h; unsigned char *p_str; bstream_mpeg mpeg; static char tbuf[16]; int i = 0; bool dst; unsigned utc_time; int offset; static struct tm s_tm; banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; BDBG_ASSERT(p_bs); static int last_mode = eLS_BANNER_OFF; btuner_ds_status ds_status; static char tmp_prog[MAX_RATING_STR]; num_chars = 0; BDBG_MSG(("%s:%d, mode = %d, last = %d\n",__FUNCTION__,__LINE__,p_bs->mode,last_mode)); if (((last_mode == eLS_BANNER_BIG) && (p_bs->mode != eLS_BANNER_BIG)) || (p_bs->mode == eLS_BANNER_OFF)) banner_null_draw(v_app,v_screen); bscreen_popup(v_app, v_screen); if (bapp_eia708_enabled(p_app->eia708)) return; /* get the current banner info */ chm_get_cur_ch_info(&p_app->chm,&p_app->tmp_info,&mpeg); /* don't redraw small banner if going from small -> large banner */ if (((last_mode != eLS_BANNER_SMALL) || (p_bs->mode != eLS_BANNER_BIG)) && (p_bs->mode != eLS_BANNER_OFF)) { /* resync before drawing small banner data */ #ifdef CONFIG_ORIG_SYNC bapp_sync(p_app); #endif /* draw small banner with semi-transparent background */ bgfx_fill_rect(&p_app->surf,eBANNER_X,eBANNER_Y, eBANNER_WIDTH,eBANNER_SMALL_HEIGHT,eCOLOR_BLACK); for (i = 0; i < 4; i++) { bgfx_h_draw_line(&p_app->surf,eBANNER_X+i,eBANNER_X+eBANNER_WIDTH-i, eBANNER_Y+i,eCOLOR_BLACK); bgfx_h_draw_line(&p_app->surf,eBANNER_X+i,eBANNER_X+eBANNER_WIDTH-i, eBANNER_Y+eBANNER_SMALL_HEIGHT-1-i,eCOLOR_BLACK); } #ifdef CONFIG_ORIG_SYNC /* resync before drawing small banner data */ bapp_flush_screen(p_app); bapp_sync(p_app); #endif /* draw program title */ p_str = (unsigned char*)p_app->tmp_info.eit_info[EIT_CURRENT].prog_title; num_chars = c_to_uni_str(p_str,p_app->tmp_str,MAX_TITLE_CHARS); if (num_chars == 0) { num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,eTEXT_BANNER_PROGRAM_TITLE, p_app->tmp_str, &num_chars); } text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_TITLE_X, eBANNER_TITLE_Y, eBANNER_TITLE_WIDTH, eBANNER_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); /* draw channel num */ num_chars = SCREEN_MAX_STR_WIDTH; if (p_bs->enter) { /* user has finish 10keying in a new channel num */ snprintf(tbuf,6,"%s - %s",p_bs->majorCh,p_bs->minorCh); } else if (p_bs->majorChIndex > 0) { /* user is 10keying in new channel num */ if (p_bs->minorChIndex == 0) if (p_bs->dot) snprintf(tbuf,7,"%s - _", p_bs->majorCh); else snprintf(tbuf,4,"%s_", p_bs->majorCh); else snprintf(tbuf,9,"%s - %s_", p_bs->majorCh,p_bs->minorCh); } else { /* display current channel */ snprintf(tbuf,9,"%d - %d", p_app->settings.ch[p_app->cur_ch_num].major,p_app->settings.ch[p_app->cur_ch_num].minor); } num_chars = c_to_uni_str(tbuf,p_app->tmp_str,num_chars); #ifdef BQAM_SCRIPT text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_CH_NUM_X - 20, eBANNER_CH_NUM_Y, eBANNER_CH_NUM_WIDTH + 25, eBANNER_CH_NUM_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); #else text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_CH_NUM_X, eBANNER_CH_NUM_Y, eBANNER_CH_NUM_WIDTH, eBANNER_CH_NUM_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); #endif /* draw call sign */ num_chars = MAX_CH_NAME_CHARS; num_chars = utf16_to_uni_str(p_app->settings.ch[p_app->cur_ch_num].ch_name,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_CALLSIGN_X, eBANNER_CALLSIGN_Y, eBANNER_CALLSIGN_WIDTH, eBANNER_CALLSIGN_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); /* draw next program title */ p_str = (unsigned char*)p_app->tmp_info.eit_info[EIT_NEXT].prog_title; num_chars = c_to_uni_str(p_str,p_app->tmp_str,MAX_TITLE_CHARS); if (num_chars > 0) { int w = 0; int h = 0; num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,eTEXT_BANNER_NEXT_PROGRAM_TITLE_PREFIX, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], (const unsigned long *)p_app->tmp_str,num_chars,&w,&h); w += 3; text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_TITLE_X, eBANNER_NEXT_TITLE_Y, w, eBANNER_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); p_str = (unsigned char*)p_app->tmp_info.eit_info[EIT_NEXT].prog_title; num_chars = c_to_uni_str(p_str,p_app->tmp_str,MAX_TITLE_CHARS); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_TITLE_X + w, eBANNER_NEXT_TITLE_Y, eBANNER_TITLE_WIDTH - w, eBANNER_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); } /* draw time */ num_chars = MAX_TIME_STR; p_app->prog_time_str[0] = 0; if (chm_get_time_info(&p_app->chm,&utc_time,&offset,&dst) == 0) { utc_time += offset; utctime(utc_time,&s_tm); if (s_tm.tm_hour >= 12) { if (s_tm.tm_hour > 12) s_tm.tm_hour -= 12; snprintf(p_app->prog_time_str,MAX_TIME_STR,"%d:%02dPM",s_tm.tm_hour,s_tm.tm_min); } else if (s_tm.tm_hour == 0) { s_tm.tm_hour = 12; snprintf(p_app->prog_time_str,MAX_TIME_STR,"%d:%02dAM",s_tm.tm_hour,s_tm.tm_min); } else { snprintf(p_app->prog_time_str,MAX_TIME_STR,"%d:%02dAM",s_tm.tm_hour,s_tm.tm_min); } } num_chars = c_to_uni_str(p_app->prog_time_str,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_TIME_X, eBANNER_TIME_Y, eBANNER_TIME_WIDTH, eBANNER_TIME_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); /* draw program start/end time if exists */ if ((chm_get_time_info(&p_app->chm,&utc_time,&offset,&dst) == 0) && (p_app->tmp_info.eit_info[EIT_CURRENT].start_time > 0) && (p_app->tmp_info.eit_info[EIT_CURRENT].length > 0)) { unsigned char prog_time_str[MAX_TIME_STR * 2]; unsigned char prog_start_time_str[MAX_TIME_STR]; unsigned char prog_end_time_str[MAX_TIME_STR]; struct tm tm_start; struct tm tm_end; num_chars = MAX_TIME_STR; if (dst) { offset += 3600; /* utc_time is already offset for dst but offset is not */ } utctime(p_app->tmp_info.eit_info[EIT_CURRENT].start_time + offset, &tm_start); if (tm_start.tm_hour >= 12) { if (tm_start.tm_hour > 12) tm_start.tm_hour -= 12; snprintf(prog_start_time_str,MAX_TIME_STR,"%d:%02dPM",tm_start.tm_hour,tm_start.tm_min); } else if (tm_start.tm_hour == 0) { tm_start.tm_hour = 12; snprintf(prog_start_time_str,MAX_TIME_STR,"%d:%02dAM",tm_start.tm_hour,tm_start.tm_min); } else { snprintf(prog_start_time_str,MAX_TIME_STR,"%d:%02dAM",tm_start.tm_hour,tm_start.tm_min); } num_chars = MAX_TIME_STR; utctime(p_app->tmp_info.eit_info[EIT_CURRENT].start_time + p_app->tmp_info.eit_info[EIT_CURRENT].length + offset, &tm_end); if (tm_end.tm_hour >= 12) { if (tm_end.tm_hour > 12) tm_end.tm_hour -= 12; snprintf(prog_end_time_str,MAX_TIME_STR,"%d:%02dPM",tm_end.tm_hour,tm_end.tm_min); } else if (tm_end.tm_hour == 0) { tm_end.tm_hour = 12; snprintf(prog_end_time_str,MAX_TIME_STR,"%d:%02dAM",tm_end.tm_hour,tm_end.tm_min); } else { snprintf(prog_end_time_str,MAX_TIME_STR,"%d:%02dAM",tm_end.tm_hour,tm_end.tm_min); } snprintf(prog_time_str, (MAX_TIME_STR * 2), "%s-%s",prog_start_time_str,prog_end_time_str); num_chars = c_to_uni_str(prog_time_str,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_START_END_TIME_X, eBANNER_START_END_TIME_Y, eBANNER_START_END_TIME_WIDTH, eBANNER_START_END_TIME_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); } tmp_prog[0] = 0; if (p_app->prog_rating_str[0] != 0) { strncpy_no_spaces(tmp_prog,(char*)p_app->prog_rating_str,MAX_RATING_STR); BDBG_WRN(("%s - analog: %s\n",__FUNCTION__, tmp_prog)); } if (p_app->psip_rating_str[0] != 0) { strncpy_no_spaces(tmp_prog,(char*)p_app->psip_rating_str,MAX_RATING_STR); BDBG_WRN(("%s - digital: %s\n",__FUNCTION__, tmp_prog)); } num_chars = strlen(tmp_prog); if (num_chars) { /* draw ratings - show blocked rating, if no blocked ratings then show received xds or psip rating if corresponding rating string exists */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_RATINGS_BUTTON, p_app->tmp_str, &num_chars); p_app->tmp_str[num_chars++] = (unsigned int)':'; p_app->tmp_str[num_chars++] = (unsigned int)' '; p_app->tmp_str[num_chars++] = (unsigned int)' '; text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_RATINGS_X, eBANNER_RATINGS_Y, eBANNER_RATINGS_WIDTH, eBANNER_RATINGS_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); num_chars = strlen(tmp_prog); num_chars = c_to_uni_str(tmp_prog,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_RATINGS_X + w, eBANNER_RATINGS_Y, eBANNER_RATINGS_WIDTH, eBANNER_RATINGS_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); } else { BDBG_WRN(("%s - rating string empty\n",__FUNCTION__)); num_chars = 0; } /* draw sap indicator if necessary */ if ((p_app->num_sap) > 1 && (p_app->current_sap != p_app->lang)) { num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,eTEXT_BANNER_SAP, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_SAP_X, eBANNER_SAP_Y, eBANNER_SAP_WIDTH, eBANNER_SAP_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); } #ifdef CONFIG_ORIG_SYNC /* resync before drawing signal level and large banner */ bapp_flush_screen(p_app); #endif /* draw signal level */ // btuner_get_ds_status(p_app->tuner, &ds_status); ds_status.signal_strength = p_app->signal_level; bscreen_draw_banner_signal_level(p_app, ds_status.signal_strength); } /* draw large banner if necessary */ if (p_bs->mode == eLS_BANNER_BIG) { /* resync before drawing signal level and large banner */ #ifdef CONFIG_ORIG_SYNC bapp_sync(p_app); #endif /* draw large banner with semi-transparent background */ bgfx_fill_rect(&p_app->surf,eBANNER_X,eBANNER_Y+eBANNER_SMALL_HEIGHT,eBANNER_WIDTH,eBANNER_LARGE_HEIGHT,eCOLOR_BLACK); for (i = 0; i < 4; i++) { bgfx_h_draw_line(&p_app->surf,eBANNER_X+i,eBANNER_X+eBANNER_WIDTH-i,eBANNER_Y+eBANNER_SMALL_HEIGHT-1+eBANNER_LARGE_HEIGHT-1-i,eCOLOR_BLACK); } #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); bapp_sync(p_app); #endif /* draw program description */ num_chars = MAX_DESC_CHARS; p_str = (unsigned char*)p_app->tmp_info.eit_info[EIT_CURRENT].prog_desc; num_chars = c_to_uni_str(p_str,p_app->tmp_str,num_chars); if (strlen(p_str) == 0) { num_chars = MAX_DESC_CHARS; bscreen_get_string(p_app->lang,eTEXT_BANNER_PROGRAM_DESC, p_app->tmp_str, &num_chars); } text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_DESC_X, eBANNER_DESC_Y, eBANNER_DESC_WIDTH, eBANNER_DESC_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eBANNER_DESC_LINE_SPACING); #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif } last_mode = p_bs->mode; } /* Summary: Screensaver screen drawing function Description: Screensaver screen drawing function. */ void bscreen_screensaver_draw(void *v_app, void *v_screen) { #ifndef CONFIG_SCREENSAVER BDBG_ERR(("NO SCREENSAVER.\n")); #else //#error "Do not include screensaver in Thomson build" bapp_t *p_app = (bapp_t*)v_app; bin_read_t br; bcm_raw_8_t *p_header = (bcm_raw_8_t*)g_p_dsp->ui_comp.logo; br.cnt = 0; br.data = (void*)g_p_dsp->ui_comp.logo; br.size = g_p_dsp->ui_comp.logo_size; screen_null_draw(v_app, v_screen); bgfx_render_file(&p_app->surf, eSCREEN_ACTION_SAFE_X + RAND_INT(eSCREEN_ACTION_SAFE_WIDTH-p_header->width), eSCREEN_ACTION_SAFE_Y + RAND_INT(eSCREEN_ACTION_SAFE_HEIGHT-p_header->height), &br, 0); #endif } /* Summary: Power off screen drawing function Description: Power off screen drawing function. */ void bscreen_power_off_draw(void *v_app, void *v_screen) { screen_null_draw(v_app, v_screen); } /* Summary: Draw banner signal level Description: Draw banner signal level */ void bscreen_draw_banner_signal_level(void *v_app, unsigned int signal) { bapp_t *p_app = (bapp_t*)v_app; const uint32_t icon_center_x = eBANNER_SIGNAL_X + 5; const uint8_t icon_triangle = 4; const uint8_t icon_bars_x = icon_center_x; const uint8_t sig_level_x = eBANNER_SIGNAL_X + 25; int i = 0; #ifdef CONFIG_ORIG_SYNC bapp_sync(p_app); #endif bcolor_idx_t color = eCOLOR_WHITE; if (bant_detect()) color = eCOLOR_DK_YELLOW; /* draw antenna symbol */ bgfx_v_draw_line(&p_app->surf, icon_center_x, eBANNER_SIGNAL_Y, eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT, color); bgfx_v_draw_line(&p_app->surf, icon_center_x-1, eBANNER_SIGNAL_Y, eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT, color); for (i = icon_triangle; i > 0; i--) { bgfx_h_draw_line(&p_app->surf, icon_center_x-i, icon_center_x+1+i, eBANNER_SIGNAL_Y+icon_triangle-i, color); } /* draw signal bars */ for (i = 1; i < 4; i++) { bgfx_v_draw_line(&p_app->surf,icon_bars_x+(i*4),eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT-(i*3), eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT,color); bgfx_v_draw_line(&p_app->surf,icon_bars_x+(i*4)+1,eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT-(i*3), eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT,color); } /* draw level control outline */ for (i = 0; i < 2; i++) { bgfx_h_draw_line(&p_app->surf,sig_level_x,sig_level_x+eBANNER_SIGNAL_WIDTH, eBANNER_SIGNAL_Y+i,eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,sig_level_x,sig_level_x+eBANNER_SIGNAL_WIDTH, eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT-1-i,eCOLOR_WHITE); bgfx_v_draw_line(&p_app->surf,sig_level_x-i,eBANNER_SIGNAL_Y, eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT-1,eCOLOR_WHITE); bgfx_v_draw_line(&p_app->surf,sig_level_x+eBANNER_SIGNAL_WIDTH-1-i,eBANNER_SIGNAL_Y, eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT-1,eCOLOR_WHITE); } /* draw signal level */ bgfx_fill_rect(&p_app->surf,sig_level_x+3,eBANNER_SIGNAL_Y+4,100*(eBANNER_SIGNAL_WIDTH-8)/100, eBANNER_SIGNAL_HEIGHT-8,eCOLOR_BLACK); if (signal <= 100) bgfx_fill_rect(&p_app->surf,sig_level_x+3,eBANNER_SIGNAL_Y+4,signal*(eBANNER_SIGNAL_WIDTH-8)/100, eBANNER_SIGNAL_HEIGHT-8,eCOLOR_NEON_GREEN); #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif } /* Summary: Draw a button. Description: Draw a button. */ void bscreen_draw_button_str(void *v_app, /* application structure */ const bbutton_t *p_button, /* button info structure */ int selected, /* Button selected when non-zero */ int checked, /* Button checked when non-zero */ unsigned int *p_str, /* button UNI string */ unsigned int num_chars, /* length of text string */ unsigned int *p_desc_str, /* description UNI string */ unsigned int num_desc_chars, /* length of description text string */ bapp_font_size_t font_size, /* button text font size */ int font_just /* button text justification, 0 - left, 1 - right */ ) { bapp_t *p_app = (bapp_t*)v_app; int w,h,margin,bulletw; uint16_t str_x,str_y,check_x,check_y; if (!p_button) return; #ifdef CONFIG_ORIG_SYNC bapp_sync(p_app); #endif if (selected) { int newY = p_button->y; /* draw black outline to minimize dot crawl on crappy tvs */ bgfx_fill_rect(&p_app->surf,p_button->x - 1,p_button->y - 1, p_button->width + 2,p_button->height + 2,eCOLOR_BLACK); /* draw top bevel */ bgfx_fill_rect(&p_app->surf,p_button->x,p_button->y, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_DK_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_PALE_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_MED_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_LT_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; /* draw middle */ bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,p_button->height - (7 * eBUTTON_BEVEL_GRADIENT_STEP),eCOLOR_BRT_YELLOW); /* draw bottom bevel */ newY = p_button->y + p_button->height - eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_DK_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_MED_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_LT_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; } else { /* erase dot crawl reducing outline if not selected */ bgfx_fill_rect(&p_app->surf,p_button->x - 1,p_button->y - 1, p_button->width + 2,p_button->height + 2,p_button->background_color); } #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif margin = eBUTTON_MARGIN_X; /* add space for check box */ if ((p_button->type & eBUTTON_RADIO) || (p_button->type & eBUTTON_CHECK)) { #ifdef CONFIG_ORIG_SYNC bapp_sync(p_app); #endif check_x = p_button->x + eBUTTON_RADIO_BOX_MARGIN_X; check_y = p_button->y + (p_button->height - eBUTTON_RADIO_BOX_WIDTH)/2; if (checked) { if (p_button->type & eBUTTON_CHECK_LOCK) { /* draw lock icon */ bgfx_h_draw_line(&p_app->surf,check_x + 7, check_x + 14, check_y + 2, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 6, check_x + 15, check_y + 3, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 5, check_x + 16, check_y + 4, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 5, check_x + 7, check_y + 5, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 5, check_x + 7, check_y + 6, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 5, check_x + 7, check_y + 7, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 5, check_x + 7, check_y + 8, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 14, check_x + 16, check_y + 5, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 14, check_x + 16, check_y + 6, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 14, check_x + 16, check_y + 7, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 14, check_x + 16, check_y + 8, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 3, check_x + 18, check_y + 9, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_fill_rect(&p_app->surf,check_x + 1, check_y + 10, 18, 11, selected ? eCOLOR_BLACK : eCOLOR_LT_YELLOW); bgfx_h_draw_line(&p_app->surf,check_x + 6, check_x + 15, check_y + 12, selected ? eCOLOR_DK_YELLOW : eCOLOR_BLACK); bgfx_h_draw_line(&p_app->surf,check_x + 6, check_x + 15, check_y + 15, selected ? eCOLOR_DK_YELLOW : eCOLOR_BLACK); bgfx_h_draw_line(&p_app->surf,check_x + 6, check_x + 15, check_y + 18, selected ? eCOLOR_DK_YELLOW : eCOLOR_BLACK); } else { /* draw BLACK outline */ bgfx_fill_rect(&p_app->surf,check_x,check_y, eBUTTON_RADIO_BOX_WIDTH,eBUTTON_RADIO_BOX_WIDTH,eCOLOR_BLACK); /* draw GREEN checkbox background */ bgfx_fill_rect(&p_app->surf,check_x + eBUTTON_RADIO_BOX_BORDER,check_y + eBUTTON_RADIO_BOX_BORDER, eBUTTON_RADIO_BOX_WIDTH - (2 * eBUTTON_RADIO_BOX_BORDER), eBUTTON_RADIO_BOX_WIDTH - (2 * eBUTTON_RADIO_BOX_BORDER),eCOLOR_NEON_GREEN); /* draw dot in middle for colorblind users */ bgfx_fill_rect(&p_app->surf,check_x + (eBUTTON_RADIO_BOX_WIDTH / 2) - (eBUTTON_RADIO_BOX_DOT_WIDTH / 2), check_y + (eBUTTON_RADIO_BOX_WIDTH / 2) - (eBUTTON_RADIO_BOX_DOT_WIDTH / 2), eBUTTON_RADIO_BOX_DOT_WIDTH, eBUTTON_RADIO_BOX_DOT_WIDTH, eCOLOR_BLACK); } } else { /* draw BLACK outline */ bgfx_fill_rect(&p_app->surf,check_x,check_y, eBUTTON_RADIO_BOX_WIDTH,eBUTTON_RADIO_BOX_WIDTH,eCOLOR_BLACK); /* draw WHITE checkbox background */ bgfx_fill_rect(&p_app->surf,check_x + eBUTTON_RADIO_BOX_BORDER,check_y + eBUTTON_RADIO_BOX_BORDER, eBUTTON_RADIO_BOX_WIDTH - (2 * eBUTTON_RADIO_BOX_BORDER), eBUTTON_RADIO_BOX_WIDTH - (2 * eBUTTON_RADIO_BOX_BORDER),eCOLOR_WHITE); } #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif } if (num_chars > 0) { bgfx_string_info(p_app->p_font[p_app->lang][font_size],(const unsigned long *)p_str,num_chars,&w,&h); if (((w + margin) > p_button->width) || (h > p_button->height)) { BDBG_MSG(("String too large for button. (%d,%d),(%d,%d)\n", w + margin, h, p_button->width, p_button->height)); /* Handled by text box draw */ } if (font_just) { str_x = p_button->x + p_button->width - w - margin; /* Right justify string */ } else { str_x = p_button->x + margin; /* Left justify string */ if ((p_button->type & eBUTTON_RADIO) || (p_button->type & eBUTTON_CHECK)) { str_x += eBUTTON_RADIO_BOX_MARGIN_X + eBUTTON_RADIO_BOX_WIDTH; /* adjust if check box is visible */ } } str_y = p_button->y + (p_button->height - h)/2; /* Center string verticaly */ #ifdef CONFIG_ORIG_SYNC bapp_sync(p_app); #endif if (selected) text_box(&p_app->surf, p_app->p_font[p_app->lang][font_size], str_x, str_y, p_button->width - margin, h, p_str, num_chars, eCOLOR_BLACK, 20); else text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][font_size], str_x, str_y, p_button->width - margin, h, p_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,20); } /* Draw description text */ if ((p_desc_str) && (num_desc_chars > 0)) { /* TODO: draw given description text string */ } else if (p_button->desc_text_id < eTEXT_MAX) { int y_desc_offset,addnl; int spacing = eMENU_INFO_LINE_SPACING; addnl = 0; if ((p_app->screen_id == eSCREEN_SOUND) || (p_app->screen_id == eSCREEN_PICTURE) || (p_app->screen_id == eSCREEN_RATINGS_LOCK)) addnl += 60; /* draw description text string based on button's default description text id */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_BULLET, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&bulletw,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], p_button->x + p_button->width + eBUTTON_MARGIN_X, p_button->y + (p_button->height - h * 3)/2, bulletw + 1, p_button->height, p_app->tmp_str, num_chars, eCOLOR_WHITE, eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_INFO_LINE_SPACING); num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_button->desc_text_id, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); w = eWIDTH - (p_button->x + p_button->width + eBUTTON_MARGIN_X + bulletw + eBUTTON_MARGIN_RIGHT + 15); y_desc_offset = p_button->y + (p_button->height - h)/2; if (num_chars > 65) { y_desc_offset -= 10; } if ((p_app->lang == eLANG_FRENCH) && (p_app->screen_id == eSCREEN_CAPTIONS_FONT) && (num_chars > 34)) { y_desc_offset -= 6; spacing = 0; } text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], p_button->x + p_button->width + eBUTTON_MARGIN_X + bulletw + 1, y_desc_offset, w, p_button->height + addnl, p_app->tmp_str, num_chars, eCOLOR_WHITE, eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,spacing); #ifdef BCM_DEBUG if (p_app->ui_debug_mode) { char *p_str = (char*)g_p_dsp->ui_comp.str_table[p_app->lang][p_button->desc_text_id]; if (p_str) { printf("%s (%d,%d,%d,%d)\n", p_str,p_button->x + p_button->width + eBUTTON_MARGIN_X + bulletw + 1, p_button->y + (p_button->height - h)/2,w,p_button->height); } } #endif } #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif } /* Summary: Adjust the given button orientation to account for given language Description: Adjust the given button orientation to account for given language Note that button orientation is designed assuming english is the default. This function simply modifies the button if a different language is specified. */ static void adjust_button_orientation(void *v_app, bbutton_t *p_button) { bapp_t *p_app = (bapp_t*)v_app; if (p_app->lang == eLANG_ENGLISH) { switch (p_app->screen_id) { case eSCREEN_MAIN: p_button->x += -18; p_button->width += 48; break; case eSCREEN_SOUND: p_button->x -= 20; p_button->width += 70; break; default: break; } } else if (p_app->lang == eLANG_SPANISH) { switch (p_app->screen_id) { case eSCREEN_AV: p_button->x -= 40; p_button->width += 50; break; case eSCREEN_CAPTIONS_BACK_OPTIONS: p_button->x -= 4; p_button->width += 24; break; case eSCREEN_CAPTIONS_BACK_OPACITY: case eSCREEN_CAPTIONS_FONT_OPACITY: p_button->width += 4; break; case eSCREEN_CAPTIONS_FONT_STYLE: p_button->width += 6; p_button->y += 20; break; case eSCREEN_CAPTIONS_EDGE_TYPE: p_button->x -= 6; p_button->width += 36; break; case eSCREEN_CAPTIONS_FONT_SIZE: p_button->y += 10; break; case eSCREEN_MAIN: p_button->x += -20; p_button->width += 62; p_button->height += 0; break; case eSCREEN_PICTURE: p_button->y -= 20; p_button->width += 30; break; case eSCREEN_SOUND: p_button->x -= 20; p_button->width += 40; break; case eSCREEN_WIZ_CH_SCAN: case eSCREEN_CH_SCAN: p_button->y -= 15; break; case eSCREEN_WIZ_SMART_CH_SCAN: case eSCREEN_SMART_CH_SCAN: p_button->y -= 5; break; case eSCREEN_RESET: p_button->x += 25; p_button->width += 25; break; case eSCREEN_RATINGS: p_button->x += 5; p_button->y -= 15; p_button->width += 50; break; case eSCREEN_RATINGS_TV: p_button->y += 10; break; case eSCREEN_RATINGS_RRT_DIM: p_button->y += 14; break; case eSCREEN_RATINGS_RRT_UPDATE: p_button->width += 60; break; case eSCREEN_RATINGS_LOCK: p_button->width += -10; break; case eSCREEN_RATINGS_LIMITS: p_button->width += 20; break; case eSCREEN_AUTO_POWER: p_button->y += 15; p_button->width -= 20; break; case eSCREEN_SETUP: p_button->width -= 30; break; case eSCREEN_WRONG_PIN_LIVE: case eSCREEN_WRONG_PIN_RATINGS: case eSCREEN_WRONG_PIN_RESET: case eSCREEN_MISMATCHED_PINS: p_button->width += 140; p_button->y -= 20; break; case eSCREEN_WIZ_MISMATCHED_PINS: p_button->width += 140; break; case eSCREEN_CAPTIONS_ADVANCED: p_button->width += 70; break; #if 0 case eSCREEN_CAPTIONS_ON_OFF: p_button->width += 20; break; #endif case eSCREEN_CAPTIONS_RESET: p_button->width += 15; break; default: break; } } else if (p_app->lang == eLANG_FRENCH) { switch (p_app->screen_id) { case eSCREEN_AV: p_button->x -= 52; p_button->width += 36; break; case eSCREEN_SOUND: p_button->x -= 24; p_button->width += 110; break; case eSCREEN_CAPTIONS_ADVANCED: p_button->x -= 6; p_button->width += 120; break; case eSCREEN_CAPTIONS_RESET: p_button->x -= 8; p_button->width += 34; break; case eSCREEN_CAPTIONS_FONT_COLOR: case eSCREEN_CAPTIONS_EDGE_COLOR: break; case eSCREEN_CAPTIONS_BACK_COLOR: p_button->y += 6; p_button->x -= 16; break; case eSCREEN_CAPTIONS_FONT: p_button->y += -23; p_button->x -= 16; p_button->width -= 4; break; case eSCREEN_CAPTIONS_FONT_SIZE: p_button->x += 10; p_button->width += 12; p_button->y += 6; break; case eSCREEN_CAPTIONS_FONT_STYLE: p_button->width += 55; p_button->y += 20; break; case eSCREEN_CAPTIONS_FONT_OPACITY: case eSCREEN_CAPTIONS_BACK_OPACITY: p_button->x += -6; p_button->width += -8; break; case eSCREEN_CAPTIONS_FONT_OPTIONS: p_button->x -= 16; p_button->y += 8; p_button->width += 84; break; case eSCREEN_CAPTIONS_BACK_OPTIONS: p_button->x -= 16; p_button->y += -2; p_button->width += 140; break; case eSCREEN_CAPTIONS_EDGE_TYPE: p_button->x += -10; p_button->width += 26; break; case eSCREEN_MAIN: p_button->x += -20; p_button->width += 35; p_button->height += 0; break; case eSCREEN_RESET: p_button->x += 25; p_button->width += 30; break; case eSCREEN_RATINGS: p_button->x += 5; p_button->width += 40; break; case eSCREEN_RATINGS_LIMITS: p_button->width += 30; break; case eSCREEN_RATINGS_TV: p_button->y += 10; break; case eSCREEN_RATINGS_RRT_DIM: case eSCREEN_RATINGS_RRT_VAL: p_button->y += 10; break; case eSCREEN_RATINGS_MOVIES: p_button->y += 10; break; case eSCREEN_WRONG_PIN_LIVE: case eSCREEN_WRONG_PIN_RATINGS: case eSCREEN_MISMATCHED_PINS: case eSCREEN_WIZ_MISMATCHED_PINS: p_button->width += 110; break; case eSCREEN_WRONG_PIN_RESET: p_button->y -= 20; p_button->width += 110; break; case eSCREEN_AUTO_POWER: p_button->y += 5; break; default: break; } } #ifdef NUMBER_BUTTONS p_button->width += 20; #endif if (p_app->screen_id == eSCREEN_RATINGS_TV) p_button->width -= 10; } /* Summary: Draw a button. Description: Draw a button. */ void bscreen_draw_button(void *v_app, /* application structure */ const bbutton_t *p_button, /* button info structure */ int selected, /* Button selected when non-zero */ int checked, /* Button checked when non-zero */ int idx /* button index or -1 for non index button */ ) { bapp_t *p_app = (bapp_t*)v_app; bbutton_t tmp_button; unsigned int num_chars; num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_button->text_id, p_app->tmp_str, &num_chars); #ifdef NUMBER_BUTTONS if (p_app->screen_id != eSCREEN_RATINGS_TV) { if (p_app->button_numbers && (idx >= 0)) { char cstr[16]; int clen; clen = snprintf(cstr,16," - %d",idx + 1); if ((clen + num_chars) < SCREEN_MAX_STR_WIDTH) { num_chars += c_to_uni_str(cstr,&p_app->tmp_str[num_chars],clen); } } } #endif /* adjust button size/position based on language choice */ tmp_button = *p_button; adjust_button_orientation(v_app, &tmp_button); #ifdef BCM_DEBUG if (p_app->ui_debug_mode) { char *p_str = g_p_dsp->ui_comp.str_table[p_app->lang][p_button->text_id]; if (p_str) { printf("%s (%d,%d,%d,%d) - (%d,%d,%d,%d) %d\n", p_str,p_button->x,p_button->y,p_button->width,p_button->height,tmp_button.x,tmp_button.y,tmp_button.width,tmp_button.height,num_chars); } } #endif if ((p_app->lang == eLANG_FRENCH) && (p_app->screen_id == eSCREEN_CAPTIONS_FONT)) { tmp_button.y += (idx * 4); } if ((p_app->screen_id == eSCREEN_PICTURE) && (p_app->lang == eLANG_SPANISH)) { tmp_button.y += (idx * 16); } bscreen_draw_button_str(v_app,&tmp_button,selected,checked,p_app->tmp_str,num_chars,NULL,0,eFONT_SIZE_MED,p_button->right_justify_text); } #if 1 /* Summary: Draw a button but override the p_button->text_id text with str_text. Description: Draw a button but override the p_button->text_id text with str_text. */ void bscreen_draw_button_custom_text(void *v_app, /* application structure */ const bbutton_t *p_button, /* button info structure */ char *str_text, /* button text to use (overrides p_button->text_id) */ char *str_desc_text, /* description text to use (overrides p_button->desc_text_id) */ int selected, /* Button selected when non-zero */ int checked, /* Button checked when non-zero */ int idx /* button index or -1 for non index button */ ) { bapp_t *p_app = (bapp_t*)v_app; bbutton_t tmp_button; unsigned int num_chars = 0; unsigned int num_desc_chars = 0; const int MAX_DESC_LEN = 64; unsigned int tmp_desc_str[MAX_DESC_LEN]; bapp_font_size_t font_size = eFONT_SIZE_MED; #ifdef RRT_BUTTON_NUM char cstr[16]; int clen = 0; #endif int margin = eBUTTON_MARGIN_X; int str_width = 0; int pixels_per_char = 0; int w = 0; int h = 0; if (!str_text) str_text = " "; if (strlen(str_text) == 0) str_text = " "; num_chars = strlen(str_text); #ifdef RRT_BUTTON_NUM clen = snprintf(cstr,16," - %d",idx + 1); #endif num_chars = c_to_uni_str(str_text,p_app->tmp_str, strlen(str_text)); bgfx_string_info(p_app->p_font[p_app->lang][font_size],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); /* calc width of entire string (includes index if necessary) in pixels */ pixels_per_char = ((w + margin) / num_chars); str_width = w + margin; #ifdef RRT_BUTTON_NUM if (p_app->button_numbers) str_width += (clen * pixels_per_char); #endif if (str_width > p_button->width) { /* trim string characters if too big for button */ int excess_pixels = (str_width - p_button->width); num_chars -= excess_pixels / pixels_per_char; bgfx_string_info(p_app->p_font[p_app->lang][font_size],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); #ifdef RRT_BUTTON_NUM /* copy string into p_app->tmp-str - index number will be copied later if necessary */ c_to_uni_str(str_text,p_app->tmp_str, num_chars - clen); #endif BDBG_MSG(("%s : too wide for button - adjusting from %d chars to %d chars\n", __FUNCTION__,(num_chars + excess_pixels / pixels_per_char), num_chars)); } else { /* string fits in button - no trimming necesary */ /* copy string into p_app->tmp_str - index number will be copied later if necesary */ num_chars = c_to_uni_str(str_text,p_app->tmp_str, strlen(str_text)); } #ifdef RRT_BUTTON_NUM /* copy index number into tmp_str if necessary */ if (p_app->button_numbers && (idx >= 0)) num_chars += c_to_uni_str(cstr,&p_app->tmp_str[num_chars],clen); #endif if (str_desc_text) { num_desc_chars = SCREEN_MAX_STR_WIDTH; num_desc_chars = c_to_uni_str(str_desc_text,tmp_desc_str, MAX_DESC_LEN); } /* adjust button size/position based on language choice */ //tmp_button = *p_button; memcpy(&tmp_button, p_button, sizeof(tmp_button)); adjust_button_orientation(v_app, &tmp_button); bscreen_draw_button_str(v_app,&tmp_button,selected,checked,p_app->tmp_str,num_chars,tmp_desc_str,num_desc_chars,eFONT_SIZE_MED,tmp_button.right_justify_text); } #endif /* Summary: Draw the buttons for the screen. Description: Draw the buttons for the screen. */ void bscreen_draw_buttons( void *v_app, /* Opaque app reference */ void *v_screen /* Opaque screen reference */ ) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; bscreen_event_t event; int button_idx,selected,checked; for (button_idx = 0; button_idx < p_screen->num_buttons; button_idx++) { event.type = eS_EVENT_SELECTED; event.id = button_idx; selected = p_screen->handle_event(p_app,p_screen,&event); event.type = eS_EVENT_CHECKED; checked = p_screen->handle_event(p_app,p_screen,&event); bscreen_draw_button(p_app,&p_screen->p_button_array[button_idx], selected,checked,button_idx); } } /* Summary: Draw a progress meter for the screen. Description: Draw a progress meter for the screen. */ void bscreen_draw_progress(void * v_app, unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int border_width, unsigned int border_color, unsigned int background_color, unsigned int percent) { bapp_t *p_app = (bapp_t*)v_app; int newX = x; int newY = y; int newW = width; int newH = height; #ifdef CONFIG_ORIG_SYNC bapp_sync(p_app); #endif /* draw border */ //bgfx_fill_rect(&p_app->surf, newX, newY, newW, newH, border_color); bgfx_fill_rect(&p_app->surf,newX,newY,newW,border_width,eCOLOR_WHITE); bgfx_fill_rect(&p_app->surf,newX,newY+newH-border_width,newW+border_width,border_width,eCOLOR_WHITE); bgfx_fill_rect(&p_app->surf,newX,newY,border_width,newH,eCOLOR_WHITE); bgfx_fill_rect(&p_app->surf,newX+newW,newY,border_width,newH,eCOLOR_WHITE); /* draw progress background */ newX += border_width; newY += border_width; newW -= (2 * border_width); newH -= (2 * border_width); bgfx_fill_rect(&p_app->surf, newX, newY, newW, newH, background_color); /* draw thumb */ newX += border_width; newY += border_width; newW = (newW - (2 * border_width)) * percent / 100; newH -= (2 * border_width); if (newW) { /* draw top bevel */ bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_DK_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_PALE_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_MED_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_LT_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; /* draw middle */ bgfx_fill_rect(&p_app->surf,newX,newY, newW,newH - (7 * eBUTTON_BEVEL_GRADIENT_STEP),eCOLOR_BRT_YELLOW); /* draw bottom bevel */ newY = y + height - (2 * border_width) - eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_DK_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_MED_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_LT_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; } #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif } /* Summary: Draw pin fields for the screen. Description: Draw pin fields for the screen. */ void bscreen_draw_pin(void * v_app, unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int inc_x, unsigned int selection, unsigned int field) { bapp_t *p_app = (bapp_t*)v_app; int newX = x; int newY = y; int newW = width; int newH = height; unsigned int i = field; unsigned int j = 0; for (j = 0; j < field; j++) { newX += width + inc_x; newY = y; newW = width; newH = height; } #ifdef CONFIG_ORIG_SYNC bapp_sync(p_app); #endif /* draw border */ bgfx_fill_rect(&p_app->surf, newX, newY, newW, newH, eCOLOR_WHITE); /* draw progress background */ newX += eBUTTON_PROGRESS_BORDER; newY += eBUTTON_PROGRESS_BORDER; newW -= (2 * eBUTTON_PROGRESS_BORDER); newH -= (2 * eBUTTON_PROGRESS_BORDER); bgfx_fill_rect(&p_app->surf, newX, newY, newW, newH, eCOLOR_DRK_BLUE); /* draw highlight */ if (i == selection) { newX += eBUTTON_PROGRESS_BORDER; newY += eBUTTON_PROGRESS_BORDER; newW = (newW - (2 * eBUTTON_PROGRESS_BORDER)); newH -= (2 * eBUTTON_PROGRESS_BORDER); /* draw top bevel */ bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_DK_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_PALE_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_MED_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_LT_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; /* draw middle */ bgfx_fill_rect(&p_app->surf,newX,newY, newW,newH - (7 * eBUTTON_BEVEL_GRADIENT_STEP),eCOLOR_BRT_YELLOW); /* draw bottom bevel */ newY = y + height - (2 * eBUTTON_PROGRESS_BORDER) - eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_DK_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_MED_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_LT_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; } else if (i < selection) { /* draw hidden value indicator */ unsigned int num_chars = SCREEN_MAX_STR_WIDTH; int w = 0; int h = 0; bscreen_get_string(p_app->lang,eTEXT_HIDDEN_PIN_DIGIT, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], newX + ((newW / 2) - (w / 2)) - 5, y + ((newH / 2) - (h / 2)), w, h, p_app->tmp_str, num_chars, eCOLOR_WHITE, eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_INFO_LINE_SPACING); } #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif } /* Summary: Default screen drawing function Description: Default screen drawing function. . */ void bscreen_auto_power_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; uint16_t title_area_height = p_screen->top_banner_height; if (p_app->settings.auto_power_off) { title_area_height += 32; } bscreen_draw_background(v_app, &p_app->surf, title_area_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; if (p_app->settings.auto_power_off) bscreen_get_string(p_app->lang,eTEXT_AUTO_POWERED_OFF, p_app->tmp_str, &num_chars); else bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); bscreen_draw_buttons(v_app,v_screen); draw_navigation_hints(v_app, v_screen); } #include "bguide.c"