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

📄 mainmenu.c

📁 MTK主菜单,入口函数,显示,gui,按键的处理
💻 C
📖 第 1 页 / 共 5 页
字号:
    attributes = GetDispAttributeOfItem(IDLE_SCREEN_MENU_ID);

#ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
    GetSequenceItemIds(IDLE_SCREEN_MENU_ID, nMenuItemList);
#endif 
    /* MTK Leo add, for mini_tab_bar */
#ifdef __MMI_WGUI_MINI_TAB_BAR__
    wgui_setup_mini_tab_bar(
        MMI_content_x,
        MMI_content_y,
        MMI_content_width,
        20,
        UI_COLOR_BLACK,
        UI_COLOR_RED,
        UI_COLOR_GREY,
        9 /* n_items */ ,
        GetSeqItems(IDLE_SCREEN_MENU_ID),
        NULL);
    wgui_mini_tab_bar_set_flag_on(0x00000002 /* WGUI_MINI_TAB_BAR_IN_PARENT */ );
#endif /* __MMI_WGUI_MINI_TAB_BAR__ */ 
    /* MTK Leo end */

    /* RegisterHighlightHandler(main_menu_custom_highlight_handler); */

#ifdef __MMI_DEFAULT_MAIN_MENU_HIGHLIGHT_CENTER__
    HighlightMenu = (n_items - 1) >> 1;
#endif /* __MMI_DEFAULT_MAIN_MENU_HIGHLIGHT_CENTER__ */ 

#ifdef __MMI_DEFAULT_MAIN_MENU_HIGHLIGHT_MESSAGE__
    /* Specify the highlight item to the message */
    HighlightMenu = (U8)GetChildMenuIDIndexByParentMenuID(IDLE_SCREEN_MENU_ID, MAIN_MENU_MESSAGES_MENUID);
#endif /* __MMI_DEFAULT_MAIN_MENU_HIGHLIGHT_MESSAGE__ */ 

#ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
    menu_style = PhnsetGetMainMenuStyle();
    switch (menu_style)
    {
    #ifdef __MMI_MAINMENU_MATRIX_SUPPORT__  /* 071705 Calvin added */
        case PHNSET_MAINMENU_STYLE_MATRIX:
            attributes = MATRIX_MENU;
            for (i = 0; i < (MAIN_MENU_MATRIX_ICON_IMGBASE_MAX - MAIN_MENU_MATRIX_ICON_IMGBASE); i++)
            {
                /* U16 a = mm_iconIDs[i];
                   U16 b = MAIN_MENU_ICON_IMGBASE;
                   U16 c = MAIN_MENU_MATRIX_ICON_IMGBASE;
                   U16 d = ( mm_iconIDs[i] -MAIN_MENU_ICON_IMGBASE  );
                   U16 e = MAIN_MENU_MATRIX_ICON_IMGBASE+( mm_iconIDs[i] -MAIN_MENU_ICON_IMGBASE  );
                   printf( "%d %d %d %d %d ", a, b, c, d, e ); */
                mm_iconIDs_display[i] = MAIN_MENU_MATRIX_ICON_IMGBASE + (mm_iconIDs[i] - MAIN_MENU_ICON_IMGBASE);
            }
            iconList = mm_iconIDs_display;
            break;
    #endif /* __MMI_MAINMENU_MATRIX_SUPPORT__ */ 

        #ifdef __MMI_MAINMENU_PAGE_SUPPORT__    /* 071705 Calvin added */
        case PHNSET_MAINMENU_STYLE_PAGE:
            attributes = PAGE_MENU;
            for (i = 0; i < (MAIN_MENU_PAGE_ICON_IMGBASE_MAX - MAIN_MENU_PAGE_ICON_IMGBASE); i++)
            {
                mm_iconIDs_display[i] = MAIN_MENU_PAGE_ICON_IMGBASE + (mm_iconIDs[i] - MAIN_MENU_ICON_IMGBASE);
            }
            iconList = mm_iconIDs_display;
            break;
        #endif /* __MMI_MAINMENU_PAGE_SUPPORT__ */ 

        #ifdef __MMI_MAINMENU_LIST_SUPPORT__    /* 071705 Calvin added */
        case PHNSET_MAINMENU_STYLE_LIST:
            attributes = LIST_MENU;
            for (i = 0; i < (MAIN_MENU_LIST_ICON_IMGBASE_MAX - MAIN_MENU_LIST_ICON_IMGBASE); i++)
            {
                mm_iconIDs_display[i] = MAIN_MENU_LIST_ICON_IMGBASE + (mm_iconIDs[i] - MAIN_MENU_ICON_IMGBASE);
            }
            iconList = mm_iconIDs_display;
            break;
        #endif /* __MMI_MAINMENU_LIST_SUPPORT__ */ 

        #ifdef __MMI_MAINMENU_CIRCULAR_SUPPORT__        /* 071705 Calvin modified */
        case PHNSET_MAINMENU_STYLE_CIRCULE:
            attributes = CIRCULAR_3D_MENU;
            for (i = 0; i < (MAIN_MENU_CIRCULAR_ICON_IMGBASE_MAX - MAIN_MENU_CIRCULAR_ICON_IMGBASE); i++)
            {
                mm_iconIDs_display[i] = MAIN_MENU_CIRCULAR_ICON_IMGBASE + (mm_iconIDs[i] - MAIN_MENU_ICON_IMGBASE);
            }
            iconList = mm_iconIDs_display;
            break;
        #endif /* __MMI_MAINMENU_CIRCULAR_SUPPORT__ */ 

        #ifdef __MMI_MAINMENU_ROTATE_SUPPORT__
        case PHNSET_MAINMENU_STYLE_ROTATE:
            attributes = ROTATE_MENU;
            for (i = 0; i < (MAIN_MENU_ROTATE_ICON_IMGBASE_MAX - MAIN_MENU_ROTATE_ICON_IMGBASE); i++)
            {
                mm_iconIDs_display[i] = MAIN_MENU_ROTATE_ICON_IMGBASE + (mm_iconIDs[i] - MAIN_MENU_ICON_IMGBASE);
            }
            iconList = mm_iconIDs_display;
            break;
        #endif /* __MMI_MAINMENU_ROTATE_SUPPORT__ */ 

            /* PMT NEERAJ START 20050616 */
        #ifdef __MMI_MAINMENU_TAB_SUPPORT__     /* 071705 Calvin modified */
        case PHNSET_MAINMENU_STYLE_TAB:
        {
            register_set_tab_pane_callback(set_main_menu_tab_pane, NULL, NULL);
            show_category_one_icon_tab_pane();
            return;
        }
        #endif /* __MMI_MAINMENU_TAB_SUPPORT__ */ 
            /* PMT NEERAJ END 20050616 */
        default:
            iconList = mm_iconIDs;
            break;
    }
#else /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */ 
    iconList = mm_iconIDs;
#endif /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */ 
    /* 113004 Calvin removed if-else check */
    /*
     * if((attributes==CIRCULAR_3D_MENU)||(attributes==ROTATE_MENU))
     * RegisterHighlightHandler(ExecuteCurrHiliteHandler_Ext); //MTK JL add no key clear hilite
     * else
     * RegisterHighlightHandler(main_menu_custom_highlight_handler);
     */
#ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
    RegisterHighlightHandler(list_matrix_main_menu_highlight_handler);
#else 
    RegisterHighlightHandler(main_menu_custom_highlight_handler);
#endif 
    /* Calvin end */
    /* PMT VIKAS START 20050707 */
#ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
    gui_register_button_shuffle(shuffle_draw_white);
#endif 
    /* PMT VIKAS END 20050707 */
#ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
    for (j = 0; j < 4; j++)
    {
        mm_iconID2[j] = mm_iconIDs[j] + 1;
        //mm_iconID2[j] = mm_iconIDs[j];//clw
    }
#endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 

#ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
    ShowCategory414Screen(
        MAIN_MENU_TITLE_TEXT,
        MAIN_MENU_TITLE_ICON,
        STR_GLOBAL_OK,
        IMG_GLOBAL_OK,
        STR_GLOBAL_BACK,
        IMG_GLOBAL_BACK,
        n_items,
        mm_stringIDs,
        iconList,
        mm_iconID2,
        nMenuItemList,
        attributes,
        HighlightMenu,
        (U8*) history_buffer);
#else /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
    ShowCategory14Screen(
        MAIN_MENU_TITLE_TEXT,
        MAIN_MENU_TITLE_ICON,
        STR_GLOBAL_OK,
        IMG_GLOBAL_OK,
        STR_GLOBAL_BACK,
        IMG_GLOBAL_BACK,
        n_items,
        mm_stringIDs,
        iconList,
        attributes,
        HighlightMenu,
        (U8*) history_buffer);
#endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 

#if (defined(__MMI_KEYPAD_LOCK_PATTERN_2__) && !defined(__MMI_DISABLE_KEYPAD_LOCK__))
    if (g_idle_context.ToMainMenuScrFromIdleApp == 1)
    {
        StartTimer(KEYPAD_LOCK_TIMER, KEYPAD_LOCK_TIMEOUT, IdleHandleKeypadLockProcess);
        SetKeyHandler(IdleHandlePoundKeyForKeypadLock, KEY_STAR, KEY_EVENT_UP);
    }
#endif /* (defined(__MMI_KEYPAD_LOCK_PATTERN_2__) && !defined(__MMI_DISABLE_KEYPAD_LOCK__)) */ 

    register_menu_shortcut_selected(main_menu_shortcut_executer);
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);

}


/*****************************************************************************
 * FUNCTION
 *  exit_main_menu
 * DESCRIPTION
 *  Store the  snap shot
 *  before displaying next screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void exit_main_menu(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    history main_menu_history;
    S16 nHistory = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    UCS2Strcpy((S8*) main_menu_history.inputBuffer, (S8*) & nHistory);
    main_menu_history.scrnID = MAIN_MENU_SCREENID;
    main_menu_history.entryFuncPtr = goto_main_menu;
    GetCategoryHistory(main_menu_history.guiBuffer);
    AddHistory(main_menu_history);
#ifdef __MMI_WGUI_MINI_TAB_BAR__
    wgui_mini_tab_bar_set_flag_off(WGUI_MINI_TAB_BAR_IN_PARENT);
#endif 
#ifdef __MMI_KEYPAD_LOCK_PATTERN_2__    /* Robin 1223 */
    g_idle_context.ToMainMenuScrFromIdleApp = 0;
#endif 
}


#ifdef __MMI_UCM__
/*****************************************************************************
 * FUNCTION
 *  highlight_mainmenu_callcenter
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void highlight_mainmenu_callcenter(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

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

#ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
    if (inMatrixNoTitleFlag)
    {
        ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
        ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
    }
    else    /* 041105 Calvin added */
    {
        ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
        ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
    }
#else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
    ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
    ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
#endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 

    SetLeftSoftkeyFunction(mmi_ucm_entry_call_center, KEY_EVENT_UP);
    SetRightSoftkeyFunction(handle_mainmenu_right_softkey_up, KEY_EVENT_UP);

}

#else /* __MMI_UCM__ */

/*****************************************************************************
 * FUNCTION
 *  highlight_mainmenu_callhistory
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void highlight_mainmenu_callhistory(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* 030705 Calvin modified */
#ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
    if (inMatrixNoTitleFlag)
    {
        ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
        ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
    }
    else    /* 041105 Calvin added */
    {
        ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
        ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
    }
#else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
    ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
    ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
#endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 

    SetLeftSoftkeyFunction(EntryCHISTMainMenu, KEY_EVENT_UP);
    SetRightSoftkeyFunction(handle_mainmenu_right_softkey_up, KEY_EVENT_UP);

}

#endif /* __MMI_UCM__ */

/*****************************************************************************
 * FUNCTION
 *  highlight_mainmenu_multimedia
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void highlight_mainmenu_multimedia(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* 030705 Calvin modified */
#ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
    if (inMatrixNoTitleFlag)
    {
        ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
        ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
    }
    else    /* 041105 Calvin added */
    {
        ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
        ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
    }
#else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
    ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
    ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
#endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 

    SetLeftSoftkeyFunction(EntryMainMultimedia, KEY_EVENT_UP);
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
	
#ifdef __MMI_OP01_MENU_9MATRIX__
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#else /* __MMI_OP01_MENU_9MATRIX__ */
    if (g_pwr_context.PrevScreenIndicator != ENTER_IDLE_SCR || mmi_bootup_get_active_flight_mode() != 0)
    {
        SetKeyHandler(EntryMainMultimedia, KEY_RIGHT_ARROW, KE

⌨️ 快捷键说明

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