📄 guiapp.c
字号:
case KCODE_IR_LEFTRIGHT:
case KCODE_IR_MM_LEFTRIGHT:
break;
default:
break;
}
}
/****************************************************************************/
/* GUI Source Event handler. */
/****************************************************************************/
void guiApp_SourceHandler( GUI_SOURCEENUM sourcemsg )
{
GUIMSG msg;
DP_SOURCEDESC *srcDesc;
if( guiMode == GUI_MODE_LAMPOFF )
return;
if( guiStyle_IsMenuDisplayed( MENU_POWERDOWNMENU ) == TRUE )
return;
switch( sourcemsg )
{
case GUI_SOURCE_LOST:
if( guiStyle_IsOsdDisplayed() == TRUE )
{
guiStyle_Exit();
}
break;
case GUI_SOURCE_OOR:
if( guiStyle_IsOsdDisplayed() == FALSE )
{
osdTimeout = 0; /* display forever */
guiStyle_StartMenu( MENU_SOURCEOUTOFRANGEMENU, 0 );
}
else if( guiStyle_IsMenuDisplayed( MENU_SOURCESTATUSMENU ) == TRUE )
{
guiStyle_Exit();
osdTimeout = 0; /* display forever */
guiStyle_StartMenu( MENU_SOURCEOUTOFRANGEMENU, 0 );
}
break;
case GUI_SOURCE_TPG:
if( guiStyle_IsMenuDisplayed( MENU_MAINMENU ) == TRUE)
{
guiStyle_Reload();
}
break;
case GUI_SOURCE_FOUND:
if( guiStyle_IsMenuDisplayed( MENU_MAINMENU ) == TRUE)
{
guiStyle_Reload();
break;
}
/* if main menu not displayed, send message to status window so do not break */
case GUI_SOURCE_VGA:
case GUI_SOURCE_DVI:
case GUI_SOURCE_COMPONENT:
case GUI_SOURCE_COMPOSITE:
case GUI_SOURCE_SVIDEO:
case GUI_SOURCE_SEARCHING:
msg.type = GUIMSG_VALUE;
msg.data = &sourcemsg;
if( guiStyle_IsOsdDisplayed() == FALSE )
{
osdTimeout = 10000; /* 10 second timeout */
guiStyle_StartMenu( MENU_SOURCESTATUSMENU, &msg );
/* because the menu is closed, we need to re-initialize the port setting */
datapath_GetSourceDesc( &srcDesc );
msg.type = GUIMSG_VALUE;
msg.data = &srcDesc->connector;
guiStyle_SendMenuMsg( MENU_SOURCESTATUSMENU, &msg );
}
else if( guiStyle_IsMenuDisplayed( MENU_SOURCESTATUSMENU ) == TRUE )
{
osdTimeout = 10000; /* 10 second timeout */
guiStyle_SendMenuMsg( MENU_SOURCESTATUSMENU, &msg );
guiStyle_Redraw();
}
break;
}
}
/****************************************************************************/
/* GUI Screen Capture Status Event handler. */
/****************************************************************************/
void guiApp_ScreenCaptureMessageHandler( GUISCREENCAPTUREENUM screenCaptureMsg )
{
GUIMSG msg;
if( guiMode == GUI_MODE_LAMPOFF )
return;
switch( screenCaptureMsg )
{
case GUI_SCREENCAPTURESTART:
if( guiStyle_IsOsdDisplayed() == TRUE )
{
guiStyle_Exit();
}
msg.type = GUIMSG_VALUE;
msg.data = &screenCaptureMsg;
guiStyle_StartMenu( MENU_SCREENCAPTUREPROGRESSMENU, &msg );
break;
case GUI_SCREENCAPTUREERROR:
msg.type = GUIMSG_VALUE;
msg.data = &screenCaptureMsg;
osdTimeout = 2000; /* 2 second timeout */
if( guiStyle_IsMenuDisplayed( MENU_SCREENCAPTUREPROGRESSMENU ) == TRUE )
guiStyle_SendMenuMsg( MENU_SCREENCAPTUREPROGRESSMENU, &msg );
else
guiStyle_StartMenu( MENU_SCREENCAPTUREPROGRESSMENU, &msg );
break;
case GUI_SCREENCAPTURESUCCESS:
msg.type = GUIMSG_VALUE;
msg.data = &screenCaptureMsg;
osdTimeout = 2000; /* 2 second timeout */
if( guiStyle_IsMenuDisplayed( MENU_SCREENCAPTUREPROGRESSMENU ) == TRUE )
guiStyle_SendMenuMsg( MENU_SCREENCAPTUREPROGRESSMENU, &msg );
else
guiStyle_StartMenu( MENU_SCREENCAPTUREPROGRESSMENU, &msg );
break;
}
}
/****************************************************************************/
/* GUI Warning Event handler. */
/****************************************************************************/
void guiApp_WarningHandler( GUI_WARNINGENUM warningmsg )
{
GUIMSG msg;
if( guiMode == GUI_MODE_LAMPOFF )
return;
if( guiStyle_IsMenuDisplayed( MENU_POWERDOWNMENU ) == TRUE )
return;
/* for any message, set the default timeout to 10 seconds */
osdTimeout = 10000;
if( warningmsg < GUI_WARN_LAST )
{
msg.type = GUIMSG_VALUE;
msg.data = &warningmsg;
guiStyle_Exit();
guiStyle_StartMenu( MENU_WARNINGDIALOG, &msg );
}
}
void guiApp_OnOsdStart( void )
{
guiApp_SetMenuMode( TRUE );
dbmsg_ftrace( DBM_GUI, "gui: OnOsdStart\r\n");
keypad_menuMode( TRUE );
rpmouse_setkeymode(TRUE);
guiDisplayedFlag = TRUE;
}
static void guiApp_OnOsdClose( void )
{
guiApp_SetMenuMode( FALSE );
osdTimeout = 0;
dbmsg_ftrace( DBM_GUI, "gui: executing OnOSDClose\r\n");
keypad_menuMode( FALSE );
rpmouse_setkeymode(FALSE);
guiDisplayedFlag = FALSE;
}
/****************************************************************************/
/* Returns indication GUI displayed/not-displayed state. */
/****************************************************************************/
BOOL guiApp_IsGUIDisplayed( void )
{
return guiDisplayedFlag;
}
void guiApp_SetMenuMode( BOOL mode )
{
menuMode = mode;
}
/****************************************************************************/
/* Functions to handle DDC/CI requirements regarding local changing of */
/* variables. Application must track whether settings used by DDC/CI have */
/* changed */
/****************************************************************************/
void guiApp_ResetDDCCISettingsChanged( void )
{
guiApp_SetDDCCISettingsChanged( FALSE );
}
void guiApp_SetDDCCISettingsChanged( BOOL changed )
{
DDCCISettingsChanged = changed;
}
BOOL guiApp_GetDDCCISettingsChanged( void )
{
return DDCCISettingsChanged;
}
/****************************************************************************/
/* GUI menu positioning handler. Consolidate all menu position setting */
/* logic. SetMenuPosition should be called using positioning for a LTR */
/* language. This function will translate to RTL if necessary */
/****************************************************************************/
int08 guiApp_SetMenuPosition( int16 menuId, GUIMENUPOSITION position )
{
uint16 height, width;
OSDACTVREGION display;
int08 RTL;
int16 language;
/* handle case of Arabic by switching menu positions right to left */
language = OSD_GetLanguage();
RTL = OSD_GetLanguageDirection( language );
if( RTL )
{
switch( position )
{
case GUI_TOPLEFT:
position = GUI_TOPRIGHT;
break;
case GUI_TOPRIGHT:
position = GUI_TOPLEFT;
break;
case GUI_BOTTOMLEFT:
position = GUI_BOTTOMRIGHT;
break;
case GUI_BOTTOMRIGHT:
position = GUI_BOTTOMLEFT;
break;
default:
break;
}
}
switch( position )
{
case GUI_TOPLEFT:
/* place the menu in the top-left of the screen */
if( OSD_GetActiveRegion(&display) == PASS )
{
OSD_SetMenuPos( menuId, display.TopLeft.Y, display.TopLeft.X );
}
break;
case GUI_TOPRIGHT:
/* place the menu in the top-right of the screen */
if( OSD_GetMenuSize( menuId, &height, &width ) == PASS && OSD_GetActiveRegion(&display) == PASS )
{
OSD_SetMenuPos( menuId, display.TopRight.Y, display.TopRight.X - width );
}
break;
case GUI_CENTER:
/* place the menu in the center of the screen */
if( OSD_GetMenuSize( menuId, &height, &width ) == PASS && OSD_GetActiveRegion(&display) == PASS )
{
OSD_SetMenuPos( menuId, display.TopLeft.Y + ( display.BottomLeft.Y - display.TopLeft.Y ) / 2 - height / 2,
display.TopLeft.X + ( display.TopRight.X - display.TopLeft.X ) / 2 - width / 2 );
}
break;
case GUI_BOTTOMLEFT:
/* place the menu in the bottom-left of the screen */
if( OSD_GetMenuSize( menuId, &height, &width ) == PASS && OSD_GetActiveRegion(&display) == PASS )
{
OSD_SetMenuPos( menuId, display.BottomLeft.Y - height, display.BottomLeft.X );
}
break;
case GUI_BOTTOMCENTER:
/* place the menu in the bottom-center of the screen */
if( OSD_GetMenuSize( menuId, &height, &width ) == PASS && OSD_GetActiveRegion(&display) == PASS )
{
OSD_SetMenuPos( menuId, display.BottomLeft.Y - height, display.BottomLeft.X +
(display.BottomRight.X - display.BottomLeft.X ) / 2 - width / 2 );
}
break;
case GUI_BOTTOMRIGHT:
/* place the menu in the bottom-right of the screen */
if( OSD_GetMenuSize( menuId, &height, &width ) == PASS && OSD_GetActiveRegion(&display) == PASS )
{
OSD_SetMenuPos( menuId, display.BottomRight.Y - height, display.BottomRight.X - width );
}
break;
}
return PASS;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -