|
楼主 |
发表于 2010-5-27 16:23:14
|
显示全部楼层
就拿KEYPAD LOCK来说,我觉得应该作为一个独立的功能,单独成文件
一个头文件,一个源文件,你要调用直接INCLUDE头文件
我极力反对用EXTERN ,我觉得影响阅读。
下面是本人前几天修改的KEYPAD部分函数,基本样子出来了,还剩一个BUG。
//////////////////////////////////////////////////////////////////////////////////////////////////
void MApp_KeypadLock_LockedSrc_Entry(void)//EntryScrKeyPadLockMessage
{
g_keylock_context.gKeyPadLockFlag = 1;
EntryNewScreen(KPAD_SCR_LOCK_MESSAGE, MApp_KeypadLock_LockedSrc_Exit, NULL, NULL);
#if (ENABLE_KEYPAD_LOCK_KEYTONE)
playRequestedTone(SUCCESS_TONE);
#endif
#ifdef __MMI_TOUCH_SCREEN__
ShowCategory64Screen( TOUCH_SCR_LOCKED_MESSAGE_RUNNING_STR, IMG_KPAD_SCR_LOCKED_HELP_MESSAGE, NULL);
#else
ShowCategory64Screen( STR_KEYPADLOCK_KEYPAD_UNLOCKED, IMG_KPAD_SCR_LOCKED_HELP_MESSAGE, NULL);
#endif
#ifndef __MMI_KEYPADLOCK_WITH_KEYTONE__
mmi_frm_kbd_set_tone_state(MMI_KEY_TONE_DISABLED);
#endif
/* ÏÔʾ1Ãë,»Øµ½ Idle Screen */
StartTimer( TIMER_ID_KEYPAD_MESSAGE_LOCK_OR_NOT, KEYPAD_LOCK_STATUS_SCREEN_TIMEOUT, DisplayIdleScreen);
/* µ±Ç°²Ëµ¥µÄ°´¼ü²Ù×÷ */
SetGroupKeyHandler( DisplayIdleScreen, (PU16)PresentAllKeys, (U8)TOTAL_KEYS, (U16)KEY_EVENT_DOWN);
g_bEnableFullLight = 1;// ¸Õ¸ÕËøסµÄʱºò£¬È«ÁÁLCD
TurnOnBacklight(1);
GpioTurnOnKeypadLight();
}
void MApp_KeypadLock_LockedSrc_Exit(void)//ExitScrKeyPadLockMessage
{
StopTimer(TIMER_ID_KEYPAD_MESSAGE_LOCK_OR_NOT);
#if (ENABLE_KEYPAD_LOCK_KEYTONE)
stopRequestedTone(SUCCESS_TONE);
#endif
/* In ExitIdleScreen, screen saver timer will not stop when the keypad is
lock. If the popup is interruped, e.g., by a call, stop the timer. */
if (!CheckIsBackHistory())
{
StopTimer(SCREENSAVER_TIMER);
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////
void MApp_KeypadLock_UnLockedSrc_Entry(void)// EntryScrKeyPadUnlockMessage
{
g_keylock_context.gKeyPadLockFlag = 0;
EntryNewScreen(KPAD_SCR_UNLOCK_MESSAGE, MApp_KeypadLock_UnLockedSrc_Exit, NULL, NULL);
#if (ENABLE_KEYPAD_LOCK_KEYTONE)
playRequestedTone(SUCCESS_TONE);
#endif
#ifdef __MMI_TOUCH_SCREEN__
ShowCategory64Screen( TOUCH_SCR_UNLOCKED_MESSAGE_RUNNING_STR, IMG_KPAD_SCR_UNLOCKED_HELP_MESSAGE, NULL);
#else
ShowCategory64Screen( STR_KEYPADLOCK_KEYPAD_LOCKED, IMG_KPAD_SCR_UNLOCKED_HELP_MESSAGE, NULL);
#endif
/* ÏÔʾ1Ãë */
StartTimer( TIMER_ID_KEYPAD_MESSAGE_LOCK_OR_NOT, KEYPAD_LOCK_STATUS_SCREEN_TIMEOUT, GoBackHistory);
/* µ±Ç°²Ëµ¥µÄ°´¼ü²Ù×÷ */
SetGroupKeyHandler( GoBackHistory, (PU16)PresentAllKeys, (U8)TOTAL_KEYS, (U16)KEY_EVENT_DOWN);
TurnOnBacklight(1);
GpioTurnOnKeypadLight();
}
void MApp_KeypadLock_UnLockedSrc_Exit(void)// ExitScrKeyPadUnlockMessage
{
StopTimer(TIMER_ID_KEYPAD_MESSAGE_LOCK_OR_NOT);
#if (ENABLE_KEYPAD_LOCK_KEYTONE)
stopRequestedTone(SUCCESS_TONE);
#endif
} |
|