Пример #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);
}
Пример #2
0
UINT32 win_tpe_open(UINT32 mode,UINT32 sat_id,UINT32 tp_id)
{

	CONTAINER* win;
	PRESULT ret = PROC_LOOP;
	UINT32 hkey;
	TEXT_FIELD* txt;
	UINT16 strID;

    BOOL old_value = ap_enable_key_task_get_key(TRUE);
 	txt = &tpe_title;
	if(mode == 0)
		strID = RS_INFO_EDIT_TP;
	else
		strID = RS_INFO_ADD_TP;
	OSD_SetTextFieldContent(txt, STRING_ID,(UINT32)strID);

	win = &g_win_tp_edit;
	OSD_SetContainerFocus(win, TP_FREQ_ID);
	win_tpe_set_mode(mode,sat_id,tp_id);

	OSD_ObjOpen((POBJECT_HEAD)win, 0);
	 
	while(ret != PROC_LEAVE)
	{
	    hkey = ap_get_popup_msg(C_POPUP_MSG_PASS_CI);
        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);

	return edit_tp_ok;	
}
Пример #3
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;
}
Пример #4
0
UINT32 win_youtube_open()
{

	CONTAINER* win;
	PRESULT ret = PROC_LOOP;
	UINT32 hkey;
	TEXT_FIELD* txt;
	UINT16 strID;

    BOOL old_value = ap_enable_key_task_get_key(TRUE);
 	txt = &youtube_opts_title;
	
	strID = RS_YOUTUBE_OPTION;
	OSD_SetTextFieldContent(txt, STRING_ID,(UINT32)strID);

	win = &win_youtube_opts_con;
	OSD_SetContainerFocus(win, MENU_YT_OPTS);

	OSD_ObjOpen((POBJECT_HEAD)win, 0);
	 
	while(ret != PROC_LEAVE)
	{
	    hkey = ap_get_popup_msg(C_POPUP_MSG_PASS_CI);
        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);

	return youtube_search_ok;	
}
Пример #5
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;
}
Пример #6
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);
}
Пример #7
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);
}
Пример #8
0
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;

}
Пример #9
0
static void search_callback(UINT8 aue_type, UINT32 aue_value)
{
	union as_message msg;
	static UINT32 as_progress=0;
	UINT8 result = PROC_LOOP;
	UINT16 progress;
	UINT32 moving_disk_time;

	DBG_PRINTF("Enter %s....\n",__FUNCTION__);

#ifndef MULTITASK_DRAW_OSD_SUPPORT
	win_search_capture_semaphore();  
#endif

	//OSD_TaskBuffer_Init(osal_task_get_current_id(),NULL);
	if (aue_type == ASM_TYPE_PROGRESS)
	{
		if (as_progress>=aue_value)
		{
			as_progress = aue_value;

#ifndef MULTITASK_DRAW_OSD_SUPPORT
			win_search_release_semaphore();
#endif
			DBG_PRINTF("Exit %s....\n",__FUNCTION__);
			return;
		}
		/*
		 * without the following line will cause
		 * percentage inverse here.
		 */
		as_progress = aue_value;
	}

	msg.decode.asm_type = aue_type;
	msg.decode.asm_value = aue_value;

    switch(msg.decode.asm_type)
    {
        case ASM_TYPE_SATELLITE:
        	osal_task_dispatch_off();
        	if(!win_search_stop_signal)
        	{
        		cur_srch_sat ++;
        		moving_disk = 1;
        		/* !!!!!! */
        		osal_task_dispatch_on();
        		#ifndef MULTITASK_DRAW_OSD_SUPPORT
        		win_search_release_semaphore();
        		#endif
        		ap_clear_all_message();
        		ap_send_msg(CTRL_MSG_SUBTYPE_CMD_SCAN, msg.msg_encode,TRUE);
        		moving_disk_time = 0;
            }
        	else
        	{
        		osal_task_dispatch_on();
        		#ifndef MULTITASK_DRAW_OSD_SUPPORT
        		win_search_release_semaphore();
        		#endif
            }
            while(moving_disk)
            {
        		osal_task_sleep(10);
        		moving_disk_time++ ;
            }
            as_progress = 0;
            break;
        case ASM_TYPE_PROGRESS:
            if(msg.decode.asm_value == 100 || msg.decode.asm_value == 150)
            {
                ap_send_msg(CTRL_MSG_SUBTYPE_CMD_SCAN, msg.msg_encode,TRUE);
            }
            else
            {
                if(win_search_param.as_method != AS_METHOD_MULTI_FFT 
                    && win_search_param.as_method != AS_METHOD_MULTI_NIT  
                    && win_search_param.as_method != AS_METHOD_MULTI_TP)
                    progress = msg.decode.asm_value;
                else
                {
#ifdef NEW_DEMO_FRAME
                progress = (100* (cur_srch_sat- 1)+ msg.decode.asm_value)/win_search_param.as_sat_cnt;
#else
                    progress = (100* (cur_srch_sat- 1)+ msg.decode.asm_value)/win_search_param.as_sat_id;
#endif
                    if(progress>= 100)
                        progress = 99;
                }
                //result = win_search_update_progress(progress);//msg.decode.asm_value);
                msg.decode.asm_value = progress;
		ap_send_msg(CTRL_MSG_SUBTYPE_CMD_SCAN, msg.msg_encode,TRUE);			
            }
            break;
        case ASM_TYPE_ADD_PROGRAM:
            //win_search_program_append(0xFFFFFFFF, msg.decode.asm_value);
            ap_send_msg(CTRL_MSG_SUBTYPE_CMD_SCAN, msg.msg_encode,TRUE);
            break;
        case ASM_TYPE_ADD_TRANSPONDER:
            //win_search_program_append(msg.decode.asm_value, INVALID_ID);
            ap_send_msg(CTRL_MSG_SUBTYPE_CMD_SCAN, msg.msg_encode,TRUE);
            break;
        default:
                ;
    }
#if 0
    //OSD_UpdateWinVscr(&win_search, FALSE);

    if(msg.decode.asm_type ==ASM_TYPE_PROGRESS && result == PROC_LEAVE)
        ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT_TOP, 0,TRUE);


    if(msg.decode.asm_type != ASM_TYPE_SATELLITE)
    {
        OSD_ObjProc( (POBJECT_HEAD)&g_win_search, 0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF);

#ifndef MULTITASK_DRAW_OSD_SUPPORT
        win_search_release_semaphore();
#endif
    }
