MTK platform learning-Relationship Between History Management Mechanism and EntryNewScreen Function

Source: Internet
Author: User

Briefly analyze the relationship between History management mechanism and EntryNewScreen

1. Global variables related to the EntryNewScreen function:
CurrEntryFuncPtr,
CurrExitScrnID, currTopScrnID,
CurrExitFuncPtr

2. Partial procedures of the EntryNewScreen function:
Step 1: Save the new screen ID (the first parameter of the function) --> currTopScrnID;
Step 2: Call ExecuteCurrExitHandler;
Step 3: Save the new screen ID --> currExitScrnID;
Step 4: Call SetGenericExitHandler;
Step 5 :......
......

3. Analyze ExecuteCurrExitHandler
Function prototype: void ExecuteCurrExitHandler (void );
A. the main process of this function is to call ExecuteCurrExitHandler_Ext and ClearInputEventHandler in sequence.
B. Analyze the functions of the ExecuteCurrExitHandler_Ext Function
Function prototype: void ExecuteCurrExitHandler_Ext (void );
Function: This function is used for executes current exit func handler without clear keys;
Main functions (pseudo-code representation ):
Step 1: if (currEntryFuncPtr | currExitFuncPtr)
{
Clear all interrupt event handles;
}
Step 2: if (currEntryFuncPtr)
{
ExitMyAppMenu (EntryNewMenu, SCR_ID_MYAPP_NEW );
// Import the currExitScrnID and currEntryFuncPtr recorded in the last call of EntryNewScreen into the stack
}
Step 3: if (currExitFuncPtr)
{
Mmu_frm_execute_scrn_exit_handler = MMI_TURE;
(* CurrExitFuncPtr )();
Mmu_frm_execute_scrn_exit_handler = MMI_FALSE;
}
Step 4: currEntryFuncPtr = currExitFuncPtr = NULL;
Step 5: exit the function from the DM screen template;
Step 6 :......
......

4. Analyze SetGenericExitHandler
Function prototype: void SetGenericExitHandler (2010scrnid, FuncPtr exitFuncPtr, FuncPtr entryFuncPtr );
Function: currexitscrnid <-- scrnid;
Currexitfuncptr <-- exitfuncptr;
Currentryfuncptr <-- entryfuncptr;
Note: several parameters of entrynewscreen are passed to global variables, which will be called the next time entrynewscreen is called.

5. involved exit functions:
Static void exitmyappmenu (void * entry_screen_pfunc, 2010screen_id)
{
History currhistory;
S16 nhistory = 0;

Currhistory. scrnid = screen_id;
Currhistory. entryfuncptr = entry_screen_pfunc;
PfnUnicodeStrcpy (S8 *) currHistory. inputBuffer, (S8 *) & nHistory );
GetCategoryHistory (currHistory. guiBuffer );
AddHistory (currHistory );
}

6. Summary:
The EntryNewScreen function first records the currEntryFuncPt recorded during the last execution of EntryNewScreen. The currExitScrnID is recorded into the stack using the History structure as the carrier;
Then the exit function is executed. Finally, the scrnID, exitFuncPtr, and entryFuncPtr in this window are saved to global variables, which will be used for the next call of EntryNewScreen.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.