UINT32 win_movefile_open(FileListHandle move_dirlist, char *move_device) { UINT32 hkey; CONTAINER *pop_win; TEXT_FIELD *pTxt; PRESULT ret = PROC_LOOP; BOOL old_value = ap_enable_key_task_get_key(TRUE); win_move_dirlist = move_dirlist; STRCPY(movefile_cur_device, move_device); move_file_flag = 0; pop_win = &g_win_mp_move; OSD_SetContainerFocus(pop_win, 1); wincom_backup_region(&pop_win->head.frame); OSD_ObjOpen((POBJECT_HEAD)pop_win, 0); while(ret != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ret = OSD_ObjProc((POBJECT_HEAD)pop_win, (MSG_TYPE_KEY<<16),hkey, 0); } wincom_restore_region(); ap_enable_key_task_get_key(old_value); return move_file_flag; }
void win_playlist_open(WIN_PLAYLIST_TYPE playlist_type) { UINT32 hkey; VSCR vscr; CONTAINER *pop_win; TEXT_FIELD *pTxt; PRESULT ret = PROC_LOOP; BOOL old_value = ap_enable_key_task_get_key(TRUE); cur_playlist_type = playlist_type; cur_display_playlist = win_play_list[playlist_type]; pop_win = &g_win_usb_playlist; OSD_SetContainerFocus(pop_win, 1); wincom_backup_region(&pop_win->head.frame); OSD_ObjOpen((POBJECT_HEAD)pop_win, 0); while(ret != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ret = OSD_ObjProc((POBJECT_HEAD)pop_win, (MSG_TYPE_KEY<<16),hkey, 0); } wincom_restore_region(); ap_enable_key_task_get_key(old_value); }
UINT8 win_map_search_input_menu_open(char *string) { CONTAINER *win; PRESULT ret = PROC_LOOP; UINT32 hkey; TEXT_FIELD *txt; EDIT_FIELD *eft; UINT16 strID; UINT32 value = 0; UINT8 input_string[MAP_SEARCH_INPUT_LEN]; BOOL old_value = ap_enable_key_task_get_key(TRUE); bMapSearchInputOK = FALSE; txt = &txt_map_search_input_title; strID = RS_HELP_SEARCH; OSD_SetTextFieldContent(txt, STRING_ID,(UINT32)strID); eft = &edt_map_search_input_item; OSD_SetEditFieldContent(eft, STRING_ANSI, ""); win = &g_win_map_search_input; OSD_SetContainerFocus(win, 1); OSD_SetTextFieldContent(&txt_map_search_input_caps,STRING_ANSI,(UINT32)btn_txt_strs[0]); OSD_SetTextFieldContent(&txt_map_search_input_del,STRING_ANSI,(UINT32)btn_txt_strs[1]); OSD_SetTextFieldContent(&txt_map_search_input_ok,STRING_ANSI,(UINT32)btn_txt_strs[2]); OSD_SetTextFieldContent(&txt_map_search_input_cancel,STRING_ANSI,(UINT32)btn_txt_strs[3]); wincom_backup_region(&(win->head.frame)); OSD_ObjOpen((POBJECT_HEAD)win, 0); while(ret != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ret = OSD_ObjProc((POBJECT_HEAD)win, (MSG_TYPE_KEY<<16),hkey, 0); } if (bMapSearchInputOK) { eft = &edt_map_search_input_item; value = OSD_GetEditFieldContent(eft); ComUniStrToAsc((UINT8 *)value, input_string); map_search_input_get_string(string, input_string); } wincom_restore_region(); ap_enable_key_task_get_key(old_value); return bMapSearchInputOK; }
BOOL win_keyboard_rename_open(UINT16* set_name,UINT8** ret_name,check_name_func check_func ) { UINT16 strID; UINT32 hkey; PRESULT ret; TEXT_FIELD *txt; EDIT_FIELD *edf; CONTAINER *win; win = &g_win_find; wincom_backup_region(&win->head.frame); set_color_style(); BOOL old_value = ap_enable_key_task_get_key(TRUE); strID = RS_HELP_RENAME; win_keyboard_set_title(strID); name_valid_func = check_func; check_ok = FALSE; #ifndef KEYBOARD_SUPPORT edf = &find_edt1; MEMSET(input_name_str,0,sizeof(input_name_str)); OSD_SetEditFieldContent(edf, STRING_UNICODE, (UINT32)set_name); #else txt = &find_input; MEMSET(input_name_str,0,sizeof(input_name_str)); OSD_SetTextFieldContent(txt, STRING_UNICODE,(UINT32)set_name); #endif win = &g_win_find; set_keyboard_flag(TRUE); find_init_keys(); find_set_key_display(); ret = OSD_ObjOpen((POBJECT_HEAD)win, 0); while(ret != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ret = OSD_ObjProc((POBJECT_HEAD)win, (MSG_TYPE_KEY<<16),hkey, 0); } if(check_ok) { *ret_name = (UINT8*)input_name_str; } else { *ret_name = NULL; } set_keyboard_flag(FALSE); wincom_restore_region(); ap_enable_key_task_get_key(old_value); return (check_ok); }
void win_playlist_setup_open(void) { UINT32 hkey; CONTAINER *pop_win; PRESULT ret = PROC_LOOP; BOOL old_value = ap_enable_key_task_get_key(TRUE); pop_win = &g_win_slidesetup; OSD_SetContainerFocus(pop_win, 1); wincom_backup_region(&pop_win->head.frame); OSD_ObjOpen((POBJECT_HEAD)pop_win, 0); while(ret != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ret = OSD_ObjProc((POBJECT_HEAD)pop_win, (MSG_TYPE_KEY<<16),hkey, 0); } wincom_restore_region(); ap_enable_key_task_get_key(old_value); }
BOOL win_timerset_open(TIMER_SET_CONTENT* settimer,TIMER_SET_CONTENT* rettimer,BOOL check_starttime) { POBJECT_HEAD pObj = (POBJECT_HEAD)&g_win_timerset; PRESULT bResult = PROC_LOOP; UINT32 hkey; UINT8 cur_mode,mode; UINT8 group_idx; date_time dt,dt1; BOOL old_value = ap_enable_key_task_get_key(TRUE); sys_data_check_channel_groups(); cur_mode = sys_data_get_cur_chan_mode(); group_idx = sys_data_get_cur_group_index(); timer_set_ok_cancel_flag = 0; MEMSET(&timer_set,0,sizeof(TIMER_SET_CONTENT)); if(settimer != NULL) MEMCPY(&timer_set,settimer,sizeof(TIMER_SET_CONTENT)); if(timer_set.timer_mode != TIMER_MODE_OFF && timer_set.timer_service !=TIMER_SERVICE_MESSAGE) { if(timer_set.wakeup_chan_mode>1) timer_set.wakeup_chan_mode = 1; mode = timer_set.wakeup_chan_mode; } else { mode = cur_mode; timer_set.wakeup_chan_mode = cur_mode; } if(timer_set.timer_mode == TIMER_MODE_OFF) { timer_set_modify_add_flag = TIMER_ADD; timer_set_check_starttime_flag = 1; } else { timer_set_modify_add_flag = TIMER_MODIFY; timer_set_check_starttime_flag = 1; } get_local_time(&dt1); dt1.min = dt1.min/10*10; dt1.sec = 0; convert_time_by_offset(&dt,&dt1,0,10); if(timer_set_modify_add_flag == TIMER_ADD) { timer_set.wakeup_year = dt.year; timer_set.wakeup_month = dt.month; timer_set.wakeup_day = dt.day; timer_set.wakeup_time = dt.hour * 60 + dt.min; timer_set.wakeup_state = TIMER_STATE_READY; } if(timer_set.timer_service == TIMER_SERVICE_MESSAGE) timer_set.wakeup_duration_time = 0; sys_data_set_cur_chan_mode(mode); sys_data_change_group(0); OSD_SetContainerFocus(&g_win_timerset, TIMER_MODE_ID); OSD_ObjOpen(pObj, MENU_OPEN_TYPE_OTHER); while(bResult != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) { win_timerset_set_currenttime(TRUE); continue; } bResult = OSD_ObjProc(pObj, (MSG_TYPE_KEY<<16),hkey, 0); } if(timer_set_ok_cancel_flag) MEMCPY(rettimer,&timer_set,sizeof(TIMER_SET_CONTENT)); sys_data_set_cur_chan_mode(cur_mode); sys_data_change_group(group_idx); sys_data_save(1); ap_enable_key_task_get_key(old_value); return timer_set_ok_cancel_flag; }
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; }
UINT32 win_disk_operate_open(UINT8 type, UINT8 *operate_result) { CONTAINER* win; PRESULT ret = PROC_LOOP; UINT32 hkey; TEXT_FIELD* txt; UINT16 strID; MULTISEL *msel; char str[30]; char rec_disk[16], tms_disk[16]; operate_type = type; disk_operate_ok = 0; txt = &disk_operate_title; switch(type) { case 0: sprintf(str, "%s", "Format"); mode_select = 0; disk_format_mode_num = get_fsystem_installed(disk_mode, 8); if(!disk_format_mode_num) return 0xFF; break; case 1: sprintf(str, "%s", "DVR Set"); dvr_select_type = 0; #ifdef PVR3_SUPPORT dvr_type_num = 3; #else dvr_type_num = 1;//3; #endif break; case 2: //partition_select = 0; partition_num = init_valid_partition(disk_partition, 64); if(!partition_num) return 0xFF; if(partition_num > 2) { qsort(disk_partition, partition_num, 16, _partition_compare); } if(partition_select >= partition_num) partition_select = 0; pvr_get_cur_mode(rec_disk, tms_disk); //sprintf(str, "%s", (rec_disk[5] == 'h') ? "Copy: HDD to USB" : "Copy: USB to HDD"); sprintf(str, "%s", "Copy to Other Device"); break; default: break; } ComAscStr2Uni(str, display_strs[2]); /* set title */ win = &g_win_disk_operate; OSD_SetContainerFocus(win, MENU_DISK_FORMAT); OSD_ObjOpen((POBJECT_HEAD)win, 0); disk_operate_opened = 1; BOOL old_value = ap_enable_key_task_get_key(TRUE); while(ret != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ret = OSD_ObjProc((POBJECT_HEAD)win, (MSG_TYPE_KEY<<16),hkey, 0); } ap_enable_key_task_get_key(old_value); switch(type) { case 0: *operate_result = mode_select; break; case 1: *operate_result = dvr_select_type; break; case 2: *operate_result = partition_select; break; default: break; } disk_operate_opened = 0; return disk_operate_ok; }
UINT32 win_tpsrch_open(UINT32* ftaonly_VPid, UINT32* srch_chan_APid,UINT32* nit_PPid) { CONTAINER *win; MULTISEL *msel; PRESULT ret = PROC_LOOP; UINT32 hkey,val; UINT16 mode; BOOL old_value = ap_enable_key_task_get_key(TRUE); tpsrch_ok = 0; win = &g_win_tpsrch_set; OSD_SetContainerFocus(win, BTN_OK_ID); OSD_ObjOpen((POBJECT_HEAD)win, 0); while(ret != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ret = OSD_ObjProc((POBJECT_HEAD)win, (MSG_TYPE_KEY<<16),hkey, 0); } ap_enable_key_task_get_key(old_value); mode = OSD_GetMultiselSel(&tpsrch_sel0); if(mode==NORMAL_SRCH) { msel = &tpsrch_sel1; val = OSD_GetMultiselSel(msel); if(val == 0) *ftaonly_VPid = P_SEARCH_FTA | P_SEARCH_SCRAMBLED; else *ftaonly_VPid = P_SEARCH_FTA; msel = &tpsrch_sel2; val = OSD_GetMultiselSel(msel); if(val==1) *srch_chan_APid = P_SEARCH_TV; else if(val==2) *srch_chan_APid = P_SEARCH_RADIO; else *srch_chan_APid = P_SEARCH_TV | P_SEARCH_RADIO; msel = &tpsrch_sel3; val = OSD_GetMultiselSel(msel); *nit_PPid = val; } else //PID_SEARCH { *ftaonly_VPid = OSD_GetEditFieldContent(&tpsrch_edt1); *srch_chan_APid = OSD_GetEditFieldContent(&tpsrch_edt2); *nit_PPid = OSD_GetEditFieldContent(&tpsrch_edt3); } if(tpsrch_ok==1) { if(mode == NORMAL_SRCH) return 1; else //PID_SEARCH return 2; } return tpsrch_ok; }
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; }
UINT8 win_news_edit_menu_open(UINT8 mode, NEWS_ADDR_T *news_addr) { CONTAINER *win; PRESULT ret = PROC_LOOP; UINT32 hkey; TEXT_FIELD *txt; EDIT_FIELD *eft; UINT16 strID; UINT32 value = 0; UINT16 *unistr=NULL; BOOL old_value = ap_enable_key_task_get_key(TRUE); news_addr_edit_mode = mode; bNewsAddrEditOK = FALSE; txt = &txt_news_edit_title; if(mode == 0) strID = RS_HELP_EDIT; else strID = RS_HELP_ADD; OSD_SetTextFieldContent(txt, STRING_ID,(UINT32)strID); eft = &edt_news_edit_item1; OSD_SetEditFieldContent(eft, STRING_UNICODE, news_addr->news_addr_name); eft = &edt_news_edit_item2; OSD_SetEditFieldContent(eft, STRING_ANSI, news_addr->news_addr_url); win = &g_win_news_edit; OSD_SetContainerFocus(win, 1); #if 1 unistr = OSD_GetUnicodeString(btn_txt_strs[0]); OSD_SetTextFieldContent(&txt_news_edit_caps,STRING_UNICODE,(UINT32)unistr); unistr = OSD_GetUnicodeString(btn_txt_strs[1]); OSD_SetTextFieldContent(&txt_news_edit_del,STRING_UNICODE,(UINT32)unistr); unistr = OSD_GetUnicodeString(btn_txt_strs[2]); OSD_SetTextFieldContent(&txt_news_edit_ok,STRING_UNICODE,(UINT32)unistr); unistr = OSD_GetUnicodeString(btn_txt_strs[3]); OSD_SetTextFieldContent(&txt_news_edit_cancel,STRING_UNICODE,(UINT32)unistr); #endif wincom_backup_region(&(win->head.frame)); OSD_ObjOpen((POBJECT_HEAD)win, 0); while(ret != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ret = OSD_ObjProc((POBJECT_HEAD)win, (MSG_TYPE_KEY<<16),hkey, 0); } if (bNewsAddrEditOK) { eft = &edt_news_edit_item1; value = OSD_GetEditFieldContent(eft); //ComUniStrToAsc((UINT8 *)value, news_addr->news_addr_name); ComUniStrCopyChar(news_addr->news_addr_name,(UINT8 *)value); eft = &edt_news_edit_item2; value = OSD_GetEditFieldContent(eft); ComUniStrToAsc((UINT8 *)value, news_addr->news_addr_url); } wincom_restore_region(); ap_enable_key_task_get_key(old_value); return bNewsAddrEditOK; }
BOOL win_wifi_keyboard_password_input_open(UINT16* set_name,UINT8** ret_name,check_name_func check_func ) { UINT32 hkey; PRESULT ret; CONTAINER *win; win = &g_win_wifi_password; wincom_backup_region(&win->head.frame); wifi_password_set_color_style(); BOOL old_value = ap_enable_key_task_get_key(TRUE); name_valid_func = check_func; wifi_password_check_ok = FALSE; MEMSET(wifi_password_str,0,sizeof(wifi_password_str)); ComUniStrCopy(&wifi_password_str[0], set_name); wifi_password_str_len = ComUniStrLen(wifi_password_str); if(wifi_password_str_len>MAX_DISPLAY_STR_LEN) { wifi_password_display_start_ptr=wifi_password_str_len-MAX_DISPLAY_STR_LEN; } else { wifi_password_display_start_ptr=0; } ComUniStrCopy(&wifi_password_display_buffer[0], &wifi_password_str[wifi_password_display_start_ptr]); OSD_SetTextFieldContent((POBJECT_HEAD)&wifi_password_input, STRING_UNICODE,(UINT32)&wifi_password_display_buffer[0]); win = &g_win_wifi_password; wifi_password_init_keys(); wifi_password_set_key_display(); ret = OSD_ObjOpen((POBJECT_HEAD)win, 0); while(ret != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ret = OSD_ObjProc((POBJECT_HEAD)win, (MSG_TYPE_KEY<<16),hkey, 0); } if(wifi_password_check_ok) { *ret_name = (UINT8*)wifi_password_str; } else { *ret_name = NULL; } wincom_restore_region(); ap_enable_key_task_get_key(old_value); return (wifi_password_check_ok); }
/*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; }