static PRESULT find_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; VACTION unact; UINT8 i,bID; UINT32 str_len; char ch,str_temp[2]; bID = OSD_GetObjID(pObj); switch(event) { case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); ret = PROC_LOOP; str_len = ComUniStrLen(input_name_str); if(unact == VACT_DEL || (unact == VACT_ENTER && key_chars[bID - 1] == 0x7F) ) /* DEL */ { if(str_len>0) { input_name_str[str_len-1] = 0; OSD_DrawObject((POBJECT_HEAD)&find_input, C_UPDATE_ALL); if(!edit_keyboard_flag) { input_callback((UINT8*)input_name_str); } } } else if(unact == VACT_OK || (unact == VACT_ENTER && key_chars[bID - 1] == 0xFF) ) /* OK */ { check_ok = TRUE; ret = PROC_LEAVE; if(name_valid_func != NULL) { if(name_valid_func(input_name_str) == 0) { ret = PROC_LEAVE; } else { ret = PROC_LOOP; } } } else if(unact == VACT_ENTER) { ch = key_chars[bID - 1]; if(str_len < MAX_INPUT_STR_LEN) { SetUniStrCharAt(input_name_str,ch,str_len); libc_printf("ch=%d,str_len=%d\n",ch,str_len); input_name_str[str_len + 1] = 0; OSD_DrawObject((POBJECT_HEAD)&find_input, C_UPDATE_ALL); if(!edit_keyboard_flag) { input_callback((UINT8*)input_name_str); } } } else if(unact == VACT_CAPS) { #ifdef KB_SUPPORT_SPECAIL_CHAR find_set_chars(1,FALSE); #else str_temp[1] = '\0'; for(i = 0;i < CHRACTER_CNT;i++) { if((key_chars[i] >= 'a') && (key_chars[i] <= 'z')) { key_chars[i] = key_chars[i] - ('a' - 'A'); } else if((key_chars[i] >= 'A') && (key_chars[i] <= 'Z')) { key_chars[i] = key_chars[i] + ('a' - 'A'); } str_temp[0] = key_chars[i]; OSD_SetTextFieldContent(&find_txt_chars[i], STRING_ANSI,(UINT32)str_temp); } #endif OSD_TrackObject((POBJECT_HEAD)&g_win_find, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); //draw_caps_colbtn_ext(COLBTN_L, COLBTN_T, 1,IM_EPG_COLORBUTTON_YELLOW); //draw_del_colbtn_ext(COLBTN_L + 120, COLBTN_T, 1,IM_EPG_COLORBUTTON_RED); //draw_ok_colbtn_ext(COLBTN_L + 240,COLBTN_T, 1,IM_EPG_COLORBUTTON_BLUE); if(!api_is_sd_color_mode()) { #if 0 draw_caps_colbtn_ext(COLBTN_L, COLBTN_T, 1,IM_EPG_COLORBUTTON_YELLOW); draw_del_colbtn_ext(COLBTN_L + 120, COLBTN_T, 1,IM_EPG_COLORBUTTON_RED); draw_ok_colbtn_ext(COLBTN_L + 240, COLBTN_T, 1,IM_EPG_COLORBUTTON_BLUE); #endif } else { draw_caps_colbtn_ext(COLBTN_L, COLBTN_T, 1,IM_EPG_COLORBUTTON_RED); /*sky.bi 20110112*/ draw_del_colbtn_ext(COLBTN_L + 120, COLBTN_T, 1,IM_EPG_COLORBUTTON_GREEN); /*sky.bi 20110112*/ draw_ok_colbtn_ext(COLBTN_L + 240, COLBTN_T, 1,IM_EPG_COLORBUTTON_YELLOW); /*sky.bi 20110112*/ // draw_caps_colbtn_ext(COLBTN_L, COLBTN_T, 1,IM_EPG_COLORBUTTON_YELLOW); // draw_del_colbtn_ext(COLBTN_L + 120, COLBTN_T, 1,IM_EPG_COLORBUTTON_RED); // draw_ok_colbtn_ext(COLBTN_L + 240, COLBTN_T, 1,IM_EPG_COLORBUTTON_BLUE); } } break; } return ret; }
static PRESULT wifi_password_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; VACTION unact; UINT8 bID; UINT32 pos0; switch(event) { case EVN_PRE_OPEN: wifi_password_set_color_style(); api_inc_wnd_count(); win_wifi_password_keyboard_set_title(RS_SYSTME_PARENTAL_LOCK_INPUT_PASSWORD); wifi_password_init_keys(); wifi_password_set_key_display(); break; case EVN_POST_OPEN: #ifdef OSD_12 draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L-10, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 280+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #else draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 240+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #endif break; case EVN_PRE_CLOSE: /* Make OSD not flickering */ *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG; break; case EVN_POST_CLOSE: api_dec_wnd_count(); break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); if(unact == VACT_CANCEL) { wifi_password_check_ok = FALSE; ret = PROC_LEAVE; } #ifdef RC_PHILIPS_RCMM else if(((unact >= VACT_NUM_0 && unact<= VACT_NUM_9)||(unact >= VACT_sh_0 && unact<= VACT_sh_9)||(unact >= VACT_alt_0 && unact<= VACT_alt_9))&&(change_char_for_findkeyborad==1)) { change_char_for_findkeyborad=0; if(unact >= VACT_alt_0 && unact<= VACT_alt_9) { if((unact==VACT_alt_0)) bID =39;// 1 else if((unact==VACT_alt_1)) bID =40;// 2 else if((unact==VACT_alt_2)) bID =41;// 3 else if((unact==VACT_alt_3)) bID =42;//E else if((unact==VACT_alt_4)) bID =43;//R else if((unact==VACT_alt_5)) bID =44;//T else if((unact==VACT_alt_6)) bID =45;//Y else if((unact==VACT_alt_7)) bID =46;//U else if((unact==VACT_alt_8)) bID =47;//I else if((unact==VACT_alt_9)) bID =48;//O } else { if((unact==VACT_NUM_0)||(unact==VACT_sh_0)) bID =16;//P else if((unact==VACT_NUM_1)||(unact==VACT_sh_1)) bID =17;//Q else if((unact==VACT_NUM_2)||(unact==VACT_sh_2)) bID =23;//w else if((unact==VACT_NUM_3)||(unact==VACT_sh_3)) bID =5;//E else if((unact==VACT_NUM_4)||(unact==VACT_sh_4)) bID =18;//R else if((unact==VACT_NUM_5)||(unact==VACT_sh_5)) bID =20;//T else if((unact==VACT_NUM_6)||(unact==VACT_sh_6)) bID =25;//Y else if((unact==VACT_NUM_7)||(unact==VACT_sh_7)) bID =21;//U else if((unact==VACT_NUM_8)||(unact==VACT_sh_8)) bID =9;//I else if((unact==VACT_NUM_9)||(unact==VACT_sh_9)) bID =15;//O //libc_printf("\nlllll00000000000wwwwwwww===%d\n",cur_display_mode); if((unact >= VACT_NUM_0 && unact<= VACT_NUM_9)&&(cur_display_mode2==0)) find_set_chars(1); else if((unact >= VACT_sh_0 && unact<= VACT_sh_9)&&(cur_display_mode2==1)) find_set_chars(1); OSD_TrackObject((POBJECT_HEAD)&g_win_wifi_password, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); #ifdef OSD_12 draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L-10, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 280+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #else draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 240+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #endif } OSD_ChangeFocus( pObj,bID,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); ap_send_msg(CTRL_MSG_SUBTYPE_KEY_UI, V_KEY_ENTER, TRUE); ret = PROC_LOOP; } else if((unact >= VACT_EDIT_A&& unact<= VACT_EDIT_COMMA) ||(unact >= VACT_EDIT_Z&& unact<= VACT_EDIT_SPACE) ||(unact >= VACT_sh_A&& unact<= VACT_sh_M) ||(unact == VACT_sh_COM) ||(unact >= VACT_alt_A&& unact<= VACT_alt_WWW) ) { // libc_printf("\nssssssssssssssss===%d\n"); if((unact >= VACT_alt_A&& unact<= VACT_alt_WWW)) { if((unact==VACT_alt_A)) bID =52;// ? else if((unact==VACT_alt_S))//大写里 bID =27;// ! else if((unact==VACT_alt_D)) bID =28;// # else if((unact==VACT_alt_F)) bID =29;// $ else if((unact==VACT_alt_G)) bID =30;// % else if((unact==VACT_alt_H)) bID =51;// & else if((unact==VACT_alt_J)) bID =32;//* else if((unact==VACT_alt_K)) bID =33;// ( else if((unact==VACT_alt_L)) bID =34;// ) else if((unact==VACT_alt_Z)) bID =36;// + else if((unact==VACT_alt_X)) bID =35;// - //else if((unact==VACT_alt_C)) // bID =3;//C else if((unact==VACT_alt_COMMA)) bID =27;// : else if((unact==VACT_alt_V))//小写里 bID =30;// / else if((unact==VACT_alt_B)) bID =32;// _ else if((unact==VACT_alt_N)) bID =29;//N //else if((unact==VACT_alt_M)) // bID =29;// ' else if((unact==VACT_alt_WWW)) bID =28;// : if(((unact==VACT_alt_S) ||(unact==VACT_alt_D) ||(unact==VACT_alt_F) ||(unact==VACT_alt_G) ||(unact==VACT_alt_J) ||(unact==VACT_alt_K) ||(unact==VACT_alt_L) ||(unact==VACT_alt_Z) ||(unact==VACT_alt_X)) &&(cur_display_mode2==1) ) { find_set_chars(1); } else if(((unact==VACT_alt_V) ||(unact==VACT_alt_B) ||(unact==VACT_alt_WWW) ||(unact==VACT_alt_COMMA) ||(unact==VACT_alt_N)) &&(cur_display_mode2==0) ) { find_set_chars(1); } } else { if((unact==VACT_EDIT_A)||(unact==VACT_sh_A)) bID =1;//A else if((unact==VACT_EDIT_S)||(unact==VACT_sh_S)) bID =19;//S else if((unact==VACT_EDIT_D)||(unact==VACT_sh_D)) bID =4;//D else if((unact==VACT_EDIT_F)||(unact==VACT_sh_F)) bID =6;//F else if((unact==VACT_EDIT_G)||(unact==VACT_sh_G)) bID =7;//G else if((unact==VACT_EDIT_H)||(unact==VACT_sh_H)) bID =8;//H else if((unact==VACT_EDIT_J)||(unact==VACT_sh_J)) bID =10;//J else if((unact==VACT_EDIT_K)||(unact==VACT_sh_K)) bID =11;//K else if((unact==VACT_EDIT_L)||(unact==VACT_sh_L)) bID =12;//L else if((unact==VACT_EDIT_Z)||(unact==VACT_sh_Z)) bID =26;//Z else if((unact==VACT_EDIT_X)||(unact==VACT_sh_X)) bID =24;//X else if((unact==VACT_EDIT_C)||(unact==VACT_sh_C)) bID =3;//C else if((unact==VACT_EDIT_V)||(unact==VACT_sh_V)) bID =22;//V else if((unact==VACT_EDIT_B)||(unact==VACT_sh_B)) bID =2;//B else if((unact==VACT_EDIT_N)||(unact==VACT_sh_N)) bID =14;//N else if((unact==VACT_EDIT_M)||(unact==VACT_sh_M)) bID =13;//M else if(unact==VACT_EDIT_SPACE) bID =49;//M else if(unact==VACT_EDIT_WWW) bID =37;//M else if(unact==VACT_EDIT_COMMA) bID =38;// else if(unact==VACT_sh_COM) bID =50;// if(((unact >= VACT_EDIT_A && unact<VACT_EDIT_COMMA)||( unact >VACT_EDIT_COMMA &&unact<= VACT_EDIT_WWW))&&(cur_display_mode2==0)) find_set_chars(1); else if((unact >= VACT_sh_A && unact<= VACT_sh_M)&&(cur_display_mode2==1)) find_set_chars(1); else if((unact == VACT_EDIT_COMMA)&&(cur_display_mode2==1)) find_set_chars(1); } OSD_TrackObject((POBJECT_HEAD)&g_win_wifi_password, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); #ifdef OSD_12 draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L-10, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 280+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #else draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 240+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #endif if((unact==VACT_alt_C)||(unact==VACT_alt_M))//键盘里没有此字符 {} else OSD_ChangeFocus( pObj,bID,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); ap_send_msg(CTRL_MSG_SUBTYPE_KEY_UI, V_KEY_ENTER, TRUE); ret = PROC_LOOP; } else if(unact >= VACT_NUM_0 && unact<= VACT_NUM_9) { for(pos0=0;pos0<KEY_CNT;pos0++) { if(wifi_password_key_chars[pos0] == '0') { break; } } bID = pos0+1 + unact - VACT_NUM_0; OSD_ChangeFocus( pObj,bID,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); ap_send_msg(CTRL_MSG_SUBTYPE_KEY_UI, V_KEY_ENTER, TRUE); ret = PROC_LOOP; } #else else if(unact >= VACT_NUM_0 && unact<= VACT_NUM_9) { for(pos0=0;pos0<KEY_CNT;pos0++) { if(wifi_password_key_chars[pos0] == '0') { break; } } bID = pos0+1 + unact - VACT_NUM_0; OSD_ChangeFocus( pObj,bID,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS); ap_send_msg(CTRL_MSG_SUBTYPE_KEY_UI, V_KEY_ENTER, TRUE); ret = PROC_LOOP; } #endif } return ret; }
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; 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); #ifdef KB_SUPPORT_SPECAIL_CHAR find_set_chars(0,FALSE); #endif find_init_keys(); find_set_key_display(); wincom_backup_region(&win->head.frame); 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); } wincom_restore_region(); if(check_ok) { *ret_name = (UINT8*)input_name_str; } else { *ret_name = NULL; } set_keyboard_flag(FALSE); ap_enable_key_task_get_key(old_value); return (check_ok); }
static PRESULT wifi_password_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; VACTION unact; UINT8 i,bID; UINT32 str_len; // char ch,str_temp[2]; char ch; TEXT_FIELD *txt; EDIT_FIELD *edf; bID = OSD_GetObjID(pObj); switch(event) { case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); ret = PROC_LOOP; wifi_password_str_len = ComUniStrLen(wifi_password_str); if(unact == VACT_DEL || (unact == VACT_ENTER && wifi_password_key_chars[bID - 1] == 0x7F) ) /* DEL */ { if(wifi_password_str_len>0) { wifi_password_str_len--; wifi_password_str[wifi_password_str_len] = 0; 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]); OSD_DrawObject((POBJECT_HEAD)&wifi_password_input, C_UPDATE_ALL); } } else if(unact == VACT_OK || (unact == VACT_ENTER && wifi_password_key_chars[bID - 1] == 0xFF) ) /* OK */ { wifi_password_check_ok = TRUE; ret = PROC_LEAVE; if(name_valid_func != NULL) { if(name_valid_func(wifi_password_str) == 0) { ret = PROC_LEAVE; } else { ret = PROC_LOOP; } } } else if(unact == VACT_ENTER) { ch = wifi_password_key_chars[bID - 1]; if(wifi_password_str_len < MAX_INPUT_STR_LEN) { SetUniStrCharAt(wifi_password_str,ch,wifi_password_str_len); wifi_password_str_len++; wifi_password_str[wifi_password_str_len] = 0; 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]); OSD_DrawObject((POBJECT_HEAD)&wifi_password_input, C_UPDATE_ALL); } } else if(unact == VACT_CAPS) { #if 0 str_temp[1] = '\0'; for(i = 0;i < CHRACTER_CNT;i++) { if((wifi_password_key_chars[i] >= 'a') && (wifi_password_key_chars[i] <= 'z')) { wifi_password_key_chars[i] = wifi_password_key_chars[i] - ('a' - 'A'); } else if((wifi_password_key_chars[i] >= 'A') && (wifi_password_key_chars[i] <= 'Z')) { wifi_password_key_chars[i] = wifi_password_key_chars[i] + ('a' - 'A'); } str_temp[0] = wifi_password_key_chars[i]; OSD_SetTextFieldContent(&wifi_password_txt_chars[i], STRING_ANSI,(UINT32)str_temp); } #endif find_set_chars(1); OSD_TrackObject((POBJECT_HEAD)&g_win_wifi_password, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); #ifdef OSD_12 draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L-10, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 280+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #else draw_caps_colbtn_ext(COLBTN_L + 120+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_YEOLLW); draw_del_colbtn_ext(COLBTN_L, COLBTN_T, 1,IM_FIND_KEYBOARD_RED); draw_ok_colbtn_ext(COLBTN_L + 240+KEY_L_GAP, COLBTN_T, 1,IM_FIND_KEYBOARD_BLUE); #endif } break; } return ret; }