#endif
	DBG_PRINTF("Exit %s....\n",__FUNCTION__);

}
Пример #10
0
/**************************************************************
 *CAS Main message process entry.
 *msg_code has different meaning for different msg_type, check the 
 *tf_catask.c for detailed info.
 **************************************************************/
PRESULT ap_cas_smc_info_proc( UINT32 msg_type, UINT32 msg_code)
{
	cas_sc_t card_info;
	UINT16 cur_chan = 0;
	UINT8 scramble = 0;
	P_NODE p_node;
	POBJECT_HEAD p_top_menu = NULL,p_newtop_menu=NULL;
	PRESULT ret;

	p_top_menu = menu_stack_get_top();

	if(p_top_menu == (POBJECT_HEAD)&g_win_cti_cardinfo 
		|| p_top_menu == (POBJECT_HEAD)&g_win_cti_set_maturity
		|| p_top_menu == (POBJECT_HEAD)&g_win_cti_PPID 
		|| p_top_menu == (POBJECT_HEAD)&g_win_cti_PPID_info
		|| p_top_menu == (POBJECT_HEAD)&g_win_cti_pin)
	{
		ret = OSD_ObjProc(p_top_menu, (MSG_TYPE_MSG << 16) | msg_type, msg_code, 0);
		while( ret == PROC_LEAVE)
		{
			menu_stack_pop();
			p_newtop_menu = menu_stack_get_top();
			if(NULL != p_newtop_menu)
			{
				ret = OSD_ObjOpen(p_newtop_menu, MENU_OPEN_TYPE_STACK) ;
			}
		}
	}

	
	cas_get_sc_info_req(&card_info);	
	sys_data_get_cur_group_channel(&cur_chan, sys_data_get_cur_chan_mode());
	get_prog_at(cur_chan, &p_node);
	//get_prog_scramble_type(p_node.prog_number, &scramble);
	
	if(card_info.sc_status==0)	//smart card ok
	{
		//win_popup_msg("Smartcart is in!",NULL,0);
	}
	else if(card_info.sc_status==1)	//smart card out	
	{
		if(GetScrollStopFlag()!=SCROLL_STOP)
		{
			SetScrollStopFlag(SCROLL_STOP);
		}		
		cas_sub_clear(); 
		subtitle_clear_all_message(); //clean subtitle msg buffer when the card is out.
		
		ap_cas_fingerprint_proc(3);// to clear finger print buf and area

		
		if( p_top_menu == (POBJECT_HEAD)&g_win_ippv_popup)
		{
			OSD_ClearObject((POBJECT_HEAD)&g_win_ippv_popup, C_UPDATE_ALL);
			menu_stack_pop();
		}

		//win_popup_msg("Smartcart is out!",NULL,0);
	}
	else if(card_info.sc_status==2||card_info.sc_status==3)
	{
		//win_popup_msg(NULL,NULL,RS_CTI_READ_SMC_ERROR);
	}


}
Пример #11
0
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;	
}
Пример #12
0
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;	
}
Пример #13
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;
}
Пример #14
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);
}