Ejemplo n.º 1
0
static PRESULT sm_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT32 i;
	UINT8	unact;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	POBJECT_HEAD focusObj;

	
	switch(event)
	{
	case EVN_PRE_OPEN:
		if (!submenu_set_items(sub_menu_desc))
			return PROC_LEAVE;

		//wincom_open_title(pObj,sub_menu_desc->title_id, 0);  //guop

		
		break;
	case EVN_POST_OPEN:
		break;
		
	case EVN_PRE_CLOSE:
		
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		OSD_DrawObject((POBJECT_HEAD)&g_win_submenu,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS);
		break;

	case EVN_POST_CLOSE:
		break;
	case EVN_UNKNOWN_ACTION:
        submenu_unknown_act(sub_menu_desc, (VACTION)(param1>>16));
        ret = PROC_LOOP;
		break;
    case EVN_MSG_GOT:
		if(param1 == CTRL_MSG_SUBTYPE_CMD_STO && param2 == USB_STATUS_OVER)
		{
			storage_dev_mount_hint(1);
			submenu_set_items(sub_menu_desc);
			submenu_show();
			OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS);
#ifdef USB_MP_SUPPORT
#ifdef USB_SAFELY_REMOVE_SUPPORT
	        extern UINT8 g_show_usb_safely_removed;
	        if (g_show_usb_safely_removed)
	        {
			g_show_usb_safely_removed = 0;
			UINT8 back_saved;
			win_compopup_init(WIN_POPUP_TYPE_OK);
			win_compopup_set_msg(NULL, NULL, RS_USB_SAFELY_REMOVE_SUCCESS);
			ap_clear_all_message();
			win_compopup_open_ext(&back_saved);
	        }
#endif
#endif
			
		}
		
	default:
		;
	}

	return ret;
}
Ejemplo n.º 2
0
static PRESULT sm_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT32 i;
	UINT8	unact;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	POBJECT_HEAD focusObj;

	
	switch(event)
	{
	case EVN_PRE_OPEN:
#if 0		
		for(i=0;i<9;i++)
			ComInt2UniStr(display_strs[i], i + 1, 0);
#endif			
		if (!submenu_set_items(sub_menu_desc))
		{
			return PROC_LEAVE;
		}
 #ifdef EXIT_KEY_EXIT_ALL_MENU
		exit_key_flag =FALSE;
#endif
		//wincom_open_title(pObj,sub_menu_desc->title_id, 0);  //guop		
		
		break;

	case EVN_POST_OPEN:
		break;
		
	case EVN_PRE_DRAW:
	{

		
		UINT8 mm_focus_id=  OSD_GetFocusID((POBJECT_HEAD)&g_win_mainmenu);
		UINT8 sm_focus_id=  OSD_GetFocusID((POBJECT_HEAD)&g_win_submenu);
		#if ((defined(OSD_GOLDENMEDIA)) ||(defined(OSD_OCEANBLUE))||(defined(OSD_15))||(defined(OSD_12)))
			((POBJECT_HEAD)&g_win_submenu)->frame.uHeight=(sub_menu_desc->item_count)*43+50;	
		#else
		if((mm_focus_id==1)/*&&((sm_focus_id==1)||(sm_focus_id==2))*/)
			((POBJECT_HEAD)&g_win_submenu)->frame.uHeight=W_H+14;
		else
			((POBJECT_HEAD)&g_win_submenu)->frame.uHeight=W_H;	
		#endif
	}break;

	case EVN_POST_DRAW:
	{

		UINT16 str_id;
		UINT8 mm_focus_id=  OSD_GetFocusID((POBJECT_HEAD)&g_win_mainmenu);
		UINT8 sm_focus_id=  OSD_GetFocusID((POBJECT_HEAD)&g_win_submenu);
		
		str_id=mm_item_str_ids[mm_focus_id-1];
		OSD_SetTextFieldContent((PTEXT_FIELD)&subm_item_title,STRING_ID,str_id );
		OSD_DrawObject((POBJECT_HEAD)&subm_item_title,C_UPDATE_ALL);
		
		//item_count = sub_menu_desc->item_count;
#if ((defined(OSD_BLACKBERRY))||(defined(OSD_GOLDENMEDIA))||(defined(OSD_OCEANBLUE))||(defined(OSD_15))||(defined(OSD_12)))
#else
	need_draw_signal_status=0;
#endif

#ifdef OSD_12
#ifdef PREVIEW_SUBMENU
		switch(mm_focus_id)
		{
			case 1: 
				//str_id=RS_MM_SERVICE; 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(editchannel_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(editchannel_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER/* + idx + C_SUBMENU_ID_BASE*/);
				}				
				break;
				
			case 2: 
				//str_id=RS_MM_INSTALLATION;
				//if(sm_focus_id==1)
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(installation_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(installation_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER/* + idx + C_SUBMENU_ID_BASE*/);
				}
				break;			
				
		#ifdef PREVIEW_SUBMENU  //-a by wangyang 
			case 3: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(system_sub_menus[sm_focus_id-1]!=NULL)
					{
					/*	if(system_sub_menus[sm_focus_id-1]==(POBJECT_HEAD)&g_win_disk_operate)
							OSD_ObjOpen((POBJECT_HEAD)&g_win_disk_operate, MENU_OPEN_TYPE_OTHER );
						else*/
							OSD_ObjOpen(system_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
					}
				}
				break;			
				
			case 4: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(preference_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(preference_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;				
				
			case 13: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(network_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(network_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;	
				
				#if 1
			case 14: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(sm_focus_id==1)
					{
						game_othello_init();
						
					}
					else if(sm_focus_id==2)
					{
						game_sudoku_init();
					}
					if(games_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(games_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;
				#endif
				
			case 15: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(ca_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(ca_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;			
				
			case 16: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(upg_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(upg_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;	
		#endif
		
			default:
				break;
		}
#endif
#else
#ifdef PREVIEW_SUBMENU
		switch(mm_focus_id)
		{
			case 1: 
				//str_id=RS_MM_SERVICE; 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(editchannel_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(editchannel_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER/* + idx + C_SUBMENU_ID_BASE*/);
				}				
				break;
				
			case 2: 
				//str_id=RS_MM_INSTALLATION;
				//if(sm_focus_id==1)
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(installation_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(installation_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER/* + idx + C_SUBMENU_ID_BASE*/);
				}
				break;			
				
		#ifdef PREVIEW_SUBMENU  //-a by wangyang 
			case 3: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(system_sub_menus[sm_focus_id-1]!=NULL)
					{
					/*	if(system_sub_menus[sm_focus_id-1]==(POBJECT_HEAD)&g_win_disk_operate)
							OSD_ObjOpen((POBJECT_HEAD)&g_win_disk_operate, MENU_OPEN_TYPE_OTHER );
						else*/
							OSD_ObjOpen(system_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
					}
				}
				break;			
				
			case 4: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(preference_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(preference_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;				
				
			case 9: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(network_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(network_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;	
				
				#if 1
			case 10: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(sm_focus_id==1)
					{
						game_othello_init();
						
					}
					else if(sm_focus_id==2)
					{
						game_sudoku_init();
					}
					if(games_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(games_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;
				#endif
				
			case 11: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(ca_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(ca_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;			
				
			case 12: 
				if(submenu_open_from_stack)
				{
					submenu_open_from_stack=0;
					if(upg_sub_menus[sm_focus_id-1]!=NULL)
						OSD_ObjOpen(upg_sub_menus[sm_focus_id-1],MENU_OPEN_TYPE_OTHER);
				}
				break;	
		#endif
		
			default:
				break;
		}
#endif
#endif

		//if(item_count<3)
		//OSD_SetObjRect(&subm_item_bg,CON_L,CON_T,CON_W,CON_H*2);
		//else
		//OSD_SetObjRect(&subm_item_bg,CON_L,CON_T,CON_W,CON_H*item_count+2);
		//OSD_DrawObject((POBJECT_HEAD)&subm_item_bg,C_UPDATE_ALL);

	}break;

	case EVN_PRE_CLOSE:
		
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		//OSD_DrawObject((POBJECT_HEAD)&g_win_submenu,C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS);//albert.li del
		break;

	case EVN_POST_CLOSE:
		enter_system_flag=FALSE;
#if ((defined(OSD_BLACKBERRY))||(defined(OSD_GOLDENMEDIA))||(defined(OSD_OCEANBLUE))/*||(defined(OSD_15))*/)
    	#ifdef EXIT_KEY_EXIT_ALL_MENU
		if(exit_key_flag)
			api_full_screen_play();
    	#endif
#else
		api_full_screen_play();
#endif

#if ((defined(OSD_BLACKBERRY))||(defined(OSD_GOLDENMEDIA))||(defined(OSD_OCEANBLUE))||(defined(OSD_15))||(defined(OSD_12)))
#else
	need_draw_signal_status=1;
#endif

 #ifdef EXIT_KEY_EXIT_ALL_MENU
 	#ifdef MINI_INFO_BAR//wdh 2012.2.3 对此客户,进入service 的submenu项直接按推出键会出现信号条没消除掉,原因是把INFO BAR 改小以后没有刷新的这块区域
			win_progname_signal_close();
	#endif
	if(exit_key_flag ==FALSE )
	{
		exit_submenu_flag_mute =TRUE;
		exit_submenu_flag_pause =TRUE;
		exit_submenu_flag_rec =TRUE;
		ap_send_key(V_KEY_MENU, TRUE);
	}
	else
	{
	
		exit_key_flag =FALSE;
	}
#else
		ap_send_key(V_KEY_MENU, TRUE);//albert.li add
#endif
		break;
		
	case EVN_UNKNOWN_ACTION:
#ifdef PREVIEW_SUBMENU
		unact = (VACTION)(param1>>16) ;
		if((unact == VACT_FOCUS_UP)||(unact == VACT_FOCUS_DOWN))
			;
	        else
#endif	
			submenu_unknown_act(sub_menu_desc, (VACTION)(param1>>16));
	        ret = PROC_LOOP;
		break;
		
    case EVN_MSG_GOT:

		if(param1 == CTRL_MSG_SUBTYPE_CMD_STO && param2 == USB_STATUS_OVER)
		{
			#ifdef PREVIEW_SUBMENU  //-a by wangyang 
			UINT8 sm_focus_id=  OSD_GetFocusID((POBJECT_HEAD)&g_win_submenu);
			#endif

			//storage_dev_mount_hint(1);
			submenu_set_items(sub_menu_desc);
			submenu_show();
			OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS);

			// if all sub menu items are inactive, exit sub menu
			if (!submenu_active(sub_menu_desc))
			{
				UINT32 hkey;
				ap_vk_to_hk(0, V_KEY_EXIT, &hkey);
				ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hkey, FALSE);
			}

#ifdef USB_MP_SUPPORT
#ifdef USB_SAFELY_REMOVE_SUPPORT
	#ifndef DISK_MANAGER_SUPPORT
	        extern UINT8 g_show_usb_safely_removed;
	        if (g_show_usb_safely_removed)
	        {
			g_show_usb_safely_removed = 0;
			UINT8 back_saved;
			win_compopup_init(WIN_POPUP_TYPE_OK);
			win_compopup_set_msg(NULL, NULL, RS_USB_SAFELY_REMOVE_SUCCESS);
			ap_clear_all_message();
			win_compopup_open_ext(&back_saved);
	        }
	#endif
#endif
#endif

#ifdef PREVIEW_SUBMENU  //-a by wangyang 
		if(sub_menu_desc->title_id==RS_MM_SYSTEM)
		{
			if((sm_focus_id ==4)||(sm_focus_id ==5)	||(sm_focus_id ==6))
			{
				OSD_DrawFill(SUBMENU_W_L, SUBMENU_W_T, (SUBMENU_W_W), (SUBMENU_W_H), OSD_TRANSPARENT_COLOR, NULL);
				OSD_ObjOpen((POBJECT_HEAD)&win_info_con, MENU_OPEN_TYPE_OTHER );
			}
		}
		else if (sub_menu_desc->title_id==RS_MM_UPGRADE)
		{
			if((sm_focus_id ==3)||(sm_focus_id==4))
			{
				OSD_DrawFill(SUBMENU_W_L, SUBMENU_W_T, (SUBMENU_W_W), (SUBMENU_W_H), OSD_TRANSPARENT_COLOR, NULL);
				OSD_ObjOpen((POBJECT_HEAD)&win_rs232upg_con, MENU_OPEN_TYPE_OTHER );
			}

		}
#endif
		}
#ifdef PREVIEW_SUBMENU  //-a by wangyang 
{
		UINT8 sm_focus_id;
		sm_focus_id=  OSD_GetFocusID((POBJECT_HEAD)&g_win_submenu);
			
#if !defined (MAIN_CHIP_M3601S) && !defined (M3606_NON_NETWORK)
		if (sub_menu_desc->title_id==RS_MM_NETWORK)
		{
			if((sm_focus_id ==1))
			{
				TestNetStatus();
			}

		}
#endif
		
}
#endif

#ifdef NETWORK_SUPPORT
#ifdef WIFI_SUPPORT
		if(param1 == CTRL_MSG_SUBTYPE_CMD_WIFI_CTRL_MSG && (param2 == WIFI_MSG_DEVICE_PLUG_IN||param2 == WIFI_MSG_DEVICE_PLUG_OUT))
		{
			//storage_dev_mount_hint(1);
			submenu_set_items(sub_menu_desc);
			submenu_show();
			OSD_TrackObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_FOCUS);

			// if all sub menu items are inactive, exit sub menu
			if (!submenu_active(sub_menu_desc))
			{
				UINT32 hkey;
				ap_vk_to_hk(0, V_KEY_EXIT, &hkey);
				ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hkey, FALSE);
			}
	}
#endif
#endif
		
	default:
		break;
	}

	return ret;
}