📄 winpicinfobar.c
字号:
/*****************************************************************
** **
** Copyright (C) 2004 Amlogic,Inc. **
** All rights reserved **
** Filename : WinPicInfoBar.c /Project:AVOS **
** Revision : 1.0 **
** **
*****************************************************************/
#include "../menu.h"
#include "WinPicInfoBarEvent.h"
INT32S WinPicInfoBarMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
switch( msg_type){
case WM_SHOWWINDOW:
return WinPicInfoBarOnShow(hwnd, lpParam) ;
}
return 0 ;
}
void SetWinPicInfoBarPalette(void)
{
YUVENTRY mask_para[4] = {0,2730,2730,4095};
AWSetAlphaMask(0,4, mask_para);
YUVENTRY palette_para[16] = {0x8000 | 16392,0x8000 | 17928,0x8000 | 18168,0x8000 | 20176,16280,3211,16088,16040,16024,15880,15208,15720,15016,15064,15304,15144};
AWSetPalette(0,16, palette_para);
return ;
}
void SetWinPicInfoBarPos(HWND* pControl, INT8U CurOsdSize)
{
switch(CurOsdSize){
case STANDARD:
#ifdef LCD_320X234
RECT StandardWindowRect = {8,4,300,36};
#else
RECT StandardWindowRect = {80,4,300,36};
#endif
pControl->winrect = StandardWindowRect;
#ifdef LCD_320X234
CREATEWINDOWPARAM StandardWindowPara = {1,{{8,4,300,36},{0,0,0,0},{0,0,0,0},{0,0,0,0}},{PF_PALETTE_256,0,0,0},SetWinPicInfoBarPalette};
#else
CREATEWINDOWPARAM StandardWindowPara = {1,{{80,4,300,36},{0,0,0,0},{0,0,0,0},{0,0,0,0}},{PF_PALETTE_256,0,0,0},SetWinPicInfoBarPalette};
#endif
AWSendMessage(pControl, WM_WINDOW_RESET_DRAW_AREA, (INT32S)&StandardWindowPara);
break ;
}//end of switch
return;
}
HWND *CreateControlWinPicInfoBar(HWND* pParent)
{
HWND* pNewControl;
#ifdef LCD_320X234
CREATEWINDOWPARAM window_para = {1,{{8,4,300,36},{0,0,0,0},{0,0,0,0},{0,0,0,0}},{PF_PALETTE_256,0,0,0},SetWinPicInfoBarPalette};
//Create Menu Window -- 1
pNewControl = AWCreateWinControl("TWindow","WinPicInfoBar",WS_OVERLAPPEDWINDOW,
8,4,300,36,NULL, (INT32S)&window_para,WinPicInfoBarMsgProc) ;
#else
CREATEWINDOWPARAM window_para = {1,{{80,4,300,36},{0,0,0,0},{0,0,0,0},{0,0,0,0}},{PF_PALETTE_256,0,0,0},SetWinPicInfoBarPalette};
//Create Menu Window -- 1
pNewControl = AWCreateWinControl("TWindow","WinPicInfoBar",WS_OVERLAPPEDWINDOW,
80,4,300,36,NULL, (INT32S)&window_para,WinPicInfoBarMsgProc) ;
#endif
pNewControl->win_id = 0 ;
return pNewControl;
}
void SetPicInfoBarPos(HWND* pControl, INT8U CurOsdSize)
{
int iLoop;
switch(CurOsdSize){
case STANDARD:
pControl->winrect.top = pControl->parent->winrect.top + 0;
pControl->winrect.left = pControl->parent->winrect.left + 0;
pControl->winrect.width = 300;
pControl->winrect.height = 36;
pControl->draw_info_num = 1;
RECT StandardDrawRect[1] = {
{pControl->winrect.left + 0,pControl->winrect.top + 0,300,36},
};
for(iLoop=0; iLoop < 1; iLoop++)
memcpy(&(pControl->draw_info[iLoop]), &StandardDrawRect[iLoop], sizeof(RECT));
break ;
}//end of switch
return;
}
INT32S PicInfoBarMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
switch( msg_type){
case WM_SHOWWINDOW:
return PicInfoBarOnShow(hwnd, lpParam) ;
case WM_KEYDOWN:
return PicInfoBarOnKeyPress(hwnd, lpParam) ;
default:
return PicInfoBarOnOtherEvent(hwnd, msg_type, lpParam) ;
}
return 0 ;
}
HWND *CreateControlPicInfoBar(HWND *pParent)
{
//Create Control -- PicInfoBar
HWND *pNewControl = AWCreateWinControl("TControl","PicInfoBar",(WS_CHILDWINDOW | WS_CHILDWINDOW),
0,0,300,36,pParent,0,PicInfoBarMsgProc) ;
pNewControl->win_id = 2 ;
pNewControl->draw_info_num = 1;
pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
DRAWINFO DrawDatas[1] = {
{0,0,0,0,(INT32U)ICON_PHOTO,DT_RLE_BMP_DATA}};
memcpy(pNewControl->draw_info, DrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
return pNewControl;
}
HWND* CreateMenuWinPicInfoBar(void)
{
HWND *pNewControl ;
TWINDOWS *pWin;
HWND *pWinPicInfoBar = CreateControlWinPicInfoBar(NULL);
SetWinPicInfoBarPos(pWinPicInfoBar,CurrentOsdSize);
pNewControl= CreateControlPicInfoBar(pWinPicInfoBar);
SetPicInfoBarPos(pNewControl,CurrentOsdSize);
pWin = (TWINDOWS *)pWinPicInfoBar;
pWin->pFocusControl = AWFindWinCtrlByName("PicInfoBar");
return pWinPicInfoBar;
}
void WinResetWinPicInfoBarControlsPos(HWND *pControl, INT8U CurOsdSize)
{
switch(pControl->win_id){
case 0://WinPicInfoBar
SetWinPicInfoBarPos(pControl,CurOsdSize) ;
break ;
case 2://PicInfoBar
SetPicInfoBarPos(pControl,CurOsdSize) ;
break ;
}//end of switch
}
void WinResetWinPicInfoBarPos(HWND *pControl, INT8U CurOsdSize)
{
HWND *pChildControl;
if(pControl == NULL)
pControl = AWFindWinCtrlByName("WinPicInfoBar");
if(pControl == NULL) return ;
WinResetWinPicInfoBarControlsPos(pControl, CurOsdSize) ;
pChildControl = pControl->children ;
while(pChildControl != NULL){
WinResetWinPicInfoBarPos(pChildControl, CurOsdSize) ;
pChildControl = pChildControl->siblings ;
}
return ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -