Exemplo n.º 1
0
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);
}
Exemplo n.º 2
0
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;
}
Exemplo n.º 3
0
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;
}
Exemplo n.º 4
0
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);
}
Exemplo n.º 5
0
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);
}
Exemplo n.º 6
0
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;
}
Exemplo n.º 7
0
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;
}
Exemplo n.º 8
0
static PRESULT find_chanlist_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:
		#ifdef ORDER_GZ1011001
			{
			struct OSDRect rW;
			OSD_SetRect(&rW,W_PROG_L,W_PROG_T, W_PROG_W,W_PROG_H);
			wincom_backup_region1(&rW);
			}
		#endif

		#ifdef ORDER_GZ1011001
		{
			CONTAINER	*win;
			win = &g_win_find_chanlist;
			wincom_backup_region(&win->head.frame);
		}
		#endif
        	set_color_style();
        	api_inc_wnd_count();
		if(!edit_keyboard_flag)//when flag is TRUE,it is for edit use
		{
			name_valid_func = NULL;
			MEMSET(input_name_str_find,0,sizeof(input_name_str_find));
			win_find_chanlist_prog_num = 0;
            		win_keyboard_set_title_find(RS_HELP_FIND);
		}
		
		find_chanlist_init_keys();
		find_chanlist_set_key_display();
		break;
	case EVN_POST_OPEN:	
        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_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;
	case EVN_PRE_CLOSE:
		/* Make OSD not flickering */
        if(!api_is_sd_color_mode())
        {
		    *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;
        }
        if(!edit_keyboard_flag)
		{
			if(win_find_chanlist_prog_num > 0)
			{
				OSD_ClearObject((POBJECT_HEAD)&g_win_find_chanlist, C_UPDATE_ALL);
				#ifdef ORDER_GZ1011001
					wincom_restore_region();
				#endif
				menu_stack_pop();
				menu_stack_push((POBJECT_HEAD)&g_win_com_lst);
				ret = PROC_LOOP;
			}
		}
		break;
	case EVN_POST_CLOSE:
        	api_dec_wnd_count();
		#ifdef ORDER_GZ1011001
			wincom_restore_region();
		#endif
		break;			
	case EVN_UNKNOWN_ACTION:     
		unact = (VACTION)(param1>>16);
		if(unact == VACT_CANCEL)
		{
			if((win_find_chanlist_prog_num > 0) && (!edit_keyboard_flag))
			{
				OSD_ClearObject((POBJECT_HEAD)&g_win_com_lst, C_UPDATE_ALL);
				#ifdef ORDER_GZ1011001
					wincom_restore_region1();
				#endif
			        win_find_chanlist_prog_num = 0;
			}
			check_ok = FALSE;
			ret = PROC_LEAVE;
		}
		else if(unact >= VACT_NUM_0 && unact<= VACT_NUM_9)
		{
		    for(pos0=0;pos0<KEY_CNT;pos0++)
		    {
		        if(key_chars_find[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;
		}
	}
	return ret;
}
Exemplo n.º 9
0
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;
}
Exemplo n.º 10
0
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);
}
Exemplo n.º 11
0
/*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;
}