⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sublcdhistory.c

📁 MTK手机平台的MMI部分的源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
    if (redraw_in_small_screen_proceduer())
    {
        return;
    }
#endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */ 

    MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_SUBHIST_ADD_SUBLCD_HIST_WITHSCRID_HDLR, scrID));

    /* MTK added by JL for back history. */
    if (IsBackSubLCDHistory != TRUE)
    {
        FuncPtr CurrSubLCDEntryFn = CurrSubLCDHistory->entryFuncPtr;

        if (CurrSubLCDEntryFn != NULL)
        {
            SubLCDHistoryData[++NodeIndex].entryFuncPtr = CurrSubLCDEntryFn;
            SubLCDHistoryData[NodeIndex].scrnID = scrID;

            SubLCDHistoryData[NodeIndex].guiLen = 0;
            SubLCDHistoryData[NodeIndex].guiBuffer = NULL;
            if (pfnUnicodeStrlen((PS8) (CurrSubLCDHistory->guiBuffer)))
            {
                SubLCDHistoryData[NodeIndex].guiLen = MAX_GUI_BUFFER;
                SubLCDHistoryData[NodeIndex].guiBuffer = OslMalloc(MAX_GUI_BUFFER);
                memcpy(SubLCDHistoryData[NodeIndex].guiBuffer, CurrSubLCDHistory->guiBuffer, MAX_GUI_BUFFER);
            }
        }
    }
    IsBackSubLCDHistory = FALSE;
#endif /* __MMI_SUBLCD__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  SetSubLCDExitHandler
 * DESCRIPTION
 *  Set Exit handler for Current screen
 * PARAMETERS
 *  CurrSubLCDFn        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void SetSubLCDExitHandler(FuncPtr CurrSubLCDFn)
{
#ifdef __MMI_SUBLCD__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_SUBHIST_ADD_SUBLCD_EXIT_HDLR, CurrSubLCDFn));

    gCurrExitSubLCDFn = CurrSubLCDFn;
#endif /* __MMI_SUBLCD__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  SetSubLCDEntryHandler
 * DESCRIPTION
 *  Set Entry handler for Current screen
 * PARAMETERS
 *  CurrSubLCDFn                [IN]        
 *  CurrSubLCDEntryFn(?)        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void SetSubLCDEntryHandler(FuncPtr CurrSubLCDFn)
{
#ifdef __MMI_SUBLCD__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_SUBHIST_ADD_SUBLCD_ENTRY_HDLR, CurrSubLCDFn));

    gCurrEntrySubLCDFn = CurrSubLCDFn;
#endif /* __MMI_SUBLCD__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  DecrementSubLCD
 * DESCRIPTION
 *  decrement the global history index of sub-LCD
 *  
 *  decrement the global NodeIndex
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void DecrementSubLCD(void)
{
#ifdef __MMI_SUBLCD__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (NodeIndex >= 0)
    {
        if (SubLCDHistoryData[NodeIndex].guiBuffer)
        {
            OslMfree(SubLCDHistoryData[NodeIndex].guiBuffer);
        }
        memset(&SubLCDHistoryData[NodeIndex], 0, sizeof(SubLCDHistoryNode));
        NodeIndex--;
    }
#endif /* __MMI_SUBLCD__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  InitSubLCDHistory
 * DESCRIPTION
 *  De-intialize SubLCD Screen history
 * PARAMETERS
 *  sublcd_root_screen_cb_ptr       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void InitSubLCDHistory(SubLcdHistoryCBPtr sublcd_root_screen_cb_ptr)
{
#ifdef __MMI_SUBLCD__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
    if (redraw_in_small_screen_proceduer())
    {
        return;
    }
#endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */ 

    MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_SUBHIST_INIT, sublcd_root_screen_cb_ptr));

    ExecuteRootSubLcdHistoryScreenPtr = sublcd_root_screen_cb_ptr;
#endif /* __MMI_SUBLCD__ */ 

}


/*****************************************************************************
 * FUNCTION
 *  DinitSubLCDHistory
 * DESCRIPTION
 *  De-intialize SubLCD Screen history
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void DinitSubLCDHistory(void)
{
#ifdef __MMI_SUBLCD__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    signed char count;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
    if (redraw_in_small_screen_proceduer())
    {
        return;
    }
#endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */ 

    MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_SUBHIST_DEINIT));

    if (NodeIndex > -1)
    {
        for (count = NodeIndex; count >= 0; count--)
        {
            /* don't check the return value of delCBHandler */
            ExecHistoryScrnCallBackHandle_ex(NodeIndex, 0);
            DecrementSubLCD();
        }
        NodeIndex = -1;
    }
#endif /* __MMI_SUBLCD__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  ShowSubLCDScreen
 * DESCRIPTION
 *  Calls entry function of the specified screen on the
 *  sub-LCD screen
 * PARAMETERS
 *  SubLCDEntryFn       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void ShowSubLCDScreen(FuncPtr SubLCDEntryFn)
{
#ifdef __MMI_SUBLCD__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_SUBHIST_SHOW_SUBLCD_HDLR, SubLCDEntryFn));
    DisplaySubLCDScreen(SUB_LCD_DUMMY_SCRNID, SubLCDEntryFn, 0);

#if 0   /* when new sub LCD API are OK, remove the below code */
/* under construction !*/
/* under construction !*/
/* under construction !*/
#ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__//010706 small screen Calvin
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* 0 */ /* #if 0 */

#endif /* __MMI_SUBLCD__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  ForceSubLCDScreen
 * DESCRIPTION
 *  force to call entry function of a screen SubLCD Screen
 * PARAMETERS
 *  SubLCDEntryFn       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void ForceSubLCDScreen(FuncPtr SubLCDEntryFn)
{
#ifdef __MMI_SUBLCD__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_SUBHIST_FORCE_SUBLCD_HDLR, SubLCDEntryFn));
    DisplaySubLCDScreen(SUB_LCD_DUMMY_SCRNID, SubLCDEntryFn, 1);

#if 0   /* when new sub LCD API are OK, remove the below code */
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#if 0//111405 Calvin removed
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* 0 */ /* #if 0 */

#endif /* __MMI_SUBLCD__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  DisplaySubLCDScreen
 * DESCRIPTION
 *  Display a screen SubLCD Screen
 * PARAMETERS
 *  scrnId              [IN]        
 *  SubLCDEntryFn       [IN]        
 *  is_force            [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void DisplaySubLCDScreen(U16 scrnId, FuncPtr SubLCDEntryFn, MMI_BOOL is_force)
{
#ifdef __MMI_SUBLCD__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    MMI_BOOL flag = MMI_TRUE;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_SUBHIST_DISPLAY_SUBLCD_HDLR, SubLCDEntryFn, scrnId, is_force));
    if (!is_force)
    {
        /* refer ShowSubLCDScreen() */
    #ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__  /* 010706 small screen Calvin */
        if (is_redrawing_old_screens())
        {
            return;
        }
    #endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */ 
    }

    if (!is_force)
    {
        /* refer ShowSubLCDScreen() */
        if (IsMainLCDHistoryBack())
        {
            /* no need to display the sub LCD screen */
            flag = MMI_FALSE;
        }
    }

    if (flag)
    {
        gCurrTopSubLCDScrnID = scrnId;
        gCurrEntrySubLCDFn = SubLCDEntryFn;
        SubLCDEntryFn();
        gCurrExitSubLCDScrnID = scrnId;
    }
#endif /* __MMI_SUBLCD__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  GoBackSubLCDHistory
 * DESCRIPTION
 *  Go back to history On SubLCD Screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void GoBackSubLCDHistory(void)
{
#ifdef __MMI_SUBLCD__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U16 scrnId;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
    if (redraw_in_small_screen_proceduer())
    {
        return;
    }
#endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */ 

    MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_SUBHIST_GO_BACK_SUBLCD_HDLR));

    if (NodeIndex >= 0)
    {
        IsBackSubLCDHistory = TRUE;

        ExecTopScrnCallbackHandler_ex(0);
        scrnId = SubLCDHistoryData[NodeIndex].scrnID;
        if (SubLCDHistoryData[NodeIndex].entryFuncPtr)
        {
            gCurrTopSubLCDScrnID = scrnId;
            gCurrEntrySubLCDFn = SubLCDHistoryData[NodeIndex].entryFuncPtr;
            SubLCDHistoryData[NodeIndex].entryFuncPtr();
            gCurrExitSubLCDScrnID = scrnId;
        }

        if (SubLCDHistoryData[NodeIndex].scrnID == scrnId)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -