Ejemplo n.º 1
0
UINT32 osdwnd_hidewnd(PGUI_WINDOW pwnd,UINT32 param)
{//clear wnd
	UINT32 i;
	PGUI_VSCR	pvscr;
	PGUI_REGION 	prgn;
	PGUI_OBJWND wndobj;
	//TODO:windows clear code
	
	if(gelib_get_wndmonitor()&&g_wndrects_cnt)
	{
		wndobj = (PGUI_OBJWND)param;
		for(i = 0;i < g_wndrects_idx;i++)
		{
			if(MEMCMP(&(wndobj->frame),&(g_wnd_rects[i]),sizeof(GUI_RECT)) == 0)
			{
				MEMSET(&(g_wnd_rects[i]),0x0,sizeof(GUI_RECT));

				if(g_wndrects_cnt > 0)
					g_wndrects_cnt--;
			}
		}

		if(gelib_wndrects_showoff() && g_osdwnd_onoff)
		{
			pvscr = OSD_GetTaskVscr(osal_task_get_current_id());
			prgn = gelib_getdstrgn(pvscr->dst_layer,pvscr->dst_rgn);
			ge_show_onoff((struct ge_device *)gui_dev,(ge_surface_desc_t *)prgn->hsurf,0);
			if(gelib_getdual_support())
			{
				prgn = gelib_getdstrgn(GUI_SLVGMA_SURF,0);
				ge_show_onoff_deo((struct ge_device *)gui_dev,(ge_surface_desc_t *)prgn->hsurf,0);
			}			
			
			g_osdwnd_onoff = 0;
		}
	}
	else if((g_wndrects_cnt == 0)&&(g_wnd_monitors == 1))
	{
		if(gelib_wndrects_showoff() && g_osdwnd_onoff)
		{
			pvscr = OSD_GetTaskVscr(osal_task_get_current_id());
			prgn = gelib_getdstrgn(pvscr->dst_layer,pvscr->dst_rgn);
			ge_show_onoff((struct ge_device *)gui_dev,(ge_surface_desc_t *)prgn->hsurf,0);
			
			g_osdwnd_onoff = 0;
		}
	}
	
	return 0;
}
Ejemplo 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;
}
Ejemplo 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);
}
Ejemplo n.º 4
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;
}
Ejemplo n.º 5
0
/*##########################################################################*/
UINT32 gelib_win_slideshow(PGUI_RECT rctslide,UINT32 param)
{
	UINT16 i,ugap,ysld,uflg,udelay;
	GUI_RECT rctgma,rctmem;
	PGUI_VSCR pVscr;
	PGUI_REGION pgma,prgn;
	PGUI_EFFCT_CFG pcfg;
	
	pcfg = (PGUI_EFFCT_CFG)(&param);	
	uflg = pcfg->type;
	ugap = MAX(2,pcfg->param2);
	udelay = MIN(4,pcfg->delay);
	
	pVscr = OSD_GetTaskVscr(osal_task_get_current_id());
	prgn = gelib_getdstrgn(pVscr->root_layer,pVscr->root_rgn);
	pgma = gelib_getdstrgn(pVscr->dst_layer,pVscr->dst_rgn);

	ysld = (rctslide->uStartY+rctslide->uHeight);
	MEMCPY(&rctgma,rctslide,sizeof(GUI_RECT));
	MEMCPY(&rctmem,rctslide,sizeof(GUI_RECT));
	for(i=ugap;i<=(rctslide->uHeight);i+=ugap)
	{
		if(uflg)//slide clear
		{
			rctgma.uHeight = i;
			rctgma.uStartY = rctslide->uStartY;
			gelib_fillrect(pgma,&rctgma,(transcolor_const[pgma->color_mode]));
			
			rctmem.uHeight = (rctslide->uHeight) -i;
			rctgma.uHeight = (rctslide->uHeight) -i;
			rctgma.uStartY = (rctslide->uStartY) + i;
		}
		else
		{
			rctgma.uHeight = i;
			rctgma.uStartY = ysld-i;
			rctmem.uHeight = i;
		}

		gelib_flush_rgn(pgma,prgn,&rctgma,&rctmem,0);
		GELIB_EFFECT_DELAY(0);
	}

	if(uflg)
	{
		rctgma.uHeight = (rctslide->uHeight);
		rctgma.uStartY = rctslide->uStartY;
		gelib_fillrect(pgma,&rctgma,(transcolor_const[pgma->color_mode]));
	}
	else
	{
		rctgma.uHeight = (rctslide->uHeight);
		rctgma.uStartY = rctslide->uStartY;
		rctmem.uHeight = (rctslide->uHeight);
		gelib_flush_rgn(pgma,prgn,&rctgma,&rctmem,0);
	}
	
	return 0;
}
Ejemplo n.º 6
0
UINT32 osdwnd_showwnd(PGUI_WINDOW pwnd,UINT32 param)
{
	UINT32 i,bfind;
	PGUI_REGION 	prgn;
	PGUI_VSCR	pvscr;
	PGUI_OBJWND wndobj;
	
	i = 0;
	if(gelib_get_wndmonitor())
	{
		bfind = 0;
		wndobj = (PGUI_OBJWND)param;
		if(g_wndrects_cnt>0)
		{
			for(i=0;i<g_wndrects_idx;i++)
			{
				if(MEMCMP(&(wndobj->frame),&(g_wnd_rects[i]),sizeof(GUI_RECT)) == 0)
				{
					bfind = 1;
					break;
				}
			}
		}

		if((gelib_wndrects_valid())&&( bfind==0))
		{
			MEMCPY(&(g_wnd_rects[g_wndrects_idx]),&(wndobj->frame),sizeof(GUI_RECT));
			g_wndrects_idx++;
			g_wndrects_cnt++;
		}

		if(gelib_wndrects_full())
		{//wndrects is not enough
			gelib_disable_wnd_monitors(1);
		}
		else if(gelib_wndrects_valid()==0)
		{
			osdwnd_reclaim_rects();
		}
		
		if(gelib_wndrects_showon() && (g_osdwnd_onoff == 0))
		{
			pvscr = OSD_GetTaskVscr(osal_task_get_current_id());
			prgn = gelib_getdstrgn(pvscr->dst_layer,pvscr->dst_rgn);
			ge_show_onoff((struct ge_device *)gui_dev,(ge_surface_desc_t *)prgn->hsurf,1);

			if(gelib_getdual_support())
			{
				prgn = gelib_getdstrgn(GUI_SLVGMA_SURF,0);
				ge_show_onoff_deo((struct ge_device *)gui_dev,(ge_surface_desc_t *)prgn->hsurf,1);
			}

			g_osdwnd_onoff = 1;
		}
	}

	return i;
}
Ejemplo n.º 7
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
}
Ejemplo n.º 8
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);
}
Ejemplo n.º 9
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
}
Ejemplo n.º 10
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);
}
Ejemplo n.º 11
0
static PRESULT game_con_callback(POBJECT_HEAD obj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;

	switch (event)
	{
		case EVN_PRE_OPEN:
#ifdef USE_LIB_GE
			OSD_SetVscrDst(GUI_MEMVSCR_SURF,0);
			PGUI_VSCR pVscr=OSD_GetTaskVscr(osal_task_get_current_id());
			OSD_SetRect(&(pVscr->frm),0,0,0,0);
#endif
			record_scene();
			OSD_SetAttr((POBJECT_HEAD) &txt_start, C_ATTR_ACTIVE);
			OSD_SetContainerFocus(&game_con, 1);
			game_pre_open();
			break;
		case EVN_POST_OPEN:
#ifdef USE_LIB_GE
			OSD_SetVscrDst(GUI_GMA2_SURF,0);
#endif
			break;
		case EVN_PRE_CLOSE:
			*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;
			break;
		case EVN_POST_CLOSE:
			restore_scene();
			break;
		case EVN_POST_DRAW:
			game_1st_draw();
			break;

		case EVN_MSG_GOT:
			ret = games_com_message_proc(param1, param2);
			game_event(param1, param2);
			break;
	}
	return ret;
}
Ejemplo n.º 12
0
UINT32 gelib_disable_wnd_monitors(UINT32 onoff)
{
	PGUI_VSCR	pvscr;
	PGUI_REGION 	prgn;
	
	g_wnd_monitors = 0;
	
	g_wndrects_idx = 0;
	g_wndrects_cnt = 0;
	g_osdwnd_onoff = 1;
	MEMSET(g_wnd_rects,0x0,sizeof(g_wnd_rects));
	
	pvscr = OSD_GetTaskVscr(osal_task_get_current_id());
	prgn = gelib_getdstrgn(pvscr->dst_layer,pvscr->dst_rgn);
	ge_show_onoff((struct ge_device *)gui_dev,(ge_surface_desc_t *)prgn->hsurf,onoff);

	if(gelib_getdual_support())
	{
		prgn = gelib_getdstrgn(GUI_SLVGMA_SURF,0);
		ge_show_onoff_deo((struct ge_device *)gui_dev,(ge_surface_desc_t *)prgn->hsurf,1);
	}
	return 0;
}
Ejemplo n.º 13
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);
        }
	}	
}
Ejemplo n.º 14
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;
}
Ejemplo n.º 15
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);
}
Ejemplo n.º 16
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;
}
Ejemplo n.º 17
0
INT32 ali_ipanel_enter_mw(UINT32 param1, UINT32 param2)
{
	struct osd_device *osd_dev = NULL;
	INT32 ret = SUCCESS;
	VSCR *lpVscr;
	
	if (ali_ipanel_flag_id == OSAL_INVALID_ID)
	{
		ali_ipanel_flag_id = osal_flag_create(0);
		if (ali_ipanel_flag_id == OSAL_INVALID_ID)
		{
			IPANEL_PRINTF("%s() create flag failed\n", __FUNCTION__);
			return  - 1;
		}
	}
	//close lib monitor
	dm_set_onoff(0);

	stop_tdt();

	epg_off();

       sdt_monitor_off();

	//suspend key task
	key_task_suspend();

	//suspend ota task
	ota_task_suspend();

	//close sie to stop get si section
	/*if (SUCCESS != sie_close())
	{
		IPANEL_PRINTF("%s() close sie failed\n", __FUNCTION__);
		return  - 1;
	}*/

	//close vpo
	struct vpo_device *vpo_dev = (struct vpo_device *)dev_get_by_id ( HLD_DEV_TYPE_DIS, 0 );
	vpo_win_onoff(vpo_dev, FALSE);

#if(CAS_TYPE==CAS_CDCA3||CAS_TYPE == CAS_TF||CAS_TYPE==CAS_CDCA)
	ap_osd_layer2_exit();
#endif

	//close osd
	osd_dev = (struct osd_device *)dev_get_by_id(HLD_DEV_TYPE_OSD, 0);
	if(osd_dev!=NULL)
		OSDDrv_Close((HANDLE)osd_dev);
	osd_dev = (struct osd_device *)dev_get_by_id(HLD_DEV_TYPE_OSD, 1);
	if(osd_dev!=NULL)
		OSDDrv_Close((HANDLE)osd_dev);

#ifdef USE_LIB_GE
	 struct ge_device* ge_dev= (struct ge_device*)dev_get_by_id(HLD_DEV_TYPE_GE, 0);

     app_gui_release(1);
	 ge_close(ge_dev);     
#endif
	
	//free osd vscr buf
	OSD_TaskBuffer_Free(osal_task_get_current_id(), NULL);
	lpVscr = OSD_GetTaskVscr(osal_task_get_current_id());
	lpVscr->lpbScr = NULL;

    	recreate_prog_view(VIEW_ALL|PROG_ALL_MODE, 0);
	ipanel_porting_dmx_init();
	
	//call ipanel init
	ipanel_task_init(param1, param2);

	//suspend on ali_ipanel_flag_id wait ipanel exit
	ALI_IPANEL_ENTER_MUTEX(ALI_IPANEL_FLAG_EXIT_MW);

	osd_dev = (struct osd_device *)dev_get_by_id(HLD_DEV_TYPE_OSD, 0);
	if(osd_dev!=NULL)
        ap_osd_init();

	#if 0//ndef MIS_AD
	#ifdef MULTI_CAS
	#if((CAS_TYPE==CAS_CDCA)||(CAS_TYPE==CAS_TF)||(CAS_TYPE==CAS_DVT))
	osd_dev = (struct osd_device *)dev_get_by_id(HLD_DEV_TYPE_OSD, 1);
	if(osd_dev!=NULL)
		ap_osd_layer2_init();
	#endif
	#endif
	#endif

	return ret;
}