Esempio n. 1
0
static PRESULT otaupg_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT8 back_saved;
	INT32 btn_state;
	win_popup_choice_t choice;
	lpVSCR apvscr;

	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			/* 0 - stop , 1 - exit , 2 - download 3 - burnflash 4 - reboot*/
			btn_state = win_otaup_get_btn_state();
			apvscr = OSD_GetTaskVscr(osal_task_get_current_id());
			switch(btn_state)
			{
			case 0:
				if(!ota_user_stop)
				{
					ota_stop_service();
					ota_user_stop = 1;					
				}
				break;
			case 1:
				ret = PROC_LEAVE;
				break;
			case 2:
				win_otaupg_download();
				win_otaup_set_btn_msg_display(TRUE);
				OSD_UpdateVscr(apvscr);
				break;
			case 3:
			#ifndef _BUILD_OTA_E_				
				win_compopup_init(WIN_POPUP_TYPE_OKNO);
				win_compopup_set_msg(NULL, NULL, RS_ARE_YOU_SURE_TO_BURN_THE_FLASH);
				win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
				choice = win_compopup_open_ext(&back_saved);
				//win_compopup_smsg_restoreback();
				if(choice == WIN_POP_CHOICE_YES)
			#endif
				{
					win_otaupg_burnflash();
					win_otaup_set_btn_msg_display(TRUE);
					OSD_UpdateVscr(apvscr);
				}
				break;
			case 4:
				win_otaupg_reboot();
				break;
			}
		}
		break;
	}

	return ret;
}
Esempio n. 2
0
UINT32 gelib_win_fadeout(UINT32 galpha,UINT32 param)
{
	UINT16 i,gvalue,ugap,uflg,udelay;
	PGUI_VSCR pVscr;
	PGUI_EFFCT_CFG pcfg;
	
	pcfg = (PGUI_EFFCT_CFG)(&param);
	uflg = pcfg->type;
	ugap = MAX(2,pcfg->param2);
	udelay = MAX(2,pcfg->delay);

	if(uflg)//fade in
		gvalue = galpha;
	else
		gvalue = 0;
	pVscr = OSD_GetTaskVscr(osal_task_get_current_id());
	gelib_setgalpha(pVscr->dst_layer,gvalue);
	
	OSD_SetVscrModified(pVscr);
	OSD_UpdateVscr(pVscr);
    
	for(i=0;i<=galpha;i += ugap)
	{
		gelib_setgalpha(pVscr->dst_layer,gvalue);
		if(uflg)
			gvalue = (gvalue>ugap)?(gvalue-ugap):0;
		else
			gvalue = ((gvalue+ugap)>0xff)?0xff:(gvalue+ugap);

		GELIB_EFFECT_DELAY(udelay);
	}
	gelib_setgalpha(pVscr->dst_layer,(UINT8)gvalue);
	
	return 0;
}
Esempio n. 3
0
void win_rs232upg_update(INT32 type, INT32 process, UINT8 *str)
{
	UINT32 vscr_idx;
	lpVSCR apVscr;
	
	vscr_idx = osal_task_get_current_id();
	apVscr = OSD_GetTaskVscr(vscr_idx);
	switch(type)
	{
		case 1:
			win_rs232upg_process_update(process);
			break;
		case 2:
			win_rs232upg_msg_update(str);
			break;
		case 3:
			win_rs232upg_process_update(process);
			win_rs232upg_msg_update(str);
			break;
		default:
			break;
	}

	OSD_UpdateVscr(apVscr);
}
Esempio n. 4
0
void update_status_box(unsigned int value1)
{
	VSCR *lpVscr;
	level = value1;
	OSD_DrawObject((POBJECT_HEAD) &txt_value1, C_UPDATE_ALL | C_DRAW_SIGN_EVN_FLG);
	lpVscr = OSD_GetTaskVscr(osal_task_get_current_id());
	OSD_UpdateVscr(lpVscr);
#ifndef USE_LIB_GE
	lpVscr->lpbScr = NULL;
#endif
}
Esempio n. 5
0
void sudoku_update_status(unsigned int value1)
{
	ID vscr_id;
	lpVSCR apVscr;
	
	level = value1;
	OSD_DrawObject((POBJECT_HEAD)&sudoku_txt_value1, C_UPDATE_ALL | C_DRAW_SIGN_EVN_FLG);
	
	vscr_id = osal_task_get_current_id();
	apVscr = OSD_GetTaskVscr(vscr_id);
	OSD_UpdateVscr(apVscr);
}
Esempio n. 6
0
void drawSquare(UINT16 x, UINT16 y, UINT16 w, UINT16 h, UINT8 bShIdx)
{
	OSD_RECT r;
	VSCR*	lpVscr ;
#if 0//def USE_LIB_GE
	lpVscr= OSD_GetTaskVscr(osal_task_get_current_id());
	OSD_SetRect(&r, x, y, w, h);
	OSD_DrawStyleRect(&r, bShIdx, lpVscr);
	
	OSD_UpdateVscr(lpVscr);
#else
	OSD_SetRect(&r, x, y, w, h);
	OSD_DrawStyleRect(&r, bShIdx, NULL);
#endif
}
Esempio n. 7
0
void update_status(unsigned int value1, unsigned int value2, unsigned int value3)
{
	UINT32 vscr_idx;
	lpVSCR apVscr;
	
	level = value1;
	score1 = value2;
	score2 = value3;
	vscr_idx = osal_task_get_current_id();
	apVscr = OSD_GetTaskVscr(vscr_idx);
	OSD_DrawObject((POBJECT_HEAD)&txt_value1, C_UPDATE_ALL | C_DRAW_SIGN_EVN_FLG);
	OSD_DrawObject((POBJECT_HEAD)&txt_value2, C_UPDATE_ALL | C_DRAW_SIGN_EVN_FLG);
	OSD_DrawObject((POBJECT_HEAD)&txt_value3, C_UPDATE_ALL | C_DRAW_SIGN_EVN_FLG);
	OSD_UpdateVscr(apVscr);
}
Esempio n. 8
0
static void win_otaup_set_btn_msg_display(BOOL update)
{
	MULTI_TEXT* mtxt_msg;
	TEXT_FIELD* txt_btn;
	UINT16 btn_strid;
	TEXT_CONTENT* tcont;
	UINT16 cur_sw_ver = SYS_SW_VERSION&0xffff;
	UINT8 * src;
	UINT8 str_len;
	INT32 btn_state;
    lpVSCR apvscr;
	tcont = otamsg_mtxt_content;
	tcont->bTextType = STRING_ID;

	mtxt_msg = &otaupg_mtxt_msg;
	txt_btn = &otaupg_txt_btn;	

/* 0 - stop , 1 - exit , 2 - download 3 - burnflash 4 - reboot*/
	btn_state = win_otaup_get_btn_state();
	if(btn_state == 0)
		btn_strid = RS_DISEQC12_MOVEMENT_STOP;
	else if(btn_state == 1)
		btn_strid = RS_HELP_EXIT;
	else if(btn_state == 2)
		btn_strid = RS_DISPLAY_DOWNLOADING;
	else if(btn_state == 3)
		btn_strid = RS_OTA_BURNFLASH;
	else if(btn_state == 4)
		btn_strid = RS_MSG_UPGRADE_REBOOT;
	else
		btn_strid = 0;
	

	switch(ota_proc_step)
	{
	case OTA_STEP_GET_INFO:
		
		switch(ota_proc_ret)
		{
		case 0:
			tcont->text.wStringID = RS_OTA_COLLECT_INFORMATION;
			break;
		case PROC_SUCCESS:

			if(ota_dl_info.sw_version <= cur_sw_ver)
			{
				if(ota_dl_info.sw_version < cur_sw_ver)
				{
			 		//ComAscStr2Uni("SW is older than your STB's SW! Do you want to continue?",len_display_str);
					src = OSD_GetUnicodeString(RS_SW_IS_OLDER_CONTINUE);
					ComUniStrCopyChar((UINT8*)len_display_str, src);
				}
				else
				{
					//ComAscStr2Uni("SW is same to your STB's SW! Do you want to continue?",len_display_str);
					src = OSD_GetUnicodeString(RS_SW_IS_SAME_CONTINUE);
					ComUniStrCopyChar((UINT8*)len_display_str, src);
				}
			}
			else
			{
				src = OSD_GetUnicodeString(RS_DISPLAY_NEXT);
				ComUniStrCopyChar((UINT8*)len_display_str, src);
				str_len = ComUniStrLen(len_display_str);
				ComAscStr2Uni(" : ",&len_display_str[str_len]);
				str_len = ComUniStrLen(len_display_str);
				src = OSD_GetUnicodeString(RS_DISPLAY_DOWNLOADING);
				ComUniStrCopyChar((UINT8*)&len_display_str[str_len], src);
			}
			
			tcont->bTextType = STRING_UNICODE;
			tcont->text.pString = len_display_str;
			
			break;
		case PROC_STOPPED:
			//ComAscStr2Uni("User canceled",len_display_str);
			src = OSD_GetUnicodeString(RS_USER_CANCELED);
			ComUniStrCopyChar((UINT8*)len_display_str, src);
			
			tcont->bTextType = STRING_UNICODE;
			tcont->text.pString = len_display_str;			
			break;
		case PROC_FAILURE:
			tcont->text.wStringID = RS_OTA_COLLECT_INFORMATION_FAIL;						
			break;			
		}

		break;
	case OTA_STEP_DOWNLOADING:	
		
		switch(ota_proc_ret)
		{
		case 0:
			tcont->text.wStringID = RS_DISPLAY_DOWNLOADING;
			break;
		case PROC_SUCCESS:		
			src = OSD_GetUnicodeString(RS_DISPLAY_NEXT);
			ComUniStrCopyChar((UINT8*)len_display_str, src);
			str_len = ComUniStrLen(len_display_str);
			ComAscStr2Uni(" : ",&len_display_str[str_len]);
			str_len = ComUniStrLen(len_display_str);
			src = OSD_GetUnicodeString(RS_OTA_BURNFLASH);
			ComUniStrCopyChar((UINT8*)&len_display_str[str_len], src);

			tcont->bTextType = STRING_UNICODE;
			tcont->text.pString = len_display_str;
			
			break;
		case PROC_STOPPED:
			//ComAscStr2Uni("User canceled",len_display_str);
			src = OSD_GetUnicodeString(RS_USER_CANCELED);
			ComUniStrCopyChar((UINT8*)len_display_str, src);
			
			tcont->bTextType = STRING_UNICODE;
			tcont->text.pString = len_display_str;			
			break;
		case PROC_FAILURE:
			tcont->text.wStringID = RS_DISPLAY_DOWNLOAD_NOT_FINISH;
			break;
		}
		break;
		
	case OTA_STEP_BURNFLASH:

		switch(ota_proc_ret)
		{
		case 0:
			tcont->text.wStringID = RS_OTA_BURNFLASH_DO_NOT_POWER_OFF;
			break;
		case PROC_SUCCESS:	
			src = OSD_GetUnicodeString(RS_DISPLAY_NEXT);
			ComUniStrCopyChar((UINT8*)len_display_str, src);
			str_len = ComUniStrLen(len_display_str);
			ComAscStr2Uni(" : ",&len_display_str[str_len]);
			str_len = ComUniStrLen(len_display_str);
			src = OSD_GetUnicodeString(RS_MSG_UPGRADE_REBOOT);
			ComUniStrCopyChar((UINT8*)&len_display_str[str_len], src);

			tcont->bTextType = STRING_UNICODE;
			tcont->text.pString = len_display_str;
			break;
		//case PROC_STOPPED:
		//	break;
		case PROC_FAILURE:
			tcont->text.wStringID = RS_MSG_UPGRADE_BURN_FLASH_FAIL;
			break;
		}
		
		
		break;
	}

	OSD_SetTextFieldContent(txt_btn, STRING_ID, (UINT32)btn_strid);

	if(update)
	{
		OSD_DrawObject((POBJECT_HEAD)mtxt_msg, C_UPDATE_ALL);
        apvscr = OSD_GetTaskVscr(osal_task_get_current_id());
        if(apvscr->lpbScr != NULL)
        {
            apvscr->updatePending = 1;
            OSD_UpdateVscr(apvscr);
        }		
		if(ota_proc_step == OTA_STEP_BURNFLASH && ota_proc_ret==0)
			OSD_DrawObject( (POBJECT_HEAD)txt_btn, C_UPDATE_ALL);
		else
			OSD_TrackObject((POBJECT_HEAD)txt_btn, C_UPDATE_ALL);
        apvscr = OSD_GetTaskVscr(osal_task_get_current_id());
        if(apvscr->lpbScr != NULL)
        {
            apvscr->updatePending = 1;
            OSD_UpdateVscr(apvscr);
        }
	}	
}
Esempio n. 9
0
static PRESULT sys_backup_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	UINT8 bID,back_saved;
	UINT16 block_idx,file_idx,popup_strid;
	INT32 vscr_idx,length,fileread_ret;
	char str_buff[20];
	void *pBuff;
	BOOL burnflash_ret;
	VACTION unact;
	PRESULT ret;
	PMULTISEL pMsel;
	lpVSCR apVscr;
	win_popup_choice_t choice;
	UINT8 tmp[4];
	UINT8 block_name[20];
	UINT8 file_extention[4];
	UINT8 file_name[24];
	UINT32 chunk_offset;
	USB_BACKUP_MODE_TYPE_E usb_backup_mode;
	
	ret = PROC_PASS;	
	bID = OSD_GetObjID(pObj);
	switch(event)
	{
		case EVN_UNKNOWN_ACTION:
			unact = (VACTION)(param1>>16);
			if(unact == VACT_ENTER && bID == START_ID)
			{
//				start_backup =1;
				win_sys_backup_msg_clear();
				win_sys_backup_process_update(0);
				vscr_idx = osal_task_get_current_id();
				apVscr = OSD_GetTaskVscr(vscr_idx);

				popup_strid = RS_SYS_BACKUP_ALERT_NOPLUG;
				
				win_compopup_init(WIN_POPUP_TYPE_SMSG);
				win_compopup_set_msg(NULL,NULL, popup_strid);
				win_compopup_open_ext(&back_saved);
				osal_task_sleep(2000);
				win_compopup_smsg_restoreback();
				
				OSD_SetAttr(&sys_backup_item_con1, C_ATTR_INACTIVE);
				OSD_SetAttr(&sys_backup_item_con2, C_ATTR_INACTIVE);
				OSD_DrawObject( (POBJECT_HEAD)&sys_backup_item_con1, C_UPDATE_ALL);
				OSD_DrawObject( (POBJECT_HEAD)&sys_backup_item_con2, C_UPDATE_ALL);

				pMsel = &sys_backup_sel_upgrade_type;
				usb_backup_mode = OSD_GetMultiselSel(pMsel);
				switch(usb_backup_mode)
				{
					case EM_BACKUP_MODE_TOTAL_FLASH:
						block_idx = 0;
						break;

					case EM_BACKUP_MODE_USER_DATA:
						block_idx = usbupg_get_block_index(USBUPG_USERDB);
						break;

#ifdef EANBLE_BAKUP_CCCAM_NEWCAMD_DATA					
					case EM_BACKUP_MODE_CCCAM_NEWCAMD:
						block_idx = usbupg_get_block_index(USBUPG_CCCAM_NEWCAMD);
						break;
#endif
#ifdef ENABLE_SOFT_CAM_KEY					
					case EM_BACKUP_MODE_SOFTCAM:
						block_idx = usbupg_get_block_index(USBUPG_SOFTCAM);
						break;
#endif
					
					default:
//						start_backup =0;
						ASSERT(0);
						return;
				}

				usbupg_get_blockinfo(block_idx, block_name, &chunk_offset);
				usb_backup_get_file_filter(usb_backup_mode, file_extention, tmp);
				sprintf(file_name, "%s.%s", block_name, file_extention);
				string_to_lower(file_name);
				//libc_printf("[sys_backup_item_callback]block_idx = %d, block_name = %s, file_extention = %s, file_name = %s", block_idx, block_name, file_extention, file_name);

#ifdef EANBLE_BAKUP_CCCAM_NEWCAMD_DATA
				if(EM_BACKUP_MODE_CCCAM_NEWCAMD == usb_backup_mode)
				{
					//save the cccam data and newcamd data(first 16 group data)
					ret = usbupg_dump_flash2(CccamNewcamdBackup,(64*1024),file_name, win_sys_backup_process_update);
				}
				else
#endif
#ifdef ENABLE_SOFT_CAM_KEY
				if(EM_BACKUP_MODE_SOFTCAM == usb_backup_mode)
				{
					//save the softcam data
					ret = usbupg_dump_flash2(softcam_backup, 64*1024,file_name, win_sys_backup_process_update);
				}
				else
#endif
				{
				#if 1//def WANGYANG
					ret = usbupg_dump_flash3(block_idx, file_name, win_sys_backup_process_update,win_progress_bar_draw_bmp);
				#else
					ret = usbupg_dump_flash(block_idx, file_name, win_sys_backup_process_update);
				#endif
				}

				if (ret ==RET_SUCCESS)
				{
					popup_strid = RS_MSG_BACKUP_SUCCESS;
				}
				else
				{
					popup_strid = RS_OTA_UPGRADE_FAIL;
				}

ERROR_HANDLER:
			
				OSD_SetAttr(&sys_backup_item_con1, C_ATTR_ACTIVE);
				OSD_SetAttr(&sys_backup_item_con2, C_ATTR_ACTIVE);
				OSD_DrawObject( (POBJECT_HEAD)&sys_backup_item_con1, C_UPDATE_ALL);
				OSD_TrackObject( (POBJECT_HEAD)&sys_backup_item_con2, C_UPDATE_ALL);
				OSD_UpdateVscr(apVscr);
//				start_backup =0;
				
				if(popup_strid != 0)
				{
					win_sys_backup_msg_update(popup_strid);
					
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, popup_strid);
					win_compopup_open_ext(&back_saved);
					osal_task_sleep(2000);
					win_compopup_smsg_restoreback();
				}

				return ret;
			}
			break;
	}

	return ret;
}
Esempio n. 10
0
static void win_tplist_tuner_frontend(void)
{
	S_NODE s_node;
	T_NODE t_node;
#ifdef NEW_DEMO_FRAME
	struct ft_antenna antenna;
	union ft_xpond	xpond_info;
	struct nim_device *nim = NULL;
#else
	struct cc_antenna_info antenna;
	struct cc_xpond_info	xpond_info;
#endif

	OBJLIST* ol;
	UINT32 tp_idx;
    UINT16 pre_sat_id,cur_sat_id;
	UINT8 back_saved;
    BOOL old_get_key;

    nim_io_control(g_nim_dev, NIM_DRIVER_STOP_CHANSCAN, 0);
    ap_set_key_notify_proc(win_tplist_key_notify_proc);
    old_get_key = ap_enable_key_task_get_key(TRUE);

    win_signal_set_level_quality(0, 0, 0);
    win_signal_update();
	OSD_UpdateVscr(OSD_GetTaskVscr(osal_task_get_current_id()));

	ol = &tplst_olist;

	tp_idx = OSD_GetObjListCurPoint(ol);
	
	get_tuner_sat(TUNER_EITHER, cur_tp_sat_idx,&s_node);
	get_tp_at(s_node.sat_id,tp_idx,&t_node);

#ifdef SUPPORT_TWO_TUNER
#ifdef SUPPORT_SELECT_SAME_SAT
	cur_tuner_idx = s_node.reserve_1; //antset_cur_tuner;//s_node.tuner1_valid? 0 : 1;
#else
	cur_tuner_idx = s_node.tuner1_valid? 0 : 1;
#endif
#endif

#ifndef NEW_DEMO_FRAME
	struct cc_antenna_info antenna;
	struct cc_xpond_info	xpond_info;

	sat2antenna_ext(&s_node, &antenna,cur_tuner_idx);
	xpond_info.frq = t_node.frq;
	xpond_info.sym = t_node.sym;
	xpond_info.pol = t_node.pol;

	set_antenna(&antenna);
	set_xpond(&xpond_info);
#else
	MEMSET(&antenna, 0, sizeof(struct ft_antenna));
	MEMSET(&xpond_info, 0, sizeof(union ft_xpond));
	sat2antenna(&s_node, &antenna);	
	xpond_info.s_info.type = FRONTEND_TYPE_S;
	xpond_info.s_info.frq = t_node.frq;
	xpond_info.s_info.sym = t_node.sym;
	xpond_info.s_info.pol = t_node.pol;
	xpond_info.s_info.tp_id = t_node.tp_id;
#ifdef SUPPORT_SELECT_SAME_SAT
	nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, ((s_node.reserve_1 == 0)? 0 : ((s_node.reserve_1 == 1) ? 1 : 0)));
#else
	nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, (s_node.tuner1_valid ? 0 : (s_node.tuner2_valid ? 1 : 0)));
#endif
	
	frontend_tuning(nim, &antenna, &xpond_info, 1);
	
#endif
    
    if(pre_tp_sat_idx != cur_tp_sat_idx)
    {
		get_tuner_sat(TUNER_EITHER, pre_tp_sat_idx, &s_node);			
		pre_sat_id = s_node.sat_id;

		get_tuner_sat(TUNER_EITHER, cur_tp_sat_idx, &s_node);			
		cur_sat_id = s_node.sat_id;
    
		wincom_dish_move_popup_open(/*pre_sat_id*/0xFFFF,cur_sat_id,cur_tuner_idx,&back_saved);
        pre_tp_sat_idx = cur_tp_sat_idx;
    }

    ap_enable_key_task_get_key(old_get_key);
    ap_set_key_notify_proc(NULL);
    nim_io_control(g_nim_dev, NIM_DRIVER_STOP_CHANSCAN, 0);
}
Esempio n. 11
0
UINT8 bootota_input_proc()
{
	union BOOT_INFO *boot_info;
	struct OSDRect rect;
	lpVSCR 		pVscr;
	UINT8 *pstr;
	UINT8 str[20];
	UINT16 ustr[100];
	UINT16 i;
	UINT16 back_sh,txt_sh,sh;
	UINT32 new_focus_id;
	UINT32 value;
	UINT32 strlen;

	boot_info = get_boot_info();

	input_data[LNBFREQ_ID-1] = 0;
	input_data[DISEQC_ID-1] = 0;
	input_data[K22_ID-1] = 0;
	input_data[FREQUENCEY_ID-1] = boot_info->s_info.ota_frequency;
	input_data[SYMBOL_ID-1] = boot_info->s_info.ota_symbol;
	input_data[PID_ID-1] = boot_info->s_info.ota_pid;
	input_data[POL_ID-1] =0;
	focus_id = LNBFREQ_ID;
	input_status = SELECT_STATUS;
	value = 0;

	// draw input frame
	OSD_SetRect(&rect, INPUT_CON_L, INPUT_CON_T, INPUT_CON_W, INPUT_CON_H);	
	OSDDrv_RegionFill((HANDLE)osd_dev,0,&rect,INPUT_CON_SH);

	for(i=0;i<7;i++)
	{
		pstr = input_strs[i];
		ComAscStr2Uni(pstr, ustr);
		OSD_SetRect(&rect, INPUT_TXTN_L, INPUT_TXTN_T+(INPUT_TXTN_H+INPUT_TXT_GAP)*i, INPUT_TXTN_W, INPUT_TXTN_H);	
		pVscr = OSD_GetVscr(&rect,OSD_GET_BACK);
		OSD_DrawText(&rect,ustr,INPUT_TXT_SH,C_ALIGN_LEFT,0,pVscr);

		if(pVscr->lpbScr != NULL)
			pVscr->updatePending = 1;
		OSD_UpdateVscr(pVscr);
		pVscr->lpbScr = NULL;

		if(focus_id-1 == i)
		{
			back_sh = INPUT_CON_HL;
			txt_sh = INPUT_TXT_HL;
		}
		else
		{
			back_sh = INPUT_CON_SH;
			txt_sh = INPUT_TXT_SH;
		}

		OSD_SetRect(&rect, INPUT_TXTS_L, INPUT_TXTS_T+(INPUT_TXTS_H+INPUT_TXT_GAP)*i, INPUT_TXTS_W, INPUT_TXTS_H);	
		OSDDrv_RegionFill((HANDLE)osd_dev,0,&rect,back_sh);
		pVscr = OSD_GetVscr(&rect,OSD_GET_BACK);
		bootota_get_ustr(i,ustr);
		OSD_DrawText(&rect,ustr,txt_sh,C_ALIGN_CENTER,0,pVscr);
		if((focus_id-1==i) && (i<K22_ID||i==POL_ID-1))
		{
			OSD_SetRect(&rect, INPUT_TXTS_L, INPUT_TXTS_T+(INPUT_TXTS_H+INPUT_TXT_GAP)*i, 26, INPUT_TXTS_H);	
			ComAscStr2Uni("<", ustr);
			OSD_DrawText(&rect,ustr,txt_sh,C_ALIGN_CENTER,0,pVscr);

			OSD_SetRect(&rect, INPUT_TXTS_L+INPUT_TXTS_W-26, INPUT_TXTS_T+(INPUT_TXTS_H+INPUT_TXT_GAP)*i, 26, INPUT_TXTS_H);	
			ComAscStr2Uni(">", ustr);
			OSD_DrawText(&rect,ustr,txt_sh,C_ALIGN_CENTER,0,pVscr);
		}
			
		if(pVscr->lpbScr != NULL)
			pVscr->updatePending = 1;
		OSD_UpdateVscr(pVscr);
		pVscr->lpbScr = NULL;
	}

	// start button
	pstr = input_strs[START_ID-1];
	ComAscStr2Uni(pstr, ustr);
	OSD_SetRect(&rect, INPUT_TXTSTART_L, INPUT_TXTSTART_T, INPUT_TXTSTART_W, INPUT_TXTSTART_H);	
	OSDDrv_RegionFill((HANDLE)osd_dev,0,&rect,INPUT_START_SH);
	pVscr = OSD_GetVscr(&rect,OSD_GET_BACK);
	OSD_DrawText(&rect,ustr,INPUT_TXT_HL,C_ALIGN_CENTER,0,pVscr);

	if(pVscr->lpbScr != NULL)
		pVscr->updatePending = 1;
	OSD_UpdateVscr(pVscr);
	pVscr->lpbScr = NULL;
	
		// cancel button
	pstr = input_strs[CANCEL_ID-1];
	ComAscStr2Uni(pstr, ustr);
	OSD_SetRect(&rect, INPUT_TXTCANCEL_L, INPUT_TXTCANCEL_T, INPUT_TXTSTART_W, INPUT_TXTSTART_H);	
	OSDDrv_RegionFill((HANDLE)osd_dev,0,&rect,INPUT_START_SH);
	pVscr = OSD_GetVscr(&rect,OSD_GET_BACK);
	OSD_DrawText(&rect,ustr,INPUT_TXT_HL,C_ALIGN_CENTER,0,pVscr);
	//

	if(pVscr->lpbScr != NULL)
		pVscr->updatePending = 1;
	OSD_UpdateVscr(pVscr);
	pVscr->lpbScr = NULL;

	UINT32 hkey;
	UINT32 vkey;
	UINT8 tmpdata;
	while(1)
	{
		hkey = boot_get_key_msg();
		if(hkey == INVALID_HK || hkey == INVALID_MSG)
			continue;

		ap_hk_to_vk(0,hkey, &vkey);

		if(vkey == V_KEY_ENTER)
		{
			if(focus_id != START_ID&&focus_id!=CANCEL_ID)
				continue;
			if(focus_id==CANCEL_ID)
			{
				return 1;
			}
			boot_info->s_info.ota_frequency = input_data[FREQUENCEY_ID-1];
			boot_info->s_info.ota_symbol = input_data[SYMBOL_ID-1];
			boot_info->s_info.ota_pid = input_data[PID_ID-1];

			if(input_data[LNBFREQ_ID-1]==0)
			{
				boot_info->s_info.antenna_info.lnb_type = LNB_CTRL_STD;
				boot_info->s_info.antenna_info.lnb_low = 5150;
				boot_info->s_info.antenna_info.lnb_high = 5150;
			}
			else if(input_data[LNBFREQ_ID-1]==1)
			{
				boot_info->s_info.antenna_info.lnb_type = LNB_CTRL_STD;
				boot_info->s_info.antenna_info.lnb_low = 11300;
				boot_info->s_info.antenna_info.lnb_high = 11300;
			}
			else if(input_data[LNBFREQ_ID-1]==2)
			{
				boot_info->s_info.antenna_info.lnb_type = LNB_CTRL_POL;
				boot_info->s_info.antenna_info.lnb_low = 5150;
				boot_info->s_info.antenna_info.lnb_high = 5750;
			}
			else if(input_data[LNBFREQ_ID-1]==3)
			{
				boot_info->s_info.antenna_info.lnb_type = LNB_CTRL_22K;
				boot_info->s_info.antenna_info.lnb_low = 9750;
				boot_info->s_info.antenna_info.lnb_high = 10600;
			}

			if(input_data[DISEQC_ID-1] == 0)
			{
				boot_info->s_info.antenna_info.DiSEqC11_type = 0;
			}
			else
			{
				boot_info->s_info.antenna_info.DiSEqC11_type = 2;
				boot_info->s_info.antenna_info.DiSEqC11_port = input_data[DISEQC_ID-1]-1;
			}

			boot_info->s_info.antenna_info.k22 = input_data[K22_ID-1]; 
			boot_info->s_info.antenna_info.pol = input_data[POL_ID-1]; 
			OSD_SetRect(&rect, INPUT_CON_L, INPUT_CON_T, INPUT_CON_W, INPUT_CON_H);	
			OSDDrv_RegionFill((HANDLE)osd_dev,0,&rect,OSD_TRANSPARENT_COLOR);

			return 0;
		}
		else if(vkey == V_KEY_UP || vkey == V_KEY_DOWN)
		{
			if(input_status == EDIT_STATUS)
			{
				input_status = SELECT_STATUS;
				if(value>=input_range[focus_id-1].min && value<=input_range[focus_id-1].max)
					input_data[focus_id-1] = value;
			}

FOCUS_CHANGE:
			if(vkey == V_KEY_UP)
				new_focus_id = id_navi[focus_id-1].upID;
			else if(vkey == V_KEY_DOWN)
				new_focus_id = id_navi[focus_id-1].downID;
			else if(vkey == V_KEY_LEFT)
				new_focus_id = id_navi[focus_id-1].leftID;
			else
				new_focus_id = id_navi[focus_id-1].rightID;

			if(new_focus_id == 0)
				continue;
				
			if(focus_id == START_ID)
			{
				ComAscStr2Uni(input_strs[START_ID-1], ustr);
				OSD_SetRect(&rect, INPUT_TXTSTART_L, INPUT_TXTSTART_T, INPUT_TXTSTART_W, INPUT_TXTSTART_H);	
				back_sh = INPUT_START_SH;
				txt_sh = INPUT_TXT_HL;
			}
			else if(focus_id == CANCEL_ID)
			{
				ComAscStr2Uni(input_strs[CANCEL_ID-1], ustr);
				OSD_SetRect(&rect, INPUT_TXTCANCEL_L, INPUT_TXTCANCEL_T, INPUT_TXTSTART_W, INPUT_TXTSTART_H);	
				back_sh = INPUT_START_SH;
				txt_sh = INPUT_TXT_HL;
			}
			else
			{
				
				bootota_get_ustr(focus_id-1, ustr);
				OSD_SetRect(&rect, INPUT_TXTS_L, INPUT_TXTS_T+(INPUT_TXTS_H+INPUT_TXT_GAP)*(focus_id-1), INPUT_TXTS_W, INPUT_TXTS_H);	
				back_sh = INPUT_CON_SH;
				txt_sh = INPUT_TXT_SH;
			}
			OSDDrv_RegionFill((HANDLE)osd_dev,0,&rect,back_sh);
			pVscr = OSD_GetVscr(&rect,OSD_GET_BACK);
			OSD_DrawText(&rect,ustr,txt_sh,C_ALIGN_CENTER,0,pVscr);

			if(pVscr->lpbScr != NULL)
			pVscr->updatePending = 1;
			OSD_UpdateVscr(pVscr);
			pVscr->lpbScr = NULL;

			if(new_focus_id == START_ID)
			{
				ComAscStr2Uni(input_strs[START_ID-1], ustr);
				OSD_SetRect(&rect, INPUT_TXTSTART_L, INPUT_TXTSTART_T, INPUT_TXTSTART_W, INPUT_TXTSTART_H);	
				back_sh = INPUT_START_HL;
				txt_sh = INPUT_TXT_HL;
			}
			else  if(new_focus_id == CANCEL_ID)
			{
				ComAscStr2Uni(input_strs[CANCEL_ID-1], ustr);
				OSD_SetRect(&rect, INPUT_TXTCANCEL_L, INPUT_TXTCANCEL_T, INPUT_TXTSTART_W, INPUT_TXTSTART_H);	
				back_sh = INPUT_START_HL;
				txt_sh = INPUT_TXT_HL;
			}
			else
			{
				bootota_get_ustr(new_focus_id-1, ustr);
				OSD_SetRect(&rect, INPUT_TXTS_L, INPUT_TXTS_T+(INPUT_TXTS_H+INPUT_TXT_GAP)*(new_focus_id-1), INPUT_TXTS_W, INPUT_TXTS_H);	
				back_sh = INPUT_CON_HL;
				txt_sh = INPUT_TXT_HL;
			}
			OSDDrv_RegionFill((HANDLE)osd_dev,0,&rect,back_sh);
			pVscr = OSD_GetVscr(&rect,OSD_GET_BACK);
			OSD_DrawText(&rect,ustr,txt_sh,C_ALIGN_CENTER,0,pVscr);

			if(new_focus_id-1<K22_ID||new_focus_id==POL_ID)
			{
				OSD_SetRect(&rect, INPUT_TXTS_L, INPUT_TXTS_T+(INPUT_TXTS_H+INPUT_TXT_GAP)*(new_focus_id-1), 26, INPUT_TXTS_H);	
				ComAscStr2Uni("<", ustr);
				OSD_DrawText(&rect,ustr,txt_sh,C_ALIGN_CENTER,0,pVscr);

				OSD_SetRect(&rect, INPUT_TXTS_L+INPUT_TXTS_W-26, INPUT_TXTS_T+(INPUT_TXTS_H+INPUT_TXT_GAP)*(new_focus_id-1), 26, INPUT_TXTS_H);	
				ComAscStr2Uni(">", ustr);
				OSD_DrawText(&rect,ustr,txt_sh,C_ALIGN_CENTER,0,pVscr);
			}

			focus_id = new_focus_id;
		}
		else if(vkey>=V_KEY_0 && vkey<=V_KEY_9)
		{
			if(focus_id<FREQUENCEY_ID || focus_id>PID_ID)
				continue;
			
			if(input_status == SELECT_STATUS)
			{
				value = 0;
				input_status = EDIT_STATUS;
			}

			value = value*10 + vkey - V_KEY_0;
			
			sprintf(str,"%d",value);
			strlen = STRLEN(str);

			if(strlen >= input_range[focus_id-1].len)
			{
				input_status = SELECT_STATUS;
				if(value>=input_range[focus_id-1].min && value<=input_range[focus_id-1].max)
					input_data[focus_id-1] = value;
			}
			else
			{
				sprintf(str,"%d_",value);
			}
			ComAscStr2Uni(str, ustr);
			OSD_SetRect(&rect, INPUT_TXTS_L, INPUT_TXTS_T+(INPUT_TXTS_H+INPUT_TXT_GAP)*(focus_id-1), INPUT_TXTS_W, INPUT_TXTS_H);	
			OSDDrv_RegionFill((HANDLE)osd_dev,0,&rect,INPUT_CON_HL);
			pVscr = OSD_GetVscr(&rect,OSD_GET_BACK);
			OSD_DrawText(&rect,ustr,INPUT_TXT_HL,C_ALIGN_CENTER,0,pVscr);
		}
		else if(vkey == V_KEY_LEFT || vkey == V_KEY_RIGHT)
		{
			if(focus_id == START_ID || focus_id ==CANCEL_ID)
				goto FOCUS_CHANGE;
			
			if(focus_id==FREQUENCEY_ID || focus_id==PID_ID || focus_id==SYMBOL_ID)
			{
				if(vkey == V_KEY_RIGHT || input_status == SELECT_STATUS)
					continue;

				value = value/10;
				sprintf(str,"%d_",value);
				ComAscStr2Uni(str, ustr);
				OSD_SetRect(&rect, INPUT_TXTS_L, INPUT_TXTS_T+(INPUT_TXTS_H+INPUT_TXT_GAP)*(focus_id-1), INPUT_TXTS_W, INPUT_TXTS_H);	
				OSDDrv_RegionFill((HANDLE)osd_dev,0,&rect,INPUT_CON_HL);
				pVscr = OSD_GetVscr(&rect,OSD_GET_BACK);
				OSD_DrawText(&rect,ustr,INPUT_TXT_HL,C_ALIGN_CENTER,0,pVscr);

				if(pVscr->lpbScr != NULL)
				pVscr->updatePending = 1;
				OSD_UpdateVscr(pVscr);
				pVscr->lpbScr = NULL;
			}
			else if(focus_id==LNBFREQ_ID || focus_id==DISEQC_ID || focus_id==K22_ID||focus_id==POL_ID)
			{
				if(vkey == V_KEY_LEFT)
					value = -1;
				else
					value = 1;

				input_data[focus_id-1] = (input_data[focus_id-1]+value+input_range[focus_id-1].len)%input_range[focus_id-1].len;
				bootota_get_ustr(focus_id-1, ustr);
				OSD_SetRect(&rect, INPUT_TXTS_L, INPUT_TXTS_T+(INPUT_TXTS_H+INPUT_TXT_GAP)*(focus_id-1), INPUT_TXTS_W, INPUT_TXTS_H);	
				back_sh = INPUT_CON_HL;
				txt_sh = INPUT_TXT_HL;
				OSDDrv_RegionFill((HANDLE)osd_dev,0,&rect,back_sh);
				pVscr = OSD_GetVscr(&rect,OSD_GET_BACK);
				OSD_DrawText(&rect,ustr,txt_sh,C_ALIGN_CENTER,0,pVscr);

				OSD_SetRect(&rect, INPUT_TXTS_L, INPUT_TXTS_T+(INPUT_TXTS_H+INPUT_TXT_GAP)*(focus_id-1), 26, INPUT_TXTS_H);	
				ComAscStr2Uni("<", ustr);
				OSD_DrawText(&rect,ustr,txt_sh,C_ALIGN_CENTER,0,pVscr);

				OSD_SetRect(&rect, INPUT_TXTS_L+INPUT_TXTS_W-26, INPUT_TXTS_T+(INPUT_TXTS_H+INPUT_TXT_GAP)*(focus_id-1), 26, INPUT_TXTS_H);	
				ComAscStr2Uni(">", ustr);
				OSD_DrawText(&rect,ustr,txt_sh,C_ALIGN_CENTER,0,pVscr);
			}
		}
		if(pVscr->lpbScr != NULL)
			pVscr->updatePending = 1;
		OSD_UpdateVscr(pVscr);
		pVscr->lpbScr = NULL;
	}
	return 0;
}
Esempio n. 12
0
UINT32 gelib_olst_focuslide(POBJECT_HEAD psobj,POBJECT_HEAD ptobj,UINT32 param)
{//start and terminal point
	UINT16 i,yy,pyy,tyy,byy,hy,urevert,uborder;
	GUI_RECT rcvscr,rctop,rctborder,*psrct,*ptrct;
	PGUI_VSCR pvscr;
	PGUI_REGION pgma,pmem;

	psrct = &psobj->frame;
	ptrct = &ptobj->frame;
	if(gui_rctsize(psrct,ptrct) == 0)
		return (UINT32)(-1);//do not support focus slide
	else if(ge_version <= GE_MODULE_M3329D)
		return (UINT32)(-2);

	urevert = 0;
	uborder = 0;
	if((psrct->uStartX) != (ptrct->uStartX))
		return (UINT32)(-3);//do not support horizontal focus slide
	else if(ABS((psobj->bID) - (ptobj->bID))>1)
		return (UINT32)(-4);//uborder = 1;//return (UINT32)(-4);
	else if((psrct->uStartY)>(ptrct->uStartY))
		urevert = 1;
	
	hy = (ptrct->uHeight);
	tyy = MIN((psrct->uStartY),(ptrct->uStartY));
	byy = MAX((psrct->uStartY),(ptrct->uStartY))+(ptrct->uHeight);
	rcvscr.uStartX = (ptrct->uStartX);
	rcvscr.uStartY = tyy;
	rcvscr.uWidth = (ptrct->uWidth);
	rcvscr.uHeight = (byy - tyy);
	rctop.uHeight = hy;
	rctop.uStartX = (ptrct->uStartX);
	rctop.uWidth = (ptrct->uWidth);

	pvscr = OSD_GetTaskVscr(osal_task_get_current_id());
	OSD_SetVscrModified(pvscr);
	OSD_UpdateVscr(pvscr);	
	OSD_SetVscrSuspend(pvscr);
	
	pmem = gelib_getdstrgn(pvscr->root_layer,pvscr->root_rgn);
	pgma = gelib_getdstrgn(pvscr->dst_layer,pvscr->dst_rgn);

	if(uborder == 1)
	{
		if((psrct->uStartY)<(ptrct->uStartY))
			urevert = 1;
		else
			urevert = 0;
		
		rctop.uStartY = (psrct->uStartX);
		rctop.uStartY = (psrct->uStartY);
		rctop.uWidth = (psrct->uWidth);
		rctop.uHeight = (psrct->uHeight);
		rctborder.uStartX = (ptrct->uStartX);
		rctborder.uStartY = (ptrct->uStartY);
		rctborder.uWidth = (ptrct->uWidth);
		rctborder.uHeight = (ptrct->uHeight);
		for(i = 0;i < (rctop.uHeight); i += 2)
		{
			if(urevert)
			{
				rctop.uHeight -= 2;
				rctborder.uStartY = (ptrct->uStartY + ptrct->uHeight -i);
			}
			else
			{
				rctop.uStartY += 2;
				rctop.uHeight -= 2;
			}
			
			rctborder.uHeight = i;
			OSD_DrawStyleRect(&rctop,psobj->style.bHLIdx,pvscr);
			OSD_DrawStyleRect(&rctborder,ptobj->style.bHLIdx,pvscr);
			
			OSD_DrawObject(psobj,C_UPDATE_CONTENT);
			OSD_DrawObject(ptobj,C_UPDATE_CONTENT);
			gelib_flush_rgn(pgma,pmem,&rcvscr,&rcvscr,0);
			
			OSD_DrawStyleRect(&rctop,psobj->style.bShowIdx,pvscr);
			OSD_DrawStyleRect(&rctborder,ptobj->style.bShowIdx,pvscr);
			GELIB_EFFECT_DELAY(0);
		}
	}
	else
	{
		for(i = tyy;i < (byy-hy); i += 2)
		{
			if(urevert)
				rctop.uStartY = (byy-hy-i + tyy);
			else
				rctop.uStartY = i;
			OSD_DrawStyleRect(&rctop,psobj->style.bHLIdx,pvscr);
			
			OSD_DrawObject(psobj,C_UPDATE_CONTENT);
			OSD_DrawObject(ptobj,C_UPDATE_CONTENT);
			gelib_flush_rgn(pgma,pmem,&rcvscr,&rcvscr,0);
			
			OSD_DrawStyleRect(&rctop,psobj->style.bShowIdx,pvscr);
			GELIB_EFFECT_DELAY(0);
		}
	}
	
	pvscr = OSD_GetVscr(&rcvscr,VSCR_NULL); 
	OSD_DrawObject(psobj,C_UPDATE_ALL);
	OSD_TrackObject(ptobj,C_UPDATE_ALL);
	OSD_ClearVscrSuspend(pvscr);
	OSD_SetVscrModified(pvscr);
	OSD_UpdateVscr(pvscr);
	
	return 0;
}