📄 events.c
字号:
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_SETPTO_HDLR, eventID, funcPtr, usedProtocolEvent,
maxProtocolEvent));
}
/*****************************************************************************
* FUNCTION
* ClearProtocolEventHandler
* DESCRIPTION
* This is used to clear protocol event handler
* PARAMETERS
* eventID [IN] Clear the handler of event ID.
* RETURNS
* void
*****************************************************************************/
void ClearProtocolEventHandler(U16 eventID)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_CLRPTO_HDLR, eventID));
SetProtocolEventHandler(NULL, eventID);
}
/*****************************************************************************
* FUNCTION
* ClearAllProtocolEventHandler
* DESCRIPTION
* This is used to clear all the protocol event handlers
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void ClearAllProtocolEventHandler(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_CLRALLPTO_HDLR));
memset(protocolEventHandler, 0, sizeof(PseventInfo)* maxProtocolEvent);
usedProtocolEvent = 0;
SetProtocolEventHandler(mmi_proc_inject_string, MSG_ID_TST_INJECT_STRING);
}
/*****************************************************************************
* FUNCTION
* SetEntryHandler
* DESCRIPTION
* This is used to sets current screen entry handlers
* PARAMETERS
* scrnID [IN] The current screen ID.
* entryFuncPtr [IN] The entry handler of the current screen.
* RETURNS
* void
*****************************************************************************/
void SetEntryHandler(U16 scrnID, FuncPtr entryFuncPtr)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_SETENTRY_HDLR, scrnID));
currEntryFuncPtr = entryFuncPtr;
}
/*****************************************************************************
* FUNCTION
* ClearEntryHandler
* DESCRIPTION
* This is used to clears current screen e1ntry handlers
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void ClearEntryHandler(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_CLRENTRY_HDLR));
currEntryFuncPtr = NULL;
}
/*****************************************************************************
* FUNCTION
* SetGenericExitHandler
* DESCRIPTION
* Generic function to set exit screen handler.
* Store current screen id, exit function, and entry function.
* PARAMETERS
* scrnID [IN] Screen ID
* exitFuncPtr [IN] Exit function pointer
* entryFuncPtr [IN] Entry function pointer
* RETURNS
* void
*****************************************************************************/
static void SetGenericExitHandler(U16 scrnID, FuncPtr exitFuncPtr, FuncPtr entryFuncPtr)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_SETGEN_EXIT_HDLR, scrnID));
currExitScrnID = scrnID;
currExitFuncPtr = exitFuncPtr;
currEntryFuncPtr = entryFuncPtr;
}
/*****************************************************************************
* FUNCTION
* GenericExitInlineScreen
* DESCRIPTION
* This function is the general inline screen's exit handler. If the previous
* screen is the inline editor screen and needs to add in the history, the
* framework calls this function to execute the general exit handler first,
* then tries to call its exit handler.
* PARAMETERS
* scrnID [IN] The specified screen ID will exit.
* entryFuncPtr [IN] The entry handler of the specified screen.
* The specified screen should be inline editor
* screen.
* RETURNS
* void
*****************************************************************************/
void GenericExitInlineScreen(U16 scrnID, FuncPtr entryFuncPtr)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
history h;
U16 inputBufferSize;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
CloseCategory57Screen();
h.scrnID = scrnID;
h.entryFuncPtr = entryFuncPtr;
GetCategoryHistory(h.guiBuffer);
inputBufferSize = (U16) GetCategory57DataSize();
GetCategory57Data((U8*) h.inputBuffer);
AddNHistory(h, inputBufferSize);
}
/*****************************************************************************
* FUNCTION
* GenericExitScreen
* DESCRIPTION
* This function is the general screen's exit handler. If the previous screen
* is the normal screen (not inline editor screen) and needs to add in the
* history, the framework calls this function to execute the general exit
* handler first, then tries to call its exit handler.
* PARAMETERS
* scrnID [IN] The specified screen ID will exit.
* entryFuncPtr [IN] The entry handler of the specified screen.
* The specified screen without inputBuffer[ ].
* RETURNS
* void
*****************************************************************************/
void GenericExitScreen(U16 scrnID, FuncPtr entryFuncPtr)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
history h;
U16 nHistory = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_EXEGEN_EXIT_HDLR, scrnID));
h.scrnID = scrnID;
h.entryFuncPtr = entryFuncPtr;
UCS2Strcpy((S8*) h.inputBuffer, (S8*) & nHistory);
GetCategoryHistory(h.guiBuffer);
AddHistory(h);
/* mini_tab_bar */
#ifdef __MMI_WGUI_MINI_TAB_BAR__
wgui_disable_mini_tab_bar();
#endif
}
/*****************************************************************************
* FUNCTION
* GetExitScrnID
* DESCRIPTION
* This function is used for query the screen ID that will be exited.
* PARAMETERS
* void
* RETURNS
* Return the screen ID that will be exited.
*****************************************************************************/
U16 GetExitScrnID(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_GETGEN_EXIT_HDLR,currExitScrnID));
return currExitScrnID;
}
/*****************************************************************************
* FUNCTION
* GetExitScrnID_r
* DESCRIPTION
* Thead-safe version of GetExitScrnID()
* PARAMETERS
* void
* RETURNS
* Current screen ID
*****************************************************************************/
U16 GetExitScrnID_r(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* This function should be kept as simple as possible. MMI_TRACE() cannot be used */
return currExitScrnID;
}
/*****************************************************************************
* FUNCTION
* ClearExitHandler
* DESCRIPTION
* This function is used for special scenarios. If the applications enter
* the special screen A and want to go back to the idle screen directly
* after exiting the screen A, they could use this function to clear the
* pervious screen's exit hanler before enter the special screen.
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void ClearExitHandler(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_CLREXIT_HDLR));
currExitScrnID = 0;
currExitFuncPtr = NULL;
currEntryFuncPtr = NULL;
}
/*****************************************************************************
* FUNCTION
* MaskItems
* DESCRIPTION
* This function is used for gets the items from the item array using the
* given mask. The data type of item should U16.
* PARAMETERS
* maskList [IN/OUT] The array of items.
* noOfItems [IN] The number of the list.
* maskingWord [IN] the mask word.
* RETURNS
* The number of item be marked.
*****************************************************************************/
U8 MaskItems(U16 *maskList, U8 noOfItems, U32 maskingWord)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U32 count = 0, i;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
for (i = 0; i < noOfItems; i++)
if (IsBitSet(maskingWord, i))
{
maskList[count++] = maskList[i];
}
return (U8) count;
}
/*****************************************************************************
* FUNCTION
* MaskItemsU8
* DESCRIPTION
* This function is used for gets the items from the item array using the
* given mask. The data type of item should U8.
* PARAMETERS
* maskList [IN/OUT] The array of items.
* noOfItems [IN] The number of the list.
* maskingWord [IN] the mask word.
* RETURNS
* The number of item be marked.
*****************************************************************************/
U8 MaskItemsU8(U8 *maskList, U8 noOfItems, U32 maskingWord)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U32 count = 0, i;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
for (i = 0; i < noOfItems; i++)
if (IsBitSet(maskingWord, i))
{
maskList[count++] = maskList[i];
}
return (U8) count;
}
/*****************************************************************************
* FUNCTION
* MaskStringItems
* DESCRIPTION
* This function is used for gets the strings from the string array
* using the given mask. The data type of item should the pointer to U8.
* PARAMETERS
* maskList [IN/OUT] The array of items.
* noOfItems [IN] The number of the list.
* maskingWord [IN] the mask word.
* RETURNS
* U8
*****************************************************************************/
U8 MaskStringItems(U8 **maskList, U8 noOfItems, U32 maskingWord)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U32 count = 0, i;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
for (i = 0; i < noOfItems; i++)
if (IsBitSet(maskingWord, i))
{
maskList[count++] = maskList[
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -