📄 uipen_hdr.c
字号:
break;
} // switch
} // End of TouchpadEventHandler
/**************************************************************
GLOBAL VARIABLE
**************************************************************/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
面板捷径座标 & 其Handler
Note:
厂商必须根据面板layout更改座标值
ex. (ProComp)
2 40 84 122 157
+-------+-------+-------+-------+ 170
| 0 | 2 | 4 | 6 |
+-------+-------+-------+-------+ 201
| 1 | 3 | 5 | 7 |
+-------+-------+-------+-------+ 229
ex. (PSC)
0 59 119 179 239
+---+---+---+---+---+---+---+---+ 320
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
+-------+-------+-------+-------+ 324
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define CUSTOM_AREA_NUMBER 6
static PF_VOID gaCustomAreaHandler[CUSTOM_AREA_NUMBER] =
{
NULL, NULL, NULL, NULL,
NULL, NULL
};
static WORD gwCustomArea[CUSTOM_AREA_NUMBER][4] =
{
#ifndef _EMU160x240_
#ifdef __WIN32__
{2, 162, 20, 180}, // help
{137, 162, 155, 180}, // WIN_RETURN
{2, 183, 20, 183+18}, // Menu
{137, 183, 155, 183+18}, // Search
{2, 205, 20, 205+18}, // Home
{137, 205, 155, 205+18}, // soft keyboard
#else
{2, 172, 20, 172+18}, // help
{137, 172, 155, 172+18}, // WIN_RETURN
{2, 193, 20, 193+18}, // Menu
{137, 193, 155, 193+18}, // Search
{2, 215, 20, 215+18}, // Home
{137, 215, 155, 215+18}, // soft keyboard
#endif
/*
{2, 161, 23, 181}, // help
{29, 161, 29+21, 181}, // WIN_RETURN
{56, 161, 56+21, 181}, // Menu
{83, 161, 83+21, 181}, // Search
{110, 161, 110+21, 181}, // Home
{137, 161, 137+21, 181}, // soft keyboard
*/
#else
{0, 245, 19, 264}, // help
{27, 245, 27+19, 264}, // WIN_RETURN
{54, 245, 54+19, 264}, // Menu
{81, 245, 81+19, 264}, // Search
{108, 245, 108+19, 264}, // Home
{135, 245, 135+19, 264}, // soft keyboard
#endif
};
/**************************************************************
FUNCTION :guiRegisterCustomAreaHandler
return 1 if sucess, else 0
- called by user thread
**************************************************************/
int guiRegisterCustomAreaHandler(int index, PF_VOID handler)
{
if( index>=0 && index<CUSTOM_AREA_NUMBER )
{
gaCustomAreaHandler[index] = handler ;
}
else
{
return 0 ;
}
return 1 ;
}
/**************************************************************
FUNCTION :guiExecCustomAreaHandler
- called by window thread
**************************************************************/
void guiExecCustomAreaHandler(int index)
{
if( index>=0 && index<CUSTOM_AREA_NUMBER && gaCustomAreaHandler[index]!=NULL )
{
gaCustomAreaHandler[index]() ;
}
}
/**************************************************************
FUNCTION :guiCustomAreaHandler
- called by ISR or window thread
**************************************************************/
int guiCustomAreaHandler(WORD msg, short x, short y)
{
int i, handled = 0;
// struct pdaMessage tempMessage;
if (msg == WIN_PEN_UP)
{
//if(x>=0&&x<=GUI_SCREEN_WIDTH-1&&y>=GUI_SCREEN_HEIGHT&&y<=GUI_TOUCH_HEIGHT-1)
if(!(x>=0&&x<=GUI_SCREEN_WIDTH-1&&y>=0&&y<=GUI_SCREEN_HEIGHT-1))
{
handled=1;
}
for (i=0;i<CUSTOM_AREA_NUMBER;i++) {
if ( x >= gwCustomArea[i][0] && x <= gwCustomArea[i][2] &&
y >= gwCustomArea[i][1] && y <= gwCustomArea[i][3] )
{
guiExecCustomAreaHandler(i) ;
// widget sound
//tong pdaPenBeep();
// handled = 1;
break;
}
}
}
return handled;
}
/**************************************************************
FUNCTION : guiRestoreCustomAreaCallback
- 恢复制定区预设之callback function
**************************************************************/
void _guiLaunchShortcut0(void)
{
//tong pdaSwitch2AppByShortcut(0);
}
void _guiLaunchShortcut2(void)
{
//tong pdaSwitch2AppByShortcut(2);
}
void _guiLaunchShortcut1(void)
{
//tong pdaSwitch2AppByShortcut(1);
}
void _guiLaunchShortcut3(void)
{
//tong pdaSwitch2AppByShortcut(3);
}
void _guiBack2PreWindow(void)
{
TGuiMessage msg ;
msg.handle = gpTopWindow->handle;
msg.messageType = WIN_RETURN ;
msg.x = 0;
msg.y = 0;
_guiEnqueue( gpTopWindow->messageQueue, &msg) ;
}
void _guiNotifyWakeupMenubar(void)
{
TGuiMessage msg ;
msg.handle = 0;
msg.messageType = WIN_WAKEUP_MENU ;
msg.x = 0;
msg.y = 0;
_guiEnqueue( gpTopWindow->messageQueue, &msg) ;
}
void guiOpenGSearch(void)
{
TGuiMessage message ;
TWindow *pmWin ;
message.messageType = PRG_MGR_GLOBAL_SEARCH;
// pmWin = (TWindow *)guiGetPrgMgrWinHandle();
// _guiEnqueue(pmWin->messageQueue, &message) ;
_guiEnqueue( gpTopWindow->messageQueue, &message) ;
}
void guiEL_OnOff(void)
{
#ifndef __WIN32__
if(backlightOn)
{
el_TurnOff();
//backlightOn = 0;
}
else
{
el_TurnOn();
//backlightOn = 1;
}
#endif
}
void guiWakeupHelp(void)
{
TGuiMessage message;
TWindow *pWin;
message.messageType=WIN_HELP;
_guiEnqueue(gpTopWindow->messageQueue,&message);
}
void guiPM_ToMainWnd(void)
{
TGuiMessage message ;
TWindow *pmWin ;
message.messageType = PRG_MGR_TO_MAIN_WND;
pmWin = (TWindow *)guiGetPrgMgrWinHandle();
_guiEnqueue(pmWin->messageQueue, &message) ;
}
void guiOpenKeyboard(void)
{
TGuiMessage message;
TWindow *pWin;
message.messageType = SYS_OPEN_KEYBOARD;
_guiEnqueue(gpTopWindow->messageQueue,&message);
}
void guiRestoreCustomAreaCallback(void)
{
// help
guiRegisterCustomAreaHandler(0, guiWakeupHelp) ;
// return
guiRegisterCustomAreaHandler(1, _guiBack2PreWindow) ;
//guiRegisterCustomAreaHandler(1, guiEL_OnOff) ;
// Menu
guiRegisterCustomAreaHandler(2, _guiNotifyWakeupMenubar) ;
// search
guiRegisterCustomAreaHandler(3, guiOpenGSearch) ;
//guiRegisterCustomAreaHandler(3, guiEL_OnOff) ;
// guiPM_ToMainWnd
guiRegisterCustomAreaHandler(4, guiPM_ToMainWnd) ;
// open keyboard
guiRegisterCustomAreaHandler(5, guiOpenKeyboard) ;
}
#ifdef PEN_HOOKER
/**************************************************************
FUNCTION: guiRegisterPenHooker
- register Pen Event Hooker handler
**************************************************************/
int guiRegisterPenHooker( int index, PF_PEN_HOOKER handler)
{
gfPen_Hooker = handler ;
return 1;
}
/**************************************************************
FUNCTION: _guiPenHookHandler
- Pen Event Hooker handler
**************************************************************/
static int _guiPenHookHandler(WORD msg, short x, short y)
{
int handled = 0 ;
if (gfPen_Hooker!=NULL)
{
handled = gfPen_Hooker(msg, x, y );
}
return handled ;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -