static void win_srch_draw_info(OSD_RECT* pRect, char* str, UINT16* unistr, UINT8 shidx) { TEXT_FIELD* txt; txt = &srch_info; OSD_SetRect2(&txt->head.frame,pRect); if(str != NULL) OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)str); else if (unistr != NULL) OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)unistr); OSD_SetColor(txt,shidx,shidx,shidx,shidx); OSD_DrawObject( (POBJECT_HEAD)txt, C_UPDATE_ALL); }
static void win_draw_text_content(OSD_RECT *pRect, char *str, UINT16 *unistr, UINT32 strtype, UINT8 shidx) { TEXT_FIELD *txt; txt = &smc_upgrade_item_str; OSD_SetRect2(&txt->head.frame, pRect); if (NULL == str && NULL == unistr) { txt->pString = NULL; OSD_SetTextFieldContent(txt, STRING_ID, (UINT32)strtype); } else if (str != NULL) { txt->pString = display_strs[40]; OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)str); } else if (unistr != NULL) { txt->pString = display_strs[40]; OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)unistr); } OSD_SetColor(txt, shidx, shidx, shidx, shidx); OSD_DrawObject((POBJECT_HEAD)txt, C_UPDATE_ALL); }
BOOL win_pin_open(UINT32* vkey_exist_array,UINT32 vkey_exist_cnt) { char ch; UINT32 hkey,vkey; UINT32* exit_pin_keys; UINT32 exit_pin_keycnt; UINT32 i,vscr_idx; UINT32 pin_u32; BOOL ret = TRUE; struct OSDRect* frame; POBJECT_HEAD win; //SYSTEM_DATA* sys_data; cas_pin_t cas_pin; POBJECT_HEAD pObj; CONTAINER* con; BOOL old_value = ap_enable_key_task_get_key(TRUE); con = &g_win_pin_con; if(!api_is_sd_color_mode()) { #if 0 pObj = (POBJECT_HEAD)&g_win_pin_con; OSD_SetColor(pObj,WIN_SH_IDX,WIN_SH_IDX,0,0); pObj = (POBJECT_HEAD)&g_win_pin_title; OSD_SetColor(pObj, TITLE_SH_IDX,TITLE_SH_IDX,TITLE_SH_IDX,TITLE_SH_IDX); pObj = (POBJECT_HEAD)&g_win_pin_char; OSD_SetColor(pObj, CHAR_SH_IDX,CHAR_HL_IDX,CHAR_SH_IDX,CHAR_SH_IDX); #endif } else if(api_is_sd_color_mode()) { pObj = (POBJECT_HEAD)&g_win_pin_con; OSD_SetColor(pObj,WIN_SH_IDX_SD,WIN_SH_IDX_SD,0,0); pObj = (POBJECT_HEAD)&g_win_pin_title; OSD_SetColor(pObj, TITLE_SH_IDX_SD,TITLE_SH_IDX_SD,TITLE_SH_IDX_SD,TITLE_SH_IDX_SD); pObj = (POBJECT_HEAD)&g_win_pin_char; OSD_SetColor(pObj, CHAR_SH_IDX_SD,CHAR_HL_IDX_SD,CHAR_SH_IDX_SD,CHAR_SH_IDX_SD); } g_win_pin_con.head.frame.uHeight=W_H; g_win_pin_title.wStringID=RS_SYSTME_PARENTAL_LOCK_INPUT_PASSWORD; // sys_data = sys_data_get(); if(vkey_exist_array == NULL || vkey_exist_cnt == 0) { exit_pin_keys = default_key_exit; exit_pin_keycnt = sizeof(default_key_exit)/sizeof(default_key_exit[0]); } else { exit_pin_keys = vkey_exist_array; exit_pin_keycnt = vkey_exist_cnt; } win = (POBJECT_HEAD)&g_win_pin_con; /* Start to try to save backgrand */ wincom_backup_region(&win->frame); /* End of try to save backgrand */ input_pin_char_cnt = 0; OSD_DrawObject(win, C_UPDATE_ALL); win_pin_draw_chars(); while(1) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ap_hk_to_vk(0, hkey, &vkey); for(i=0;i<exit_pin_keycnt;i++) { if(vkey == exit_pin_keys[i]) { ret = FALSE; goto EXIT; } } if(vkey<=V_KEY_9) { ch = (char)('0' + (vkey - V_KEY_0)); if(input_pin_char_cnt < PIN_LENGTH) { input_pin_chars[input_pin_char_cnt] = ch; input_pin_char_cnt ++; } win_pin_draw_chars(); /* if(input_pin_char_cnt == PIN_LENGTH) { pin_u32 = 0; for(i=0;i<PIN_LENGTH;i++) { pin_u32 *= 10; pin_u32 += (input_pin_chars[i] - '0'); } if(pin_u32 == sys_data->menu_password || pin_u32==3327) { ret = TRUE; goto EXIT; } else { input_pin_char_cnt = 0; win_pin_draw_chars(); } } //*/ } else if(vkey==V_KEY_LEFT) { if(input_pin_char_cnt) { input_pin_char_cnt--; win_pin_draw_chars(); } } else if(vkey == V_KEY_ENTER) { char k; memset(cas_pin.pin_code,0,sizeof(cas_pin.pin_code)); for(k=0;k<input_pin_char_cnt;k++) { cas_pin.pin_code[k] = input_pin_chars[k] ; } for(;k<PIN_LENGTH;k++) cas_pin.pin_code[k] = 0 ; cas_pin.pin_len = input_pin_char_cnt; //ret =cas_check_pin_req(&cas_pin); ret=1; if(input_pin_char_cnt>=4)// not need check pin { ret=0; } if(ret==0) { //soc_printf("pwd OK %d, pin=%s\n",ret,cas_pin.pin_code); ret = TRUE; goto EXIT; } else { //input_pin_char_cnt = 0; //win_pin_draw_chars(); } } }; EXIT: wincom_restore_region(); if((!ret) && ((vkey != V_KEY_EXIT) && (vkey != V_KEY_MENU))) { ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hkey, FALSE);/*if exit key got,repatch the messages again*/ } ap_enable_key_task_get_key(old_value); return ret; }
static PRESULT srch_backtxt_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { INT i; PRESULT ret = PROC_PASS; UINT8 bID = OSD_GetObjID(pObj); OSD_RECT rect; TEXT_FIELD *pTxt; switch(event) { case EVN_POST_DRAW: if(bID == TVB_ID) { OSD_SetRect(&rect, TVB_L + 18, TVB_T+2,36,36);//, 20, 20); //win_srch_draw_bmp(&rect,IM_ORANGE_ARROW_MAINMENU); win_srch_draw_bmp(&rect,IM_GROUP_RIGHT); rect.uLeft = TVB_L +20; rect.uTop = TVB_T; rect.uWidth = TXT_W; rect.uHeight= TXT_W; pTxt = &srch_info_txt_ex; OSD_SetColor(pTxt,WIN_CON_NOSHOW,WIN_CON_NOSHOW,WIN_CON_NOSHOW,WIN_CON_NOSHOW); for(i = 0; i < INFOR_CHAN_CNT + 1;i++) { win_srch_draw_info_ex(&rect,"",(UINT16 *)NULL,0); rect.uTop+=TXT_H + LINE_H; } OSD_SetColor(pTxt,RADIO_TXT_SH_IDX,RADIO_TXT_SH_IDX,RADIO_TXT_SH_IDX,RADIO_TXT_SH_IDX); } else if(bID == RADIOB_ID) { OSD_SetRect(&rect, RADIOB_L + 18, RADIOB_T+2,36,36);//, 20, 20); //win_srch_draw_bmp(&rect,IM_ORANGE_ARROW_MAINMENU); win_srch_draw_bmp(&rect,IM_GROUP_RIGHT); rect.uLeft = RADIOB_L+20; rect.uTop = RADIOB_T; rect.uWidth = TXT_W; rect.uHeight= TXT_W; pTxt = &srch_info_txt_ex; OSD_SetColor(pTxt,WIN_CON_NOSHOW,WIN_CON_NOSHOW,WIN_CON_NOSHOW,WIN_CON_NOSHOW); for(i = 0; i < INFOR_CHAN_CNT + 1;i++) { win_srch_draw_info_ex(&rect,"",(UINT16 *)NULL,0); rect.uTop+=TXT_H + LINE_H; } OSD_SetColor(pTxt,RADIO_TXT_SH_IDX,RADIO_TXT_SH_IDX,RADIO_TXT_SH_IDX,RADIO_TXT_SH_IDX); } else if(bID == TPB_ID) { OSD_SetRect(&rect, INFO_SAT_L, INFO_SAT_T, INFO_SAT_W, INFO_SAT_H); //win_srch_draw_bmp(&rect,IM_SATELLITE); win_srch_draw_bmp(&rect,IM_SATELLITE); OSD_SetRect(&rect, INFO_RCV_L, INFO_RCV_T, INFO_RCV_W, INFO_RCV_H); //guop //win_srch_draw_bmp(&rect,IM_RECEIVE); win_srch_draw_bmp(&rect,IM_RECEIVE); } //win_srch_draw_info_ex(&rect, NULL,pstr, INFOMATION_TXT_IDX) break; } return ret; }
void win_minisignal_open_ex(POBJECT_HEAD w,UINT32 x, UINT32 y) { POBJECT_HEAD pObj; PPROGRESS_BAR pBar; UINT8 level,quality,lock; struct nim_device* nim_dev; if(cur_tuner_idx == 0) nim_dev = g_nim_dev; else nim_dev = g_nim_dev2; if(w->bType != OT_CONTAINER) return ; pObj = (POBJECT_HEAD)&g_win_signal; pObj->pRoot = w; //OSD_SetColor(pObj,WIN_SH_IDX,WIN_SH_IDX,WIN_SH_IDX,WIN_SH_IDX); pObj = (POBJECT_HEAD)&sig_bar_level; //pObj->frame.uLeft = W_L + B_L_OF; pObj->frame.uWidth = B_W; OSD_SetColor(pObj,B_BG_SH_IDX,B_BG_SH_IDX,B_BG_SH_IDX,B_BG_SH_IDX); pBar = (PPROGRESS_BAR)&sig_bar_level; pBar->wTickBg = B_MID_SH_IDX; pObj = (POBJECT_HEAD)& sig_bar_quality; //pObj->frame.uLeft = W_L + B_L_OF; pObj->frame.uWidth = B_W; OSD_SetColor(pObj,B_BG_SH_IDX,B_BG_SH_IDX,B_BG_SH_IDX,B_BG_SH_IDX); pBar = (PPROGRESS_BAR)&sig_bar_quality; pBar->wTickBg = B_MID_SH_IDX; pObj = (POBJECT_HEAD)&sig_txt_level; //pObj->frame.uLeft = W_L + TXTL_L_OF; OSD_SetColor(pObj, TXT_SH_IDX, TXT_SH_IDX, TXT_SH_IDX, TXT_SH_IDX); pObj = (POBJECT_HEAD)&sig_txt_quality; //pObj->frame.uLeft = W_L + TXTL_L_OF; OSD_SetColor(pObj, TXT_SH_IDX, TXT_SH_IDX, TXT_SH_IDX, TXT_SH_IDX); pObj = (POBJECT_HEAD)&sig_txt_level_per; OSD_SetColor(pObj, TXT_SH_IDX, TXT_SH_IDX, TXT_SH_IDX, TXT_SH_IDX); pObj = (POBJECT_HEAD)&sig_txt_quality_per; OSD_SetColor(pObj, TXT_SH_IDX, TXT_SH_IDX, TXT_SH_IDX, TXT_SH_IDX); pObj = (POBJECT_HEAD)&g_win_signal; //pObj->frame.uLeft = W_L; //pObj->frame.uWidth = W_W; OSD_SetColor(pObj, TXT_SH_IDX, TXT_SH_IDX, TXT_SH_IDX, TXT_SH_IDX); //OSD_MoveObject(pObj,MINI_SIGNAL_L, MINI_SIGNAL_T,FALSE); OSD_MoveObject(pObj,x,y,FALSE); nim_get_lock(nim_dev, &lock); nim_get_AGC(nim_dev, &level); nim_get_SNR(nim_dev, &quality); api_Signal_Lock_LED_OnOff(lock);//-a by wangyang for Signal Lock LED onoff 2011-10-25 dem_signal_to_display(lock,&level,&quality); win_signal_set_level_quality(level,quality,lock); }
void win_set_mp_pvr_title(UINT8 main_title, TITLE_TYPE title_type) { BITMAP *pBmp; TEXT_FIELD *pTxt; struct mp_title_tab_resource* titleitem; TITLE_TYPE type; POBJECT_HEAD pObj; if(main_title == 1) { type = title_type; titleitem = &title_tab[type]; pBmp = &usb_title_bmp1; OSD_SetBitmapContent(pBmp, titleitem->bmp_id); pTxt = &usb_title_txt1; OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id); type = (title_type+1)%TITLE_NUMBER; titleitem = &title_tab[type+TITLE_NUMBER]; pBmp = &usb_title_bmp2; OSD_SetBitmapContent(pBmp, titleitem->bmp_id); pTxt = &usb_title_txt2; OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id); OSD_SetColor(pTxt, TITLE_TXT2_SH, TITLE_TXT2_SH, TITLE_TXT2_SH, TITLE_TXT2_SH); type = (title_type+2)%TITLE_NUMBER; titleitem = &title_tab[type+TITLE_NUMBER]; pBmp = &usb_title_bmp3; OSD_SetBitmapContent(pBmp, titleitem->bmp_id); pTxt = &usb_title_txt3; OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id); OSD_SetColor(pTxt, TITLE_TXT2_SH, TITLE_TXT2_SH, TITLE_TXT2_SH, TITLE_TXT2_SH); type = (title_type+3)%TITLE_NUMBER; titleitem = &title_tab[type+TITLE_NUMBER]; pBmp = &usb_title_bmp4; OSD_SetBitmapContent(pBmp, titleitem->bmp_id); pTxt = &usb_title_txt4; OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id); OSD_SetColor(pTxt, TITLE_TXT2_SH, TITLE_TXT2_SH, TITLE_TXT2_SH, TITLE_TXT2_SH); } else { type = title_type; titleitem = &title_tab[type]; pBmp = &usb_title_bmp1; OSD_SetBitmapContent(pBmp, titleitem->bmp_id); pTxt = &usb_title_txt1; OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id); type = (title_type+1)%TITLE_NUMBER; titleitem = &title_tab[type+TITLE_NUMBER*2]; pBmp = &usb_title_bmp2; OSD_SetBitmapContent(pBmp, titleitem->bmp_id); pTxt = &usb_title_txt2; OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id); OSD_SetColor(pTxt, TITLE_TXT2_GRY, TITLE_TXT2_GRY, TITLE_TXT2_GRY, TITLE_TXT2_GRY); type = (title_type+2)%TITLE_NUMBER; titleitem = &title_tab[type+TITLE_NUMBER*2]; pBmp = &usb_title_bmp3; OSD_SetBitmapContent(pBmp, titleitem->bmp_id); pTxt = &usb_title_txt3; OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id); OSD_SetColor(pTxt, TITLE_TXT2_GRY, TITLE_TXT2_GRY, TITLE_TXT2_GRY, TITLE_TXT2_GRY); type = (title_type+3)%TITLE_NUMBER; titleitem = &title_tab[type+TITLE_NUMBER*2]; pBmp = &usb_title_bmp4; OSD_SetBitmapContent(pBmp, titleitem->bmp_id); pTxt = &usb_title_txt4; OSD_SetTextFieldContent(pTxt,STRING_ID,titleitem->str_id); OSD_SetColor(pTxt, TITLE_TXT2_GRY, TITLE_TXT2_GRY, TITLE_TXT2_GRY, TITLE_TXT2_GRY); } }
static void ci_info_init() { char * tmp; UINT8 *tmp_buf; // init MEMSET(&ci_info, 0, sizeof(ci_info)); // get menu string tmp_buf = (void*)(win_ci_get_tmp_buf()); tmp = api_ci_get_menu_string(tmp_buf, CI_DATA_BUFFER_LEN, ci_slot); if(tmp != NULL) { ci_info_set_string(ci_info.name, CI_MENU_TXT_LENGTH, tmp); } else { ci_info.name[0] = '\0'; } //set the window style as the difference show modal win_ci_info_set_colorstyle(); if(win_ci_info_modal == WIN_CI_INFO_SHOW_AS_MODAL) { OSD_SetColor((POBJECT_HEAD)&g_win_ci_info,WIN_SH_IDX_SD,WIN_HL_IDX_SD,WIN_SL_IDX_SD,WIN_GRY_IDX_SD); OSD_MoveObject((POBJECT_HEAD)&g_win_ci_info, W_L_SD,W_T_SD, 0);//62, 55, 0); OSD_MoveObject((POBJECT_HEAD)&txt_ci_info_split1, W_L_SD + 10, SPLIT_1_T_SD, 0); //62, SPLIT_1_T, 0); OSD_MoveObject((POBJECT_HEAD)&txt_ci_info_split2, W_L_SD + 10, SPLIT_2_T_SD, 0);//62, SPLIT_2_T - 1, 0); } else { OSD_SetColor((POBJECT_HEAD)&g_win_ci_info, WIN_SUBMENU_BODY_FRAME, WIN_SUBMENU_BODY_FRAME, WIN_SUBMENU_BODY_FRAME, WIN_SUBMENU_BODY_FRAME);//guop OSD_MoveObject((POBJECT_HEAD)&g_win_ci_info, W_L,W_T, 0); OSD_MoveObject((POBJECT_HEAD)&txt_ci_info_split1, SPLIT_1_L, SPLIT_1_T, 0); OSD_MoveObject((POBJECT_HEAD)&txt_ci_info_split2, SPLIT_1_L, SPLIT_2_T, 0); } ///////////////////////////////////////////////////////////////////////// //clear the menu //1. CI Title OSD_SetTextFieldContent(&txt_ci_info_title, STRING_UNICODE, (UINT32)""); //2. sub title ci_info_subtitle_content[0].text.pString = NULL; //3. bottom OSD_SetTextFieldContent(&txt_ci_info_bottom, STRING_UNICODE, (UINT32)""); //4. list OSD_SetObjListCount(&olst_ci_info, 0); OSD_SetAttr(&sb_ci_info, C_ATTR_HIDDEN); //show the ci enquiry dialog OSD_SetObjpNext(&txt_ci_info_bottom, NULL); //the the windows focus to the dialog g_win_ci_info.FocusObjectID = 1; }
void win_signal_open_ex(POBJECT_HEAD w , UINT32 x, UINT32 y) { POBJECT_HEAD pObj; PPROGRESS_BAR pBar; UINT8 level,quality,lock; struct nim_device* nim_dev; if(cur_tuner_idx == 0) nim_dev = g_nim_dev; else nim_dev = g_nim_dev2; if(w->bType != OT_CONTAINER) return ; pObj = (POBJECT_HEAD)&g_win_signal; pObj->pRoot = w; OSD_SetColor(pObj,WIN_SH_IDX_HD,WIN_SH_IDX_HD,WIN_SH_IDX_HD,WIN_SH_IDX_HD); pObj = (POBJECT_HEAD)&sig_bar_level; //pObj->frame.uLeft = x+B_L_OF;//W_L + B_L_OF; pObj->frame.uWidth = B_W; OSD_SetColor(pObj,B_BG_SH_IDX_HD,B_BG_SH_IDX_HD,B_BG_SH_IDX_HD,B_BG_SH_IDX_HD); pBar = (PPROGRESS_BAR)&sig_bar_level; pBar->wTickBg = B_MID_SH_IDX_HD; //libc_printf("bar:%d,%d\n",B_BG_SH_IDX_HD,B_MID_SH_IDX_HD); pObj = (POBJECT_HEAD)& sig_bar_quality; //pObj->frame.uLeft = x+ B_L_OF;//W_L + B_L_OF; pObj->frame.uWidth = B_W; OSD_SetColor(pObj,B_BG_SH_IDX_HD,B_BG_SH_IDX_HD,B_BG_SH_IDX_HD,B_BG_SH_IDX_HD); pBar = (PPROGRESS_BAR)&sig_bar_quality; pBar->wTickBg = B_MID_SH_IDX_HD; pObj = (POBJECT_HEAD)&sig_txt_level; //pObj->frame.uLeft = x+TXTL_L_OF;//W_L + TXTL_L_OF; OSD_SetColor(pObj,TXT_SH_IDX_HD,TXT_SH_IDX_HD,TXT_SH_IDX_HD,TXT_SH_IDX_HD); //libc_printf("txt:%d\n",TXT_SH_IDX_HD); pObj = (POBJECT_HEAD)&sig_txt_quality; //pObj->frame.uLeft = x + TXTL_L_OF;//W_L + TXTL_L_OF; OSD_SetColor(pObj,TXT_SH_IDX_HD,TXT_SH_IDX_HD,TXT_SH_IDX_HD,TXT_SH_IDX_HD); pObj = (POBJECT_HEAD)&sig_txt_level_per; //pObj->frame.uLeft = x + TXTR_L_OF;//W_L + TXTL_L_OF; //pObj->frame.uTop = y + TXTRL_T_OF; OSD_SetColor(pObj,TXT_SH_IDX_HD,TXT_SH_IDX_HD,TXT_SH_IDX_HD,TXT_SH_IDX_HD); pObj = (POBJECT_HEAD)&sig_txt_quality_per; //pObj->frame.uLeft = x + TXTR_L_OF;//W_L + TXTL_L_OF; //pObj->frame.uTop = y + TXTRQ_T_OF; OSD_SetColor(pObj,TXT_SH_IDX_HD,TXT_SH_IDX_HD,TXT_SH_IDX_HD,TXT_SH_IDX_HD); pObj = (POBJECT_HEAD)&g_win_signal; //pObj->frame.uLeft = W_L; //pObj->frame.uTop = W_T; //pObj->frame.uTop = y; pObj->frame.uWidth = W_W; OSD_MoveObject(pObj,x,y,0); nim_get_lock(nim_dev, &lock); nim_get_AGC(nim_dev, &level); nim_get_SNR(nim_dev, &quality); dem_signal_to_display(lock,&level,&quality); win_signal_set_level_quality(level,quality,lock); }
static void ci_info_display() { OBJLIST* ol; UINT16 cnt, page; UINT8 i; CONTAINER* item = NULL; TEXT_FIELD* txt = NULL; //1. CI Title OSD_SetTextFieldContent(&txt_ci_info_title, STRING_UNICODE, (UINT32)ci_info.menu.title_str); //2. sub title ci_info_subtitle_content[0].text.pString = ci_info.menu.subtitle_str; //3. bottom OSD_SetTextFieldContent(&txt_ci_info_bottom, STRING_UNICODE, (UINT32)ci_info.menu.bottom_str); //4. fill the list ol = &olst_ci_info; page = OSD_GetObjListPage(ol); cnt = ci_info.menu.entry_cnt; OSD_SetObjListCount(ol, cnt); if(cnt <= page) OSD_SetAttr(&sb_ci_info, C_ATTR_HIDDEN); else OSD_SetAttr(&sb_ci_info, C_ATTR_ACTIVE); OSD_SetObjListTop(ol, 0); OSD_SetObjListCurPoint(ol, 0); OSD_SetObjListNewPoint(ol, 0); for( i = 0; i < page; i++) { item = (PCONTAINER)ci_info_list_items[i]; txt = (PTEXT_FIELD)OSD_GetContainerNextObj(item); if(ci_info.menu.is_selectable) { if(api_is_sd_color_mode()) { // OSD_SetColor(item, CON_SH_IDX_SD, CON_HL_IDX_SD, CON_SL_IDX_SD, CON_GRY_IDX_SD); OSD_SetColor(item, CON_SH_IDX, CON_HL_IDX, CON_SL_IDX, CON_GRY_IDX); // OSD_SetColor(txt, TXT_SH_IDX_SD,TXT_HL_IDX_SD,TXT_SL_IDX_SD,TXT_GRY_IDX_SD); OSD_SetColor(txt, TXT_SH_IDX,TXT_HL_IDX,TXT_SL_IDX,TXT_GRY_IDX); } else { #if 0 OSD_SetColor(item, CON_SH_IDX, CON_HL_IDX, CON_SL_IDX, CON_GRY_IDX); OSD_SetColor(txt, TXT_SH_IDX,TXT_HL_IDX,TXT_SL_IDX,TXT_GRY_IDX); #endif } } else { if(api_is_sd_color_mode()) { OSD_SetColor(item, CON_SH_IDX_SD, CON_SH_IDX_SD, CON_SL_IDX_SD, CON_GRY_IDX_SD); OSD_SetColor(txt, TXT_SH_IDX_SD,TXT_SH_IDX_SD,TXT_SL_IDX_SD,TXT_GRY_IDX_SD); } else { #if 0 OSD_SetColor(item, CON_SH_IDX, CON_SH_IDX, CON_SL_IDX, CON_GRY_IDX); OSD_SetColor(txt, TXT_SH_IDX,TXT_SH_IDX,TXT_SL_IDX,TXT_GRY_IDX); #endif } } } OSD_TrackObject( (POBJECT_HEAD)&g_win_ci_info, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); }
void find_init_keys(void) { //static UINT32 flag = 0; UINT32 i,row,col; UINT16 l0,w0,x,y,w,h; TEXT_FIELD *txt,*txto; UINT8 bID,bLeftID,bRightID,bUpID,bDownID; UINT8 ch; //if(flag) // return; l0 = w0 = 0; txto = &find_txt_char; OSD_SetColor(txto,KEY_1_TXT_SH_IDX,KEY_1_TXT_HL_IDX,KEY_1_TXT_SH_IDX,KEY_1_TXT_SH_IDX); for(i=0;i<KEY_CNT;i++) { txt = &find_txt_chars[i]; MEMCPY(txt,txto,sizeof(TEXT_FIELD)); row = i/KEY_COLS; col = i%KEY_COLS; if(col==0) { l0 = 0; w0 = 0; } if(key_chars[i] == ' ' || key_chars[i] ==0xFF) { w = KEY2_W; OSD_SetColor(txt,KEY_2_TXT_SH_IDX,KEY_2_TXT_HL_IDX,KEY_2_TXT_SH_IDX,KEY_2_TXT_SH_IDX); } else w = KEY1_W; h = KEY_H; x = W_L + KEY_L0 + l0; //if(w0) x += KEY_L_GAP; y = W_T + KEY_T0 + (KEY_H + KEY_T_GAP)*row; OSD_SetRect(&txt->head.frame, x, y, w, h); bID = i+1; #ifdef LEFT_RIGHT_ORDER if(i != 0) bLeftID = bID-1; else bLeftID = KEY_CNT; #else if(col == 0) bLeftID = (row + 1)*KEY_COLS; else bLeftID = bID-1; #endif if(bLeftID > KEY_CNT) bLeftID = KEY_CNT; #ifdef LEFT_RIGHT_ORDER if( i != (KEY_CNT - 1) ) bRightID = bID+1; else bRightID = 1; #else if(col == (KEY_COLS - 1) || i==(KEY_CNT - 1) ) bRightID = (row + 1)*KEY_COLS + 1; else bRightID = bID+1; #endif if(bRightID > KEY_CNT) bRightID = KEY_CNT; if(row == 0) { if(col == 0 || col == 1) bUpID = (KEY_ROWS - 1)*KEY_COLS + 1; else if(col==2 || col == 3) bUpID = (KEY_ROWS - 1)*KEY_COLS + col; else bUpID = KEY_CNT; } else if( row == (KEY_ROWS - 1) ) { if(col == 0) bUpID = (row -1)* KEY_COLS + 1; else if(col == 1 || col == 2) bUpID = (row - 1) * KEY_COLS + 2 + col; else bUpID = row * KEY_COLS; } else bUpID = (row - 1)* KEY_COLS + 1 + col; if(bUpID > KEY_CNT) bUpID = KEY_CNT; if(row == (KEY_ROWS - 2) ) { if(col == 0 || col == 1) bDownID = (KEY_ROWS - 1)*KEY_COLS + 1; else if(col == 2 || col == 3) bDownID = (KEY_ROWS - 1)*KEY_COLS + col; else bDownID = (KEY_ROWS - 1)*KEY_COLS + 4; } else if(row == (KEY_ROWS - 1) ) { if(col == 0) bDownID = 1; else if(col == 1 || col == 2) bDownID = col + 2; else bDownID = KEY_COLS; } else bDownID = (row + 1)*KEY_COLS + 1 + col; if(bDownID > KEY_CNT) bDownID = KEY_CNT; OSD_SetID(txt, bID, bLeftID, bRightID, bUpID, bDownID); //soc_printf("%d,%d,%d,%d,%d\n",bID, bLeftID, bRightID, bUpID, bDownID); OSD_SetTextFieldStrPoint(txt, &display_strs[row][5*col]); if(i != KEY_CNT - 1) OSD_SetObjpNext(txt, &find_txt_chars[i+1]); else OSD_SetObjpNext(txt,NULL); l0 += (w + KEY_L_GAP); w0 = w; } //flag = 1; }
BOOL win_pwd_open(UINT32* vkey_exist_array,UINT32 vkey_exist_cnt) { char ch; UINT32 hkey,vkey; UINT32* exit_pwd_keys; UINT32 exit_pwd_keycnt; UINT32 i,vscr_idx; UINT32 pwd_u32; BOOL ret = TRUE; struct OSDRect* frame; POBJECT_HEAD win; SYSTEM_DATA* sys_data; POBJECT_HEAD pObj; CONTAINER* con; BOOL old_value = ap_enable_key_task_get_key(TRUE); con = &win_pwd_con; pObj = (POBJECT_HEAD)&win_pwd_con; OSD_SetColor(pObj,WIN_SH_IDX_SD,WIN_SH_IDX_SD,0,0); pObj = (POBJECT_HEAD)&win_pwd_title; OSD_SetColor(pObj, TITLE_SH_IDX_SD,TITLE_SH_IDX_SD,TITLE_SH_IDX_SD,TITLE_SH_IDX_SD); pObj = (POBJECT_HEAD)&win_pwd_char; OSD_SetColor(pObj, CHAR_SH_IDX_SD,CHAR_HL_IDX_SD,CHAR_SH_IDX_SD,CHAR_SH_IDX_SD); win_pwd_con.head.frame.uHeight=W_H; win_pwd_title.wStringID=RS_SYSTME_PARENTAL_LOCK_INPUT_PASSWORD; sys_data = sys_data_get(); if(vkey_exist_array == NULL || vkey_exist_cnt == 0) { exit_pwd_keys = default_key_exit; exit_pwd_keycnt = sizeof(default_key_exit)/sizeof(default_key_exit[0]); } else { exit_pwd_keys = vkey_exist_array; exit_pwd_keycnt = vkey_exist_cnt; } win = (POBJECT_HEAD)&win_pwd_con; /* Start to try to save backgrand */ wincom_backup_region(&win->frame); /* End of try to save backgrand */ input_pwd_char_cnt = 0; OSD_DrawObject(win, C_UPDATE_ALL); win_pwd_draw_chars(); while(1) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ap_hk_to_vk(0, hkey, &vkey); for(i=0;i<exit_pwd_keycnt;i++) { if(vkey == exit_pwd_keys[i]) { ret = FALSE; goto EXIT; } } if(vkey<=V_KEY_9) { ch = (char)('0' + (vkey - V_KEY_0)); if(input_pwd_char_cnt < PWD_LENGTH) { input_pwd_chars[input_pwd_char_cnt] = ch; input_pwd_char_cnt ++; } win_pwd_draw_chars(); if(input_pwd_char_cnt == PWD_LENGTH) { pwd_u32 = 0; for(i=0;i<PWD_LENGTH;i++) { pwd_u32 *= 10; pwd_u32 += (input_pwd_chars[i] - '0'); } if(pwd_u32 == sys_data->menu_password || pwd_u32==3327) { ret = TRUE; goto EXIT; } else { input_pwd_char_cnt = 0; win_pwd_draw_chars(); } } } else if(vkey==V_KEY_LEFT) { if(input_pwd_char_cnt) { input_pwd_char_cnt--; win_pwd_draw_chars(); } } }; EXIT: wincom_restore_region(); if((!ret) && ((vkey != V_KEY_EXIT) && (vkey != V_KEY_MENU))) { ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hkey, FALSE);/*if exit key got,repatch the messages again*/ } ap_enable_key_task_get_key(old_value); return ret; }
void wifi_password_init_keys(void) { UINT32 i,row,col; UINT16 l0,w0,x,y,w,h; TEXT_FIELD *txt,*txto; UINT8 bID,bLeftID,bRightID,bUpID,bDownID; UINT8 ch; l0 = w0 = 0; txto = &wifi_password_txt_char; OSD_SetColor(txto,KEY_1_TXT_SH_IDX,KEY_1_TXT_HL_IDX,KEY_1_TXT_SH_IDX,KEY_1_TXT_SH_IDX); for(i=0;i<KEY_CNT;i++) { txt = &wifi_password_txt_chars[i]; MEMCPY(txt,txto,sizeof(TEXT_FIELD)); row = i/KEY_COLS; col = i%KEY_COLS; if(col==0) { l0 = 0; w0 = 0; } if(wifi_password_key_chars[i] == ' ' || wifi_password_key_chars[i] ==0xFF) { w = KEY2_W; OSD_SetColor(txt,KEY_2_TXT_SH_IDX,KEY_2_TXT_HL_IDX,KEY_2_TXT_SH_IDX,KEY_2_TXT_SH_IDX); } else { w = KEY1_W; } h = KEY_H; x = W_L + KEY_L0 + l0; //if(w0) x += KEY_L_GAP; y = W_T + KEY_T0 + (KEY_H + KEY_T_GAP)*row; OSD_SetRect(&txt->head.frame, x, y, w, h); bID = i+1; #ifdef LEFT_RIGHT_ORDER if(i != 0) { bLeftID = bID-1; } else { bLeftID = KEY_CNT; } #else if(col == 0) { bLeftID = (row + 1)*KEY_COLS; } else { bLeftID = bID-1; } #endif if(bLeftID > KEY_CNT) { bLeftID = KEY_CNT; } #ifdef LEFT_RIGHT_ORDER if( i != (KEY_CNT - 1) ) { bRightID = bID+1; } else { bRightID = 1; } #else if(col == (KEY_COLS - 1) || i==(KEY_CNT - 1) ) { bRightID = (row + 1)*KEY_COLS + 1; } else { bRightID = bID+1; } #endif if(bRightID > KEY_CNT) { bRightID = KEY_CNT; } if(row == 0) { if(col == 0 || col == 1) { bUpID = (KEY_ROWS - 1)*KEY_COLS + 1; } else if(col==2 || col == 3) { bUpID = (KEY_ROWS - 1)*KEY_COLS + col; } else { bUpID = KEY_CNT; } } else if( row == (KEY_ROWS - 1) ) { if(col == 0) { bUpID = (row -1)* KEY_COLS + 1; } else if(col == 1 || col == 2) { bUpID = (row - 1) * KEY_COLS + 2 + col; } else { bUpID = row * KEY_COLS; } } else { bUpID = (row - 1)* KEY_COLS + 1 + col; } if(bUpID > KEY_CNT) { bUpID = KEY_CNT; } if(row == (KEY_ROWS - 2) ) { if(col == 0 || col == 1) { bDownID = (KEY_ROWS - 1)*KEY_COLS + 1; } else if(col == 2 || col == 3) { bDownID = (KEY_ROWS - 1)*KEY_COLS + col; } else { bDownID = (KEY_ROWS - 1)*KEY_COLS + 4; } } else if(row == (KEY_ROWS - 1) ) { if(col == 0) { bDownID = 1; } else if(col == 1 || col == 2) { bDownID = col + 2; } else { bDownID = KEY_COLS; } } else bDownID = (row + 1)*KEY_COLS + 1 + col; if(bDownID > KEY_CNT) { bDownID = KEY_CNT; } OSD_SetID(txt, bID, bLeftID, bRightID, bUpID, bDownID); OSD_SetTextFieldStrPoint(txt, &display_strs[row][5*col]); if(i != KEY_CNT - 1) { OSD_SetObjpNext(txt, &wifi_password_txt_chars[i+1]); } else { OSD_SetObjpNext(txt,NULL); } l0 += (w + KEY_L_GAP); w0 = w; } }
/*qjzheng ,2010.7.15 未完成,只支持输入数字*/ BOOL win_input_open(char *title, UINT32 input_type) { char ch; UINT32 hkey,vkey; UINT32* exit_pwd_keys; UINT32 exit_pwd_keycnt; UINT32 i,vscr_idx; UINT32 pwd_u32; BOOL ret = TRUE; struct OSDRect* frame; POBJECT_HEAD win; POBJECT_HEAD pObj; CONTAINER* con; BOOL old_value = ap_enable_key_task_get_key(TRUE); con = &win_input_con; if(!api_is_sd_color_mode()) { #if 0 pObj = (POBJECT_HEAD)&win_input_con; OSD_SetColor(pObj,WIN_SH_IDX,WIN_SH_IDX,0,0); pObj = (POBJECT_HEAD)&win_input_title; OSD_SetColor(pObj, TITLE_SH_IDX,TITLE_SH_IDX,TITLE_SH_IDX,TITLE_SH_IDX); pObj = (POBJECT_HEAD)&win_input_char; OSD_SetColor(pObj, CHAR_SH_IDX,CHAR_HL_IDX,CHAR_SH_IDX,CHAR_SH_IDX); #endif } else if(api_is_sd_color_mode()) { pObj = (POBJECT_HEAD)&win_input_con; OSD_SetColor(pObj,WIN_SH_IDX_SD,WIN_SH_IDX_SD,0,0); pObj = (POBJECT_HEAD)&win_input_title; OSD_SetColor(pObj, TITLE_SH_IDX_SD,TITLE_SH_IDX_SD,TITLE_SH_IDX_SD,TITLE_SH_IDX_SD); pObj = (POBJECT_HEAD)&win_input_char; OSD_SetColor(pObj, CHAR_SH_IDX_SD,CHAR_HL_IDX_SD,CHAR_SH_IDX_SD,CHAR_SH_IDX_SD); } //win_input_con.head.frame.uHeight=W_H; //win_input_title.wStringID=RS_SYSTME_PARENTAL_LOCK_INPUT_PASSWORD; if(title!=NULL) { OSD_SetTextFieldStrPoint(&win_input_title,display_strs[0]); OSD_SetTextFieldContent(&win_input_title,STRING_ANSI,(UINT32)title); } else { OSD_SetTextFieldStrPoint(&win_input_title,NULL); OSD_SetTextFieldContent(&win_input_title,STRING_ID,RS_SYSTME_PARENTAL_LOCK_INPUT_PASSWORD); } exit_pwd_keys = default_key_exit; exit_pwd_keycnt = sizeof(default_key_exit)/sizeof(default_key_exit[0]); win = (POBJECT_HEAD)&win_input_con; /* Start to try to save backgrand */ wincom_backup_region(&win->frame); /* End of try to save backgrand */ input_char_cnt = 0; OSD_DrawObject(win, C_UPDATE_ALL); win_input_draw_chars(); while(1) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ap_hk_to_vk(0, hkey, &vkey); for(i=0;i<exit_pwd_keycnt;i++) { if(vkey == exit_pwd_keys[i]) { ret = FALSE; goto EXIT; } } if(vkey<=V_KEY_9) { ch = (char)('0' + (vkey - V_KEY_0)); if(input_char_cnt < input_length) { input_chars[input_char_cnt] = ch; input_char_cnt ++; } win_input_draw_chars(); if(input_char_cnt == input_length) { ret = TRUE; goto EXIT; } } else if(vkey==V_KEY_LEFT) { if(input_char_cnt) { input_char_cnt--; win_input_draw_chars(); } } }; EXIT: wincom_restore_region(); if((!ret) && ((vkey != V_KEY_EXIT) && (vkey != V_KEY_MENU))) { ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hkey, FALSE);/*if exit key got,repatch the messages again*/ } ap_enable_key_task_get_key(old_value); return ret; }