📄 mapp_uimenudraw2.c
字号:
break;
case EN_CPSTATE_STATICS:
case EN_CPSTATE_UNSELECT:
BMPHandleIndex=OSDBitmapComponents_2[u8CPIndex].BMPHandleIndex_UnSelect;
break;
case EN_CPSTATE_HIDE:
BMPHandleIndex=OSDBitmapComponents_2[u8CPIndex].BMPHandleIndex_Hide;
break;
}
if(BMPHandleIndex!=NULL){
msAPI_OSD_DrawColorKeyBitmap(Osdcp_bmpHandle[BMPHandleIndex], clrBtn1.x, clrBtn1.y, gbmpfmt);
}
}
void MApp_UiMenu_DrawUnColorKeyBitmap_2(U8 u8CPIndex, COMPONENT_STATE_TYPE State)
{
U32 u32Colorkey;
U8 r_clr, g_clr, b_clr;
U8 BMPHandleIndex;
// clrBtn1.x = g_u16GroupXPos + OSDUnColorKeyBitmapComponents_2[u8CPIndex].u16OffsetXPos;
// clrBtn1.y = g_u16GroupYPos + OSDUnColorKeyBitmapComponents_2[u8CPIndex].u16OffsetYPos;
// gbmpfmt.width = OSDUnColorKeyBitmapComponents_2[u8CPIndex].u16Width;
// gbmpfmt.height = OSDUnColorKeyBitmapComponents_2[u8CPIndex].u16Height;
// gbmpfmt.bBmpColorKeyEnable = FALSE;
// gbmpfmt.bScale = OSDUnColorKeyBitmapComponents_2[u8CPIndex].bScale;
// u32Colorkey = OSDUnColorKeyBitmapComponents_2[u8CPIndex].u32Colorkey;
//make compiler happy
u8CPIndex=u8CPIndex;
r_clr=((u32Colorkey&0x00ff0000)>>16)&0xff;
g_clr=((u32Colorkey&0x0000ff00)>>8)&0xff;
b_clr=((u32Colorkey&0x000000ff))&0xff;
gbmpfmt.clrrange.color_s.a = 0;
gbmpfmt.clrrange.color_s.r = r_clr;
gbmpfmt.clrrange.color_s.g = g_clr;
gbmpfmt.clrrange.color_s.b = b_clr;
gbmpfmt.clrrange.color_e.a = 0;
gbmpfmt.clrrange.color_e.r = r_clr;
gbmpfmt.clrrange.color_e.g = g_clr;
gbmpfmt.clrrange.color_e.b = b_clr;
switch (State)
{
case EN_CPSTATE_STATICS:
case EN_CPSTATE_SELECT:
// BMPHandleIndex=OSDUnColorKeyBitmapComponents_2[u8CPIndex].BMPHandleIndex_Select;
break;
case EN_CPSTATE_PATH:
// BMPHandleIndex=OSDUnColorKeyBitmapComponents_2[u8CPIndex].BMPHandleIndex_Path;
break;
case EN_CPSTATE_UNSELECT:
// BMPHandleIndex=OSDUnColorKeyBitmapComponents_2[u8CPIndex].BMPHandleIndex_UnSelect;
break;
case EN_CPSTATE_HIDE:
// BMPHandleIndex=OSDUnColorKeyBitmapComponents_2[u8CPIndex].BMPHandleIndex_Hide;
break;
}
if(BMPHandleIndex!=NULL){
// msAPI_OSD_DrawColorKeyBitmap(Osdcp_bmpHandle[BMPHandleIndex], clrBtn1.x, clrBtn1.y, gbmpfmt);
}
}
void MApp_UiMenu_DrawMenuString0_2(U8 u8CPIndex, COMPONENT_STATE_TYPE State)
{
U32 u32FontColor;
U8 *pu8Str;
FONTHANDLE fHandle;
OSDDBG(printf("DrawMenuString0: %x\r\n", OSDMenuString0Components_2[u8CPIndex].u16FormatFlag));
clrBtn1.x = g_u16GroupXPos + OSDMenuString0Components_2[u8CPIndex].u16OffsetXPos;
clrBtn1.y = g_u16GroupYPos + OSDMenuString0Components_2[u8CPIndex].u16OffsetYPos;
clrBtn1.width = OSDMenuString0Components_2[u8CPIndex].u16Width;
clrBtn1.height = OSDMenuString0Components_2[u8CPIndex].u16Height;
switch (State)
{
case EN_CPSTATE_STATICS:
case EN_CPSTATE_SELECT:
u32FontColor=OSDMenuString0Components_2[u8CPIndex].u32FontColor_Select;
break;
case EN_CPSTATE_PATH:
u32FontColor=OSDMenuString0Components_2[u8CPIndex].u32FontColor_Path;
break;
case EN_CPSTATE_UNSELECT:
u32FontColor=OSDMenuString0Components_2[u8CPIndex].u32FontColor_UnSelect;
break;
case EN_CPSTATE_HIDE:
u32FontColor=OSDMenuString0Components_2[u8CPIndex].u32FontColor_Hide;
break;
}
clrBtn1.t_clr = u32FontColor;
clrBtn1.enTextAlign = OSDMenuString0Components_2[u8CPIndex].enTextAlign;
clrBtn1.Fontfmt.flag = (OSDMenuString0Components_2[u8CPIndex].u16FormatFlag & 0x7FFF);
#if (MAPP_UI_USE_STR_BITS_PROGRAM == 8)
if(OSDMenuString0Components_2[u8CPIndex].u16FormatFlag & _BIT15)
clrBtn1.bStringIndexWidth = CHAR_IDX_2BYTE;
else
clrBtn1.bStringIndexWidth = CHAR_IDX_1BYTE;
#else
clrBtn1.bStringIndexWidth = CHAR_IDX_2BYTE;
#endif
clrBtn1.Fontfmt.ifont_gap = OSDMenuString0Components_2[u8CPIndex].u8Gap;
//modify by Jason071031 for Ir crash
IeBuffer = IE;
IE=0;
pu8Str = MApp_UiMenu_Strcpy(OSDMenuString0Components_2[u8CPIndex].DisplayString(), clrBtn1.bStringIndexWidth);
IE=IeBuffer;
//pu8Str = MApp_UiMenu_Strcpy(OSDMenuString0Components_2[u8CPIndex].DisplayString(), clrBtn1.bStringIndexWidth);
//end by Jason071031
fHandle = MApp_UiMenu_GetCharacterTable( (U16*)pu8Str , Font[OSDMenuString0Components_2[u8CPIndex].FontHandleIndex].fHandle );
pu8Str = MApp_UiMenu_GetFirstCharater( (U16*)pu8Str );
msAPI_OSD_DrawText(fHandle, pu8Str, &clrBtn1);
}
void MApp_UiMenu_DrawMenuString1_2(U8 u8CPIndex, COMPONENT_STATE_TYPE State)
{
U32 u32FontColor;
U8 *pu8Str;
FONTHANDLE fHandle;
OSDDBG(printf("DrawMenuString1: %x\r\n", OSDMenuString1Components_2[u8CPIndex].u16FormatFlag));
clrBtn1.x = g_u16GroupXPos + OSDMenuString1Components_2[u8CPIndex].u16OffsetXPos;
clrBtn1.y = g_u16GroupYPos + OSDMenuString1Components_2[u8CPIndex].u16OffsetYPos;
clrBtn1.width = OSDMenuString1Components_2[u8CPIndex].u16Width;
clrBtn1.height = OSDMenuString1Components_2[u8CPIndex].u16Height;
switch (State)
{
case EN_CPSTATE_STATICS:
case EN_CPSTATE_SELECT:
u32FontColor=OSDMenuString1Components_2[u8CPIndex].u32FontColor_Select;
break;
case EN_CPSTATE_PATH:
u32FontColor=OSDMenuString1Components_2[u8CPIndex].u32FontColor_Path;
break;
case EN_CPSTATE_UNSELECT:
u32FontColor=OSDMenuString1Components_2[u8CPIndex].u32FontColor_UnSelect;
break;
case EN_CPSTATE_HIDE:
u32FontColor=OSDMenuString1Components_2[u8CPIndex].u32FontColor_Hide;
break;
}
clrBtn1.t_clr = u32FontColor;
clrBtn1.enTextAlign = OSDMenuString1Components_2[u8CPIndex].enTextAlign;
clrBtn1.Fontfmt.flag = (OSDMenuString1Components_2[u8CPIndex].u16FormatFlag & 0x7FFF);
#if (MAPP_UI_USE_STR_BITS_PROGRAM == 8)
if(OSDMenuString1Components_2[u8CPIndex].u16FormatFlag & _BIT15)
clrBtn1.bStringIndexWidth = CHAR_IDX_2BYTE;
else
clrBtn1.bStringIndexWidth = CHAR_IDX_1BYTE;
#else
clrBtn1.bStringIndexWidth = CHAR_IDX_2BYTE;
#endif
clrBtn1.Fontfmt.ifont_gap = OSDMenuString1Components_2[u8CPIndex].u8Gap;
//modify by Jason071031 for Ir crash
IeBuffer = IE;
IE=0;
pu8Str = MApp_UiMenu_Strcpy(OSDMenuString1Components_2[u8CPIndex].DisplayString(), clrBtn1.bStringIndexWidth);
IE=IeBuffer;
//pu8Str = MApp_UiMenu_Strcpy(OSDMenuString1Components_2[u8CPIndex].DisplayString(), clrBtn1.bStringIndexWidth);
//end by Jason071031
fHandle = MApp_UiMenu_GetCharacterTable( (U16*)pu8Str , Font[OSDMenuString1Components_2[u8CPIndex].FontHandleIndex].fHandle );
pu8Str = MApp_UiMenu_GetFirstCharater( (U16*)pu8Str );
msAPI_OSD_DrawText(fHandle, pu8Str, &clrBtn1);
}
void MApp_UiMenu_DrawMenuString2_2(U8 u8CPIndex, COMPONENT_STATE_TYPE State)
{
U32 u32FontColor;
U8 *pu8Str;
FONTHANDLE fHandle;
OSDDBG(printf("DrawMenuString1: %x\r\n", OSDMenuString2Components_2[u8CPIndex].u16FormatFlag));
clrBtn1.x = g_u16GroupXPos + OSDMenuString2Components_2[u8CPIndex].u16OffsetXPos;
clrBtn1.y = g_u16GroupYPos + OSDMenuString2Components_2[u8CPIndex].u16OffsetYPos;
clrBtn1.width = OSDMenuString2Components_2[u8CPIndex].u16Width;
clrBtn1.height = OSDMenuString2Components_2[u8CPIndex].u16Height;
switch (State)
{
case EN_CPSTATE_STATICS:
case EN_CPSTATE_SELECT:
u32FontColor=OSDMenuString2Components_2[u8CPIndex].u32FontColor_Select;
break;
case EN_CPSTATE_PATH:
u32FontColor=OSDMenuString2Components_2[u8CPIndex].u32FontColor_Path;
break;
case EN_CPSTATE_UNSELECT:
u32FontColor=OSDMenuString2Components_2[u8CPIndex].u32FontColor_UnSelect;
break;
case EN_CPSTATE_HIDE:
u32FontColor=OSDMenuString2Components_2[u8CPIndex].u32FontColor_Hide;
break;
}
clrBtn1.t_clr = u32FontColor;
clrBtn1.enTextAlign = OSDMenuString2Components_2[u8CPIndex].enTextAlign;
clrBtn1.Fontfmt.flag = (OSDMenuString2Components_2[u8CPIndex].u16FormatFlag & 0x7FFF);
#if (MAPP_UI_USE_STR_BITS_PROGRAM == 8)
if(OSDMenuString2Components_2[u8CPIndex].u16FormatFlag & _BIT15)
clrBtn1.bStringIndexWidth = CHAR_IDX_2BYTE;
else
clrBtn1.bStringIndexWidth = CHAR_IDX_1BYTE;
#else
clrBtn1.bStringIndexWidth = CHAR_IDX_2BYTE;
#endif
clrBtn1.Fontfmt.ifont_gap = OSDMenuString2Components_2[u8CPIndex].u8Gap;
//modify by Jason071031 for Ir crash
IeBuffer = IE;
IE=0;
pu8Str = MApp_UiMenu_Strcpy(OSDMenuString2Components_2[u8CPIndex].DisplayString(), clrBtn1.bStringIndexWidth);
IE=IeBuffer;
//pu8Str = MApp_UiMenu_Strcpy(OSDMenuString2Components_2[u8CPIndex].DisplayString(), clrBtn1.bStringIndexWidth);
//end by Jason071031
fHandle = MApp_UiMenu_GetCharacterTable( (U16*)pu8Str , Font[OSDMenuString2Components_2[u8CPIndex].FontHandleIndex].fHandle );
pu8Str = MApp_UiMenu_GetFirstCharater( (U16*)pu8Str );
msAPI_OSD_DrawText(fHandle, pu8Str, &clrBtn1);
}
void MApp_UiMenu_DrawIdleString0_2(U8 u8CPIndex, COMPONENT_STATE_TYPE State)
{
U32 u32FontColor;
U8 *pu8Str;
FONTHANDLE fHandle;
OSDDBG(printf("DrawIdleString0: %x\r\n", OSDMenuString0Components_2[u8CPIndex].u16FormatFlag));
clrBtn1.x = g_u16GroupXPos + OSDIdleString0Components_2[u8CPIndex].u16OffsetXPos;
clrBtn1.y = g_u16GroupYPos + OSDIdleString0Components_2[u8CPIndex].u16OffsetYPos;
clrBtn1.width = OSDIdleString0Components_2[u8CPIndex].u16Width;
clrBtn1.height = OSDIdleString0Components_2[u8CPIndex].u16Height;
switch (State)
{
case EN_CPSTATE_STATICS:
case EN_CPSTATE_SELECT:
u32FontColor=OSDIdleString0Components_2[u8CPIndex].u32FontColor_Select;
break;
case EN_CPSTATE_PATH:
u32FontColor=OSDIdleString0Components_2[u8CPIndex].u32FontColor_Path;
break;
case EN_CPSTATE_UNSELECT:
u32FontColor=OSDIdleString0Components_2[u8CPIndex].u32FontColor_UnSelect;
break;
case EN_CPSTATE_HIDE:
u32FontColor=OSDIdleString0Components_2[u8CPIndex].u32FontColor_Hide;
break;
}
clrBtn1.t_clr = u32FontColor;
clrBtn1.enTextAlign = OSDIdleString0Components_2[u8CPIndex].enTextAlign;
clrBtn1.Fontfmt.flag = (OSDIdleString0Components_2[u8CPIndex].u16FormatFlag & 0x7FFF);
#if (MAPP_UI_USE_STR_BITS_PROGRAM == 8)
if(OSDIdleString0Components_2[u8CPIndex].u16FormatFlag & _BIT15)
clrBtn1.bStringIndexWidth = CHAR_IDX_2BYTE;
else
clrBtn1.bStringIndexWidth = CHAR_IDX_1BYTE;
#else
clrBtn1.bStringIndexWidth = CHAR_IDX_2BYTE;
#endif
/*
#if (EPG_KOREAN_SUPPORT == TRUE)
if (u8CPIndex == EN_IDLESTRING0_INFO_EVENT_TITLE)
{
if (g_stCurEvent.fIsUTF16)
{
clrBtn1.bStringIndexWidth = CHAR_IDX_2BYTE;
}
else
{
clrBtn1.bStringIndexWidth = CHAR_IDX_1BYTE;
}
}
#endif
*/
clrBtn1.Fontfmt.ifont_gap = OSDIdleString0Components_2[u8CPIndex].u8Gap;
//modify by Jason071031 for Ir crash
IeBuffer = IE;
IE=0;
pu8Str = MApp_UiMenu_Strcpy(OSDIdleString0Components_2[u8CPIndex].DisplayString(), clrBtn1.bStringIndexWidth);
IE=IeBuffer;
//pu8Str = MApp_UiMenu_Strcpy(OSDIdleString0Components_2[u8CPIndex].DisplayString(), clrBtn1.bStringIndexWidth);
//end by Jason071031
fHandle = MApp_UiMenu_GetCharacterTable( (U16*)pu8Str , Font[OSDIdleString0Components_2[u8CPIndex].FontHandleIndex].fHandle );
pu8Str = MApp_UiMenu_GetFirstCharater( (U16*)pu8Str );
//#if (MAPP_UI_USE_STR_BITS_PROGRAM == 8)
// msAPI_OSD_DrawText(Font[MENU_LANGUAGE_FONT].fHandle, MApp_UiMenu_Strcpy(OSDIdleString0Components_2[u8CPIndex].DisplayString()), &clrBtn1);
//#else
msAPI_OSD_DrawText(fHandle, pu8Str, &clrBtn1);
//#endif
//msAPI_OSD_DrawText(Osdcp_fHandle[OSDIdleString0Components_2[u8CPIndex].FontHandleIndex], OSDIdleString0Components_2[u8CPIndex].DisplayString(), &clrBtn1);
}
void MApp_UiMenu_DrawMenuDynamicString_2(void)
{
//U32 u32FontColor;
U8 *pu8Str;
FONTHANDLE fHandle;
//OSDDBG(printf("DrawMenuDynamicString: %x\r\n", OSDMenuString0Components_2[u8CPIndex].u16FormatFlag));
clrBtn1.x =st_MenuDynamicStr.u16OffsetXPos;
clrBtn1.y =st_MenuDynamicStr.u16OffsetYPos;
clrBtn1.width = st_MenuDynamicStr.u16Width;
clrBtn1.height =st_MenuDynamicStr.u16Height;
//u32FontColor=0xff0000;
clrBtn1.t_clr = st_MenuDynamicStr.u32FontColor;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -