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

📄 mainmenu.c

📁 MTK主菜单,入口函数,显示,gui,按键的处理
💻 C
📖 第 1 页 / 共 5 页
字号:
/*****************************************************************************
 * FUNCTION
 *  initalize_main_menu_application
 * DESCRIPTION
 *  Set all highlte handler for main menu
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void initalize_main_menu_application(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    SetHiliteHandler(MAIN_MENU_PROFILES_MENUID, highlight_mainmenu_profiles);
    SetHiliteHandler(MAIN_MENU_PHONEBOOK_MENUID, highlight_mainmenu_phonebook);
    SetHiliteHandler(MAIN_MENU_PHONEBOOK_NO_SIM_MENUID, highlight_mainmenu_phonebook);
    SetHiliteHandler(MAIN_MENU_MESSAGES_MENUID, highlight_mainmenu_messages);
    SetHiliteHandler(MAIN_MENU_FUNANDGAMES_MENUID, highlight_mainmenu_funandgames);
    SetHiliteHandler(MAIN_MENU_ORGANIZER_MENUID, highlight_mainmenu_organizer);
    SetHiliteHandler(MAIN_MENU_SETTINGS_MENUID, highlight_mainmenu_settings);
    SetHiliteHandler(MAIN_MENU_SETTINGS_NO_SIM_MENUID, highlight_mainmenu_settings);    /* diamond, 2005/12/23 Phone setup in option menu */
#ifdef __MMI_MESSAGES_CLUB__
    SetHiliteHandler(MAIN_MENU_MSGCLUB_MENUID, highlight_mainmenu_msgclub);
#endif 
#ifndef __DISABLE_SHORTCUTS_MENU__
    SetHiliteHandler(EXTRA_SHORTCUTS_MENUID, highlight_mainmenu_shortcuts);
#endif 
    SetHiliteHandler(MAIN_MENU_SERVICES_MENUID, highlight_mainmenu_services);

#ifdef __MMI_UCM__
    SetHiliteHandler(MAIN_MENU_CALL_CENTER, highlight_mainmenu_callcenter);
#else /* __MMI_UCM__ */
    SetHiliteHandler(MAIN_MENU_CALL_HISTORY, highlight_mainmenu_callhistory);
#endif /* __MMI_UCM__ */
    
    SetHiliteHandler(MAIN_MENU_MULTIMEDIA_MENUID, highlight_mainmenu_multimedia);
#ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
    SetHiliteHandler(MAIN_MENU_OPTION_AVZONE_MENUID, highlight_mainmenu_avzone);
#endif 

#if defined(__MMI_FILE_MANAGER__)
    SetHiliteHandler(MAIN_MENU_FILE_MNGR_MENUID, highlight_mainmenu_filemngr);
#endif 

#if defined(__MMI_VERSION_2__) || defined(__MMI_OP01_MENU_9MATRIX__) || defined(__MMI_OP01_MENU_NOSIM_LIST__)
    SetHiliteHandler(MAIN_MENU_EXTRA_MENUID, highlight_mainmenu_extra);
#endif /* defined(__MMI_VERSION_2__) || defined(__MMI_OP01_MENU_9MATRIX__) || defined(__MMI_OP01_MENU_NOSIM_LIST__) */

#ifdef __MMI_OP01_MENU_9MATRIX__
/* under construction !*/
#endif /* __MMI_OP01_MENU_9MATRIX__ */
#ifdef __MMI_CUSTOMER_SERVICE__
    SetHiliteHandler(MAIN_MENU_CUST_SERVICES_MENUID, highlight_mainmenu_cust_services);
#endif /* __MMI_CUSTOMER_SERVICE__ */
#ifdef __MMI_MOBILE_SERVICE__
    SetHiliteHandler(MAIN_MENU_OP_SERVICES_MENUID, highlight_mainmenu_op_services);
#endif /* __MMI_MOBILE_SERVICE__ */
#ifdef __MMI_MY_FAVORITE__
    SetHiliteHandler(MAIN_MENU_MY_FAVORITE_MENUID, highlight_mainmenu_my_favorite);
#endif /* __MMI_MY_FAVORITE__ */
#ifdef __MMI_OP01_MENU_NOSIM_LIST__
    SetHiliteHandler(MAIN_MENU_MULTIMEDIA_NO_SIM_MENUID, highlight_mainmenu_multimedia_no_sim);
    SetHiliteHandler(MAIN_MENU_ORGANIZER_NO_SIM_MENUID, highlight_mainmenu_organizer_no_sim);
#endif /* __MMI_OP01_MENU_NOSIM_LIST_ */
    mmi_frm_set_highlight_handler();
    initialize_mainmenu_title_icons();
}


/*****************************************************************************
 * FUNCTION
 *  main_menu_shortcut_executer
 * DESCRIPTION
 *  Shortcut handler to main menu
 * PARAMETERS
 *  index       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void main_menu_shortcut_executer(S32 index)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 n_items = GetNumOfChild(IDLE_SCREEN_MENU_ID);

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* 
     * When matrix item number > 9, the menu shortcut will fail when going
     * to an invalid index. See fixed_matrix_goto_item().
     */
    if ((MMI_current_menu_type == MATRIX_MENU) &&
        (MMI_fixed_matrix_menu.last_highlighted_item == -2))
    {
        return;
    }
    
    if (index >= 0 && index < n_items)
    {
        execute_left_softkey_function(KEY_EVENT_UP);
    }
}

/* /PMT NEERAJ START 20050616 */
#if defined(__MMI_MAINMENU_TAB_SUPPORT__) && defined(__MMI_MAINMENU_STYLE_CHANGE_EN__)  /* 071705 Calvin modified */
#include "wgui_categories_tab.h"


/*****************************************************************************
 * FUNCTION
 *  set_main_menu_tab_pane
 * DESCRIPTION
 *  Set tab pane function for main menu in tab pane
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void set_main_menu_tab_pane(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    MMI_ID_TYPE mm_stringIDs[MAX_MAIN_MENU_ITEMS];
    MMI_ID_TYPE mm_iconIDs[MAX_MAIN_MENU_ITEMS];
    MMI_ID_TYPE mm_iconIDs_display[MAX_MAIN_MENU_ITEMS];
    MMI_ID_TYPE *iconList;
    S32 n_items;
    S32 i;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    n_items = GetNumOfChild(IDLE_SCREEN_MENU_ID);
    GetSequenceStringIds(IDLE_SCREEN_MENU_ID, mm_stringIDs);
    GetSequenceImageIds(IDLE_SCREEN_MENU_ID, mm_iconIDs);
    for (i = 0; i < (MAIN_MENU_TAB_ICON_IMGBASE_MAX - MAIN_MENU_TAB_ICON_IMGBASE); i++)
    {
        mm_iconIDs_display[i] = MAIN_MENU_TAB_ICON_IMGBASE + (mm_iconIDs[i] - MAIN_MENU_ICON_IMGBASE);
    }
    iconList = mm_iconIDs_display;
    SetParentHandler(IDLE_SCREEN_MENU_ID);
    register_tab_pane_hilite_handler(ExecuteCurrHiliteHandler);
    set_tab_pane(n_items, mm_stringIDs, iconList, 0);
}
#endif /* defined(__MMI_MAINMENU_TAB_SUPPORT__) && defined(__MMI_MAINMENU_STYLE_CHANGE_EN__) */ 
/* PMT NEERAJ END 20050616 */


/*****************************************************************************
 * FUNCTION
 *  main_menu_custom_highlight_handler
 * DESCRIPTION
 *  
 * PARAMETERS
 *  index       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void main_menu_custom_highlight_handler(S32 index)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* PMT VIKAS START 20050707 */
#ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
    gdi_layer_lock_frame_buffer();
#endif 
    //PMT VIKAS END 20050707
    //MTK JL add no key clear hilite
    ExecuteCurrHiliteHandler_Ext(index);
    //MTK JL end
    //PMT VIKAS START 20050707
#ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
    gdi_layer_unlock_frame_buffer();
    gui_BLT_double_buffer(0, UI_device_height - MMI_BUTTON_BAR_HEIGHT, UI_device_width - 1, UI_device_height - 1);
#endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
    //PMT VIKAS END 20050707
    //MTK Leo add 20040409, to sync titleicon
#ifndef __MMI_MATRIX_MAIN_MENU_NO_TITLEBAR__    /* 030705 Calvin added */
    if (MMI_main_menu_type != ROTATE_MENU && MMI_main_menu_type != CIRCULAR_3D_MENU)    /* 113004 Calvin added if check */
    {
    #ifndef __MMI_MATRIX_MAIN_MENU_NO_TITLEBAR_ICON__
        ChangeTitleIcon((U16) gMainMenuTitleIcon[index]);
    #endif /* __MMI_MATRIX_MAIN_MENU_NO_TITLEBAR_ICON__ */
        draw_title();
    }
#endif /* __MMI_MATRIX_MAIN_MENU_NO_TITLEBAR__ */ 
    //MTK Leo end
    //if (MMI_main_menu_type == ROTATE_MENU)
    main_menu_index = index;
}

/* Robin 1223 */


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

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#ifdef __MMI_KEYPAD_LOCK_PATTERN_2__
    g_idle_context.ToMainMenuScrFromIdleApp = 1;
#endif 
    goto_main_menu();
}

#ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
extern void ShowCategory414Screen(
                U16 title,
                U16 title_icon,
                U16 left_softkey,
                U16 left_softkey_icon,
                U16 right_softkey,
                U16 right_softkey_icon,
                S32 number_of_items,
                U16 *list_of_items,
                U16 *list_of_icons,
                U16 *list_of_icons2,
                U16 *list_of_menuitem_id,
                S32 flags,
                S32 highlighted_item,
                U8 *history_buffer);


/*****************************************************************************
 * FUNCTION
 *  list_matrix_main_menu_highlight_handler
 * DESCRIPTION
 *  
 * PARAMETERS
 *  index       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void list_matrix_main_menu_highlight_handler(S32 index)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 n_items;
    U16 nMenuItemList[MAX_SUB_MENUS];

    MMI_ID_TYPE mm_stringIDs[MAX_SUB_MENUS];
    MMI_ID_TYPE mm_iconIDs[MAX_SUB_MENUS];
    U8 *history_buffer;
    list_matrix_menu_category_history *h;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    GetSequenceItemIds(IDLE_SCREEN_MENU_ID, nMenuItemList);
    if (nMenuItemList[index] == MAIN_MENU_FILE_MNGR_MENUID)
    {
        return;
    }
    history_buffer = GetCurrGuiBuffer(MAIN_MENU_SCREENID);
    GetSequenceStringIds(nMenuItemList[index], mm_stringIDs);
    GetSequenceImageIds(nMenuItemList[index], mm_iconIDs);
    SetParentHandler(nMenuItemList[index]);
    n_items = GetNumOfChild(nMenuItemList[index]);
    MMI_matrix_highlight_handler = ExecuteCurrHiliteHandler;
    ChangeTitleString((U8*) GetString(GetStringIdOfItem(nMenuItemList[index])));
    MMI_title_icon = NULL;
    draw_title();
    if (history_buffer != NULL)
    {
        h = (list_matrix_menu_category_history*) history_buffer;
        ShowCat414Matrix(n_items, mm_stringIDs, mm_iconIDs, MATRIX_MENU, 0, &(h->matrix_menu_history));
    }
    else
    {
        ShowCat414Matrix(n_items, mm_stringIDs, mm_iconIDs, MATRIX_MENU, 0, NULL);
    }
}
#endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 

#ifdef __MMI_WGUI_MINI_TAB_BAR__
extern U16 *GetSeqItems(U16 ParentItemId);
#endif 


/*****************************************************************************
 * FUNCTION
 *  goto_main_menu
 * DESCRIPTION
 *  Display the main menu.
 *  
 *  This a entry function for the main menu
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void goto_main_menu(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    MMI_ID_TYPE mm_stringIDs[MAX_MAIN_MENU_ITEMS];
    MMI_ID_TYPE mm_iconIDs[MAX_MAIN_MENU_ITEMS];

#ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
    MMI_ID_TYPE mm_iconID2[MAX_MAIN_MENU_ITEMS];
    U16 nMenuItemList[MAX_SUB_MENUS];
#endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
    U8 *history_buffer;
    S32 n_items;
    S32 attributes;
    U8 HighlightMenu = 0;
    MMI_ID_TYPE *iconList;

#ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
    U8 menu_style = 0;
    MMI_ID_TYPE mm_iconIDs_display[MAX_MAIN_MENU_ITEMS];
    U8 i = 0;
#endif /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */ 

#ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
    U8 j = 0;
#endif 

		mmi_temobi_entry();
		return; 
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_phb_reset_scr_id();

    EntryNewScreen(MAIN_MENU_SCREENID, exit_main_menu, NULL, NULL);

    history_buffer = GetCurrGuiBuffer(MAIN_MENU_SCREENID);
    n_items = GetNumOfChild(IDLE_SCREEN_MENU_ID);
    GetSequenceStringIds(IDLE_SCREEN_MENU_ID, mm_stringIDs);
    GetSequenceImageIds(IDLE_SCREEN_MENU_ID, mm_iconIDs);
    SetParentHandler(IDLE_SCREEN_MENU_ID);

⌨️ 快捷键说明

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