예제 #1
0
// private
void OSD_DrawMultiTextCell(PMULTI_TEXT pCtrl, UINT8 bStyleIdx,UINT32 nCmdDraw)
{
	lpVSCR 		pVscr;
	struct OSDRect *objframe;	
	//ID_RSC		RscId;
	PWINSTYLE  	lpWinSty;
	UINT32		bgColor;
	UINT8 			bAlign,hAligin,vAlign;
	OBJECTINFO	RscLibInfo;
	struct OSDRect r;

	PTEXT_CONTENT pText;
	UINT16 width,height,left,right,bottom;
	INT16  lidx;
	UINT32 i,k;
	UINT8 *pStr,*pDrawStr;
	UINT16  wc;
	UINT16 wordlen,wordw,wordh,maxW,maxH,charw,charh;
	UINT8 font;
	UINT16 ox,oy,x,y,l,t;
	mtxtinfo_t mtxtinfo;
	UINT32 bNewLine;
	BOOL reverse_flag;
#ifdef BIDIRECTIONAL_OSD_STYLE
	UINT16 lineCount = 1;
	BOOL mirror_flag = g_osd_rsc_info.osd_get_mirror_flag();
#endif
	
	objframe	= &pCtrl->head.frame;
	font        = pCtrl->head.bFont;
	lpWinSty 	= g_osd_rsc_info.osd_get_win_style(bStyleIdx);
	bgColor     = lpWinSty->wBgIdx;
	bAlign 		= pCtrl->bAlign;
	hAligin     = GET_HALIGN(bAlign);
	vAlign      = GET_VALIGN(bAlign);
	
	pVscr = OSD_DrawObjectFrame(objframe,bStyleIdx);
	if(pVscr->lpbScr != NULL)
		bgColor = C_NOSHOW;
    
	r = *objframe;
	r.uLeft += pCtrl->rcText.uLeft;
	r.uTop  += pCtrl->rcText.uTop;
	r.uWidth    = pCtrl->rcText.uWidth;
	r.uHeight   = pCtrl->rcText.uHeight;
	width  = r.uWidth;
	height = r.uHeight;

GET_MULTITEXT_INFOR:
	mtxtinfo.topline_idx = (UINT8)pCtrl->nLine;
	mtxtinfo.topline_pstr = NULL;
	OSD_GetMTextInfor(pCtrl,&mtxtinfo);
	if(mtxtinfo.topline_pstr == NULL && pCtrl->nLine!=0)
	{
		pCtrl->nLine = 0;
		goto GET_MULTITEXT_INFOR;
	}
	if(mtxtinfo.topline_pstr == NULL)
		return;


	ox = 0;
	if(mtxtinfo.total_lines == 1)
	{
		maxW = OSD_MultiFontLibStrMaxHW(mtxtinfo.topline_pstr,font,&maxW,&maxH,0);
		if(maxW<width)
		{
			if(hAligin==C_ALIGN_RIGHT)
				ox = width - maxW;
			else if(hAligin == C_ALIGN_CENTER)
				ox = (width - maxW)>>1;
		}        
	}
예제 #2
0
void OSD_DrawMultiTextCell(PMULTI_TEXT pCtrl, UINT8 bStyleIdx,UINT32 nCmdDraw)
{
	PGUI_VSCR 		pVscr;
	PGUI_RECT objframe;	
	PWINSTYLE  	lpWinSty;
	UINT32		mtxtstyle,bgColor;
	UINT8 			bAlign,hAligin,vAlign;
	OBJECTINFO	RscLibInfo;
	GUI_RECT r;

	PTEXT_CONTENT pText;
	UINT16 width,height,left,right,bottom;
	INT16  lidx;
	UINT32 i,k;
	UINT8 *pStr,*pDrawStr;
	UINT16  wc;
	UINT16 wordlen,wordw,wordh,maxW,maxH,charw,charh;
	UINT8 font;
	UINT16 ox,oy,x,y,l,t;
	mtxtinfo_t mtxtinfo;
	UINT32 bNewLine;
	BOOL reverse_flag;
    
	if(OSD_GetUpdateType(nCmdDraw) == C_UPDATE_CONTENT)
		mtxtstyle = (UINT32)(~0);
	else
		mtxtstyle = bStyleIdx;
	objframe	= &pCtrl->head.frame;
	lpWinSty 	= g_gui_rscfunc.osd_get_win_style(bStyleIdx);
	bgColor     = lpWinSty->wBgIdx;
	bAlign 		= pCtrl->bAlign;
	hAligin     = GET_HALIGN(bAlign);
	vAlign      = GET_VALIGN(bAlign);
	
	if(OSD_GetAttrSlave(pCtrl))
	{
		font  = ((pCtrl->head.bFont) |C_FONT_SLVMASK);
		pVscr = OSD_DrawSlaveFrame(objframe,bStyleIdx);
	}
	else
	{
		font  = pCtrl->head.bFont;
		pVscr = OSD_DrawObjectFrame(objframe,mtxtstyle);
	}
    
	r = *objframe;
	r.uStartX += pCtrl->rcText.uStartX;
	r.uStartY  += pCtrl->rcText.uStartY;
	r.uWidth    = pCtrl->rcText.uWidth;
	r.uHeight   = pCtrl->rcText.uHeight;
	width  = r.uWidth;
	height = r.uHeight;

	GET_MULTITEXT_INFOR:
	mtxtinfo.topline_idx = (UINT8)pCtrl->nLine;
	mtxtinfo.topline_pstr = NULL;
	OSD_GetMTextInfor(pCtrl,&mtxtinfo);
	if(mtxtinfo.topline_pstr == NULL && pCtrl->nLine!=0)
	{
		pCtrl->nLine = 0;
		goto GET_MULTITEXT_INFOR;
	}
	if(mtxtinfo.topline_pstr == NULL)
	return;

	ox = 0;
	if(mtxtinfo.total_lines == 1)
	{
		maxW = OSD_MultiFontLibStrMaxHW(mtxtinfo.topline_pstr,font,&maxW,&maxH,0);
		if(maxW<width)
		{
			if(hAligin==C_ALIGN_RIGHT)
				ox = width - maxW;
			else if(hAligin == C_ALIGN_CENTER)
				ox = (width - maxW)>>1;
		}        
	}