⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guinavigation.cpp.svn-base

📁 sigmadesign smp8623 gui source code ,bingo
💻 SVN-BASE
📖 第 1 页 / 共 5 页
字号:
RMstatus RMcuracaoGuiNavigation::GetVideoOutCommandList(typeVideoOutCommands *videoOutCmdList, RMuint32 tvStandard){	RMstatus status = RM_OK;	if (tvStandard == TV_NTSC_COMMAND && m_NTSCvideoOutCommandList.count != 0)		RMMemcpy(videoOutCmdList, &m_NTSCvideoOutCommandList, sizeof(typeVideoOutCommands));	else if (tvStandard == TV_PAL_COMMAND && m_PALvideoOutCommandList.count != 0)		RMMemcpy(videoOutCmdList, &m_PALvideoOutCommandList, sizeof(typeVideoOutCommands));	else		return RM_ERROR;	return status;}RMstatus RMcuracaoGuiNavigation::ModifyTVStandardMenu(RMuint32 commandId, RMuint32 linkId, RMascii *value){	// we look in the setup page	if (m_setupPageId == 0)		return RM_ERROR;	RMASSERT(m_setupPageId < m_nbOsdPages);	RMascii menuName[MAX_GUI_TEXT_VALUE];	RMuint8 i, j;#ifdef GUI_REFID_2	//The following decides what TV connector popup should be showed depending on TV standard	if(linkId == 0 || linkId == 1111)	{		if(commandId == TV_NTSC_COMMAND)		RMCopyAscii(menuName, "NTSCConnectorPopup");		else		RMCopyAscii(menuName, "PALConnectorPopup");	}	else	{		RMCopyAscii(menuName, value);	}	fprintf(stderr,"Changing TV standard and related links\n");	for(i = 0; i < m_osdPages[m_setupPageId]->nbMenus; i++)	{		for(j = 0; j < m_osdPages[m_setupPageId]->menus[i]->nbItems; j++)		{			if(RMCompareAscii(m_osdPages[m_setupPageId]->menus[i]->items[j]->name, "TvConnectorMenuItem"))			{				fprintf(stderr,"Found Menu item to perform link change.... current: %s, new: %s\n", m_osdPages[m_setupPageId]->menus[i]->items[j]->events[0]->link, menuName);				RMCopyAscii(m_osdPages[m_setupPageId]->menus[i]->items[j]->events[0]->link, menuName);			}		}	}#else	// find menu button	RMstatus status;	RMuint32 buttonId = 0;	if (linkId == 0)	{		RMascii commandName[MAX_GUI_TEXT_VALUE];		if (RMFAILED(GetCommandName(commandId, commandName)))			return RM_ERROR;		for (i = 0; i < m_osdPages[m_setupPageId]->nbMenus; i++)		{			// go through menu item lists			for (j = 0; j < m_osdPages[m_setupPageId]->menus[i]->nbItems; j++)			{				// go thru button list				for (RMuint8 k = 0; k < m_osdPages[m_setupPageId]->menus[i]->items[j]->nbButtons; k++)				{					for (RMuint8 m = 0; m < m_osdPages[m_setupPageId]->menus[i]->items[j]->buttons[k]->nbEvents; m++)					{						// get command value						if (RMCompareAsciiCaseInsensitively(								m_osdPages[m_setupPageId]->menus[i]->items[j]->buttons[k]->events[m]->command, commandName))						{							// [RC] TRICK not to create another function, change							RMuint32 activePageId = m_activePageId;							m_activePageId = m_setupPageId;							status = GetObjectIdByName(m_osdPages[m_setupPageId]->menus[i]->items[j]->buttons[k]->events[m]->link,									&buttonId);							m_activePageId = activePageId;							if (RMFAILED(status))								return RM_ERROR;							RMCopyAscii(menuName, m_osdPages[m_setupPageId]->menus[i]->items[j]->buttons[k]->events[m]->value);							goto done;						}					}				}			}		}	}	else	{		buttonId = linkId;		RMCopyAscii(menuName, value);	}	done: if (buttonId == 0)		return RM_ERROR;	for (i = 0; i < m_osdPages[m_setupPageId]->nbButtons; i++)	{		if (m_osdPages[m_setupPageId]->buttons[i]->id == buttonId)		{			for (j = 0; j < m_osdPages[m_setupPageId]->buttons[i]->nbEvents; j++)			{				if (RMCompareAsciiCaseInsensitively(m_osdPages[m_setupPageId]->buttons[i]->events[j]->name, SELECT_EVENT))				{					RMCopyAscii(m_osdPages[m_setupPageId]->buttons[i]->events[j]->link, menuName);					RMCopyAscii(m_osdPages[m_setupPageId]->buttons[i]->keyright, menuName);					return RM_OK;				}			}		}	}#endif	return RM_ERROR;}RMstatus RMcuracaoGuiNavigation::DisplayPage(RMuint32 pageId){	RMstatus status;	RMuint16 i;	RMuint32 selectedObjectId;	RMint32 id = pageId;	if (!m_initialized)	{		RMDBGLOG((GUIDBG, "GUI not initialised !!\n"));		return RM_ERROR;	}	// reset selected object and activate current page	if (ISPOPUP(m_selectedObjectId))		DisplayPopup(m_selectedObjectId, FALSE);	SetCurrentObjectDeSelectedAttribute();	// suppress event bitmap timeouts	m_gui->gui->KillTimer(TIMER_EVENT);	ShowOsd(TRUE);	{		HTTPFile* f;		status = RM_OK;		RMascii* where = RMCatAscii(m_parser->GetUrl(), m_parser->GetLangPath(), NULL);		RMint16 n = 0;		f = fetchOpen(where, RM_HTTP_VERBOSE);		if(f)		{			RMuint8 buffer[10];			n = fetchRead(buffer, 10, f);			if(n != -1)			{				buffer[n] = '\0';				{					printf("buffer %s\n %d \n", (RMascii*) buffer, n);					m_curLanguage = atoi((RMascii*) buffer);				}			}			fetchClose(f);		}		else		{			status = RM_ERROR;			m_curLanguage = 0;		}		RFREE(where);	}	//	guiOsdPageType* pageOld = m_osdPages[pageId];	if (m_osdPages[id]->object.dynamic)	{		HTTPFile* f;		status = RM_OK;		RMascii* where = RMCatAscii(m_parser->GetUrl(), m_osdPages[id]->object.url, NULL);		RMint16 n = 0;		f = fetchOpen(where, RM_HTTP_VERBOSE);		if(f)		{			RMuint8 buffer[32768];			n = fetchRead(buffer, 32768, f);			if(n != -1)			{				buffer[n] = '\0';				if(atoi((RMascii*)buffer) == 302)				{					printf("buffer %s\n %d \n", (RMascii*) buffer, n);					RFREE(where);					where = NULL;					where = RMCatAscii(m_parser->GetUrl(), (RMascii*)&buffer[4], NULL);					fetchClose(f);					f = fetchOpen(where, RM_HTTP_VERBOSE);					if(f)					{						n = fetchRead(buffer, 32768, f);						if(n != -1)						{							printf("buffer %s\n %d \n", (RMascii*) buffer, n);							id = m_parser->ParseWEBPage(m_osdPages, id, buffer, n);							//if (page)							//	m_osdPages[pageId] = page;							//else							if(id < 0)							{								status = RM_ERROR;								id = 2;							}						}						//fetchClose(f);					}				}				else if(atoi((RMascii*)buffer) == 303)				{					id = 2;					printf("page name %s\n", m_osdPages[id]->name);				}				else				{					printf("buffer %s\n %d \n", (RMascii*) buffer, n);					id = m_parser->ParseWEBPage(m_osdPages, id, buffer, n);				//if (page)				//	m_osdPages[pageId] = page;				//else					if(id < 0)					{						status = RM_ERROR;						id = 2;					}				}			}			else			{				status = RM_ERROR;				id = 2;			}			fetchClose(f);		}		else		{			status = RM_ERROR;			id = 2;		}		RFREE(where);		if(RMFAILED(status))			return status;		//		if(RMFAILED(status))		//			return status;	}	// display background, bitmaps and buttons	status = DisplayPageBitmaps(id);	if (RMFAILED(status))	{		return status;	}	m_activePageId = id;	RMMemset(&m_List, 0, sizeof(typeListData));	if (m_osdPages[id]->selectedObject != (RMascii*) NULL)	{		status = GetObjectIdByName(m_osdPages[id]->selectedObject, &selectedObjectId);		if (RMSUCCEEDED(status))		{			SelectObject(selectedObjectId);		}	}	// clear generic list data	// display everything else	for (i = 0; i < m_osdPages[id]->nbMenus; i++)	{		if (m_osdPages[id]->menus[i]->object.visible)		{			DisplayMenu(i, TRUE, FALSE);		}	}	for (i = 0; i < m_osdPages[id]->nbLists; i++)	{	//	printf("list visible %d\n", m_osdPages[id]->lists[i]->object.visible);		if (m_osdPages[id]->lists[i]->object.visible)		{			DisplayList(i, TRUE, TRUE);		}	}	for (i = 0; i < m_osdPages[id]->nbStrings; i++)	{		if (m_osdPages[id]->strings[i]->object.visible)		{			DisplayString(i);		}	}	if (m_osdPages[id]->temp)	{		RMBitmapObject bmp;		bmp.x = 0;		bmp.y = 0;		bmp.file = m_osdPages[m_activePageId]->object.file;		if(m_osdPages[id]->temp->value < m_osdPages[m_activePageId]->temp->min ||				m_osdPages[id]->temp->value > m_osdPages[m_activePageId]->temp->max)			m_osdPages[id]->temp->value = m_osdPages[m_activePageId]->temp->min;		m_osdPages[id]->temp->object.stepnumber = m_osdPages[id]->temp->value - m_osdPages[m_activePageId]->temp->min;		sprintf(m_osdPages[m_activePageId]->temp->object.text, "%d", (RMuint16) (m_osdPages[m_activePageId]->temp->object.stepnumber				+ m_osdPages[m_activePageId]->temp->min));		gfxDrawSlider(m_pRua, 0, 0, &m_osdPages[id]->temp->object, &bmp);	}	//DisplaySlider(TEMPERATURE_CONTROL, m_osdPages[pageId]->temp->value);	//	m_activePageId = pageId;	// clear generic list data	//	RMMemset(&m_List, 0, sizeof(typeListData));	// display everything else	//	for(i = 0; i < m_osdPages[pageId]->nbMenus; i++){	//		if(m_osdPages[pageId]->menus[i]->object.visible){	//			DisplayMenu(i, TRUE, FALSE);	//		}	//	}	//	for(i = 0; i < m_osdPages[pageId]->nbLists; i++){	//		if(m_osdPages[pageId]->lists[i]->object.visible){	//			DisplayList(i, TRUE, FALSE);	//		}	//	}	//	for(i = 0; i < m_osdPages[pageId]->nbStrings; i++){	//		if(m_osdPages[pageId]->strings[i]->object.visible){	//			DisplayString(i);	//		}	//	}	printf("display page\n");	m_gui->gui->RestoreNonTimedEvent();	return status;}RMstatus RMcuracaoGuiNavigation::DisplayButton(RMuint8 buttonIndex){	if (buttonIndex > MAX_GUI_BUTTONS)		return RM_ERROR;	if (ISPOPUP(m_selectedObjectId))	{		for (RMuint8 i = 0; i < m_nbPopups; i++)		{			if (m_Popups[i]->id == m_selectedObjectId)			{				RMuint16 x, y;				x = m_Popups[i]->object.x;				y = m_Popups[i]->object.y;#ifdef WITH_WMVHD_SUPPORT				if (m_wmvHDOn)				{					x = POPUP_XOFFSET;					y = POPUP_YOFFSET;				}#endif				return gfxDrawPopupButton(m_pRua, &m_Popups[i]->object, x, y, &m_Popups[i]->buttons[buttonIndex]->object);			}		}		return RM_ERROR;	}	else	{#ifdef WITH_WMVHD_SUPPORT		if (m_wmvHDOn)		{			return UpdateButton(buttonIndex);		}		else			return gfxDrawButton(m_pRua, &m_osdPages[m_activePageId]->buttons[buttonIndex]->object);#else		return gfxDrawButton(m_pRua, &m_osdPages[m_activePageId]->buttons[buttonIndex]->object);#endif	}}RMstatus RMcuracaoGuiNavigation::UpdateButton(RMuint8 buttonIndex){	RMstatus status = RM_OK;	RMuint8 i;	RMuint16 l1, t1, r1, b1;	RMuint16 bmpwidth, bmpheight;	RMuint16 l2, t2, r2, b2;	RMuint8 zIndex;	RMBitmapObject bitmaps[MAX_GUI_BITMAPS];	RMuint8 nbitmaps = 0;	l1 = m_osdPages[m_activePageId]->buttons[buttonIndex]->object.x;	t1 = m_osdPages[m_activePageId]->buttons[buttonIndex]->object.y;	//	status = gfxGetBitmapDimensions(m_pRua, &m_osdPages[m_activePageId]->buttons[buttonIndex]->object,	//					&buttonwidth, &buttonheight);	//	if(RMFAILED(status))	//		return status;	// [RC] NEED TO CHANGE THIS TO HAVE THE REAL BITMAP DIMENSIONS!!!!!!	r1 = l1 + m_osdPages[m_activePageId]->buttons[buttonIndex]->object.width;	b1 = t1 + m_osdPages[m_activePageId]->buttons[buttonIndex]->object.height;	zIndex = m_osdPages[m_activePageId]->buttons[buttonIndex]->object.zIndex;	// get objects under current object	// test bitmaps

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -