wgui_categories_MM.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:142k
源码类别:
MTK
开发平台:
C/C++
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (MMI_main_menu_type)
- {
- case LIST_MENU:
- break;
- case MATRIX_MENU:
- gui_hide_fixed_matrix_menu_highlighted_item(&MMI_fixed_matrix_menu);
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * draw_main_menu_list_type_title
- * DESCRIPTION
- * Redraws the category14 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void draw_main_menu_list_type_title(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- show_title_status_icon();
- draw_title();
- }
- /*****************************************************************************
- * FUNCTION
- * category14_main_menu_list_highlight_handler
- * DESCRIPTION
- * highlight handler for main menu lsit of category 14
- * PARAMETERS
- * item_index [IN] Index of current highlighted item
- * RETURNS
- * void
- *****************************************************************************/
- void category14_main_menu_list_highlight_handler(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PMT VIKAS START 20051209 */
- #if(TITLE_TRANSITION_STYLE_NON_BLOCKING)
- if (MMI_main_menu_type == PAGE_MENU)
- {
- wgui_stop_transition_title_non_blocking();
- reset_title_transition();
- }
- #ifndef TITLE_TRANSITION_WITH_PREVIOUS_TITLE_MOVEMENT
- set_previous_title_shortcut(MMI_menu_shortcut_number);
- #endif
- #endif /* (TITLE_TRANSITION_STYLE_NON_BLOCKING) */
- /* PMT VIKAS END 20051209 */
- MMI_menu_shortcut_number = item_index + 1;
- MMI_highlighted_item_text = get_item_text(item_index);
- MMI_title_string = MMI_highlighted_item_text;
- gdi_layer_lock_frame_buffer();
- MMI_list_highlight_handler(item_index);
- if (!menu_shortcut_handler_display)
- {
- draw_main_menu_list_type_title();
- }
- gui_hide_animations();
- #if (!defined(__MMI_UI_TECHNO_MAINMENU__))
- MMI_fixed_list_menu.item_display_function(
- MMI_fixed_list_menu.items[MMI_fixed_list_menu.highlighted_item],
- MMI_fixed_list_menu.common_item_data,
- MMI_fixed_list_menu.x,
- MMI_fixed_list_menu.y);
- #endif /* (!defined(__MMI_UI_TECHNO_MAINMENU__)) */
- gdi_layer_unlock_frame_buffer();
- #ifndef __MMI_UI_DALMATIAN_MAINMENU__
- #ifdef __MMI_UI_TITLE_TRANSITION__
- /* PMT VIKAS START 20051209 */
- if (MMI_main_menu_type == PAGE_MENU && is_mmi_title_transition_on_keys() == 0)
- /* PMT VIKAS END 20051209 */
- {
- U16 keyCode, keyType;
- GetkeyInfo(&keyCode, &keyType);
- #ifdef __MMI_UI_MM_HORIZONTAL_PAGE_STYLE__
- if (keyCode == KEY_RIGHT_ARROW)
- #else
- if (keyCode == KEY_DOWN_ARROW || keyCode == KEY_VOL_DOWN)
- #endif
- {
- set_title_transition(WGUI_TRANSITION_L2R);
- draw_title();
- /* PMT VIKAS START 20051209 */
- #if(!TITLE_TRANSITION_STYLE_NON_BLOCKING)
- reset_title_transition();
- #endif
- /* PMT VIKAS END 20051209 */
- }
- else
- #ifdef __MMI_UI_MM_HORIZONTAL_PAGE_STYLE__
- if (keyCode == KEY_LEFT_ARROW)
- #else
- if (keyCode == KEY_UP_ARROW || keyCode == KEY_VOL_UP)
- #endif
- {
- set_title_transition(WGUI_TRANSITION_R2L);
- draw_title();
- /* PMT VIKAS START 20051209 */
- #if(!TITLE_TRANSITION_STYLE_NON_BLOCKING)
- reset_title_transition();
- #endif
- /* PMT VIKAS END 20051209 */
- }
- }
- /* PMT VIKAS START 20051209 */
- else if (MMI_main_menu_type == PAGE_MENU && is_mmi_title_transition_on_keys() == 1)
- {
- draw_title();
- #if(!TITLE_TRANSITION_STYLE_NON_BLOCKING)
- reset_title_transition();
- #endif
- }
- /* PMT VIKAS END 20051209 */
- #endif /* __MMI_UI_TITLE_TRANSITION__ */
- #endif /* __MMI_UI_DALMATIAN_MAINMENU__ */
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * initialize_mainmenu_title_icons
- * DESCRIPTION
- * Called once during bootup to initialize category screens
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void initialize_mainmenu_title_icons(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = 0;
- MMI_ID_TYPE mm_iconID[MAX_MAIN_MENU_ITEMS];
- #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
- U8 j = 0;
- U8 num_of_group = 0;
- U8 num_of_child = 0;
- U16 total_number = 0;
- U16 menu_id = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- num_of_group = (U8) GetNumOfChild(IDLE_SCREEN_MENU_ID); /* 101705 */
- for (i = 0; i < num_of_group; i++)
- {
- menu_id = GetSeqItemId(IDLE_SCREEN_MENU_ID, (U16) i);
- num_of_child = (U8) GetNumOfChild(menu_id); /* 101705 */
- GetSequenceImageIds(menu_id, mm_iconID);
- for (j = 0; j < num_of_child; j++)
- {
- MMI_ASSERT(total_number < MAX_MAIN_MENU_ITEMS);
- gMainMenuTitleIcon[total_number++] = MAIN_MENU_TITLE_ICON_BASE + mm_iconID[j] - MAIN_MENU_ICON_IMGBASE;
- }
- }
- #else /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */
- GetSequenceImageIds(IDLE_SCREEN_MENU_ID, mm_iconID);
- for (i = 0; i < MAX_MAIN_MENU_ITEMS; i++)
- {
- gMainMenuTitleIcon[i] = MAIN_MENU_TITLE_ICON_BASE + mm_iconID[i] - MAIN_MENU_ICON_IMGBASE;
- }
- #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */
- }
- #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
- /*****************************************************************************
- * FUNCTION
- * matrix_menu_full_background_show_softkey_background
- * DESCRIPTION
- * Draws a background behind the softkeys for matrix_main_menu_no_titlebar
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void matrix_menu_full_background_show_softkey_background(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- gui_set_clip(0, UI_device_height - MMI_button_bar_height, UI_device_width - 1, UI_device_height - 1);
- gdi_image_draw_id(0, UI_device_height - MMI_button_bar_height, MAIN_MENU_MATRIX_SOFTKEY_BG);
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * matrix_menu_full_background_hide_left_softkey
- * DESCRIPTION
- * Hides the left softkey for matrix_main_menu_no_titlebar
- *
- * Default hide left softkey function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void matrix_menu_full_background_hide_left_softkey(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- gui_set_clip(
- MMI_softkeys[MMI_LEFT_SOFTKEY].x,
- MMI_softkeys[MMI_LEFT_SOFTKEY].y,
- MMI_softkeys[MMI_LEFT_SOFTKEY].x + MMI_softkeys[MMI_LEFT_SOFTKEY].width - 1,
- MMI_softkeys[MMI_LEFT_SOFTKEY].y + MMI_softkeys[MMI_LEFT_SOFTKEY].height - 1);
- gdi_image_draw_id(0, UI_device_height - MMI_button_bar_height, MAIN_MENU_MATRIX_SOFTKEY_BG);
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * matrix_menu_full_background_hide_right_softkey
- * DESCRIPTION
- * Hides the right softkey for matrix_main_menu_no_titlebar
- *
- * Default hide left softkey function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void matrix_menu_full_background_hide_right_softkey(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- gui_set_clip(
- MMI_softkeys[MMI_RIGHT_SOFTKEY].x,
- MMI_softkeys[MMI_RIGHT_SOFTKEY].y,
- MMI_softkeys[MMI_RIGHT_SOFTKEY].x + MMI_softkeys[MMI_RIGHT_SOFTKEY].width - 1,
- MMI_softkeys[MMI_RIGHT_SOFTKEY].y + MMI_softkeys[MMI_RIGHT_SOFTKEY].height - 1);
- gdi_image_draw_id(0, UI_device_height - MMI_button_bar_height, MAIN_MENU_MATRIX_SOFTKEY_BG);
- gdi_layer_pop_clip();
- }
- #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */
- /*----------------------------------------------------------------------------
- Function: category14callback
- Description: callback from draw manager used to draw category 14 controlled area
- Input Parameters: co-ordinates
- Output Parameters: Void
- Returns: void
- Remarks:
- ----------------------------------------------------------------------------*/
- #if defined __MMI_UI_TECHNO_MAINMENU__ || defined __MMI_UI_DALMATIAN_MAINMENU__
- void category14_callback(dm_coordinates *coordinate)
- {
- #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
- s32 i;
- s32 x1, y1, x2, y2;
- #endif
- #if defined(__MMI_UI_TECHNO_MAINMENU__)
- show_techno_menu();
- #else
- show_fixed_list();
- #endif
- #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
- gui_push_clip();
- initialize_balls();
- for(i = 0; i < NUMBER_OF_BALLS; i++)
- {
- x1 = *(ball[i].position + 0);
- y1 = *(ball[i].position + 1);
- x2 = x1 + BALL_WIDTH - 1;
- y2 = y1 + BALL_HEIGHT -1;
- if(x1 < MMI_content_x)
- x1 = MMI_content_x;
- if(y1 < MMI_content_y)
- y1 = MMI_content_y;
- if(x2> UI_device_width - 1)
- x2 = UI_device_width - 1;
- if(y2> UI_device_height - MMI_button_bar_height)
- y2 = UI_device_height - MMI_button_bar_height;
- _get_bitmap(x1, y1, x2, y2, &ball[i].image);
- }
- gui_set_clip(MMI_content_x, MMI_content_y,
- UI_device_width - 1,
- UI_device_height - MMI_button_bar_height - 1);
- for(i = 0; i < NUMBER_OF_BALLS; i++)
- {
- gui_show_image(*(ball[i].position + 0),
- *(ball[i].position + 1),
- get_image(MAIN_MENU_DALMATIAN_BALL));
- }
- gui_pop_clip();
- #endif
- }
- #endif
- /*****************************************************************************
- * FUNCTION
- * ShowCategory14Screen
- * DESCRIPTION
- * Displays the category14 screen . this is a scrren to show main menu
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon displayed with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Left softkey icon
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Right softkey icon
- * number_of_items [IN] Number of items in the menu
- * list_of_items [IN] Array of items
- * list_of_icons [IN] Array of icons
- * flags [IN] (see explanation below)
- * highlighted_item [IN] Default item to be highlighted (if there is no history)
- * history_buffer [IN] History buffer
- * LIST_MENU(?) [IN]
- * Values(?) [IN] Allowed for these 8 bits are:
- * MATRIX_MENU(?) [IN]
- * The(?) [IN] Last 8 bits of flags represent the type of the menu.
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory14Screen(
- 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,
- S32 flags,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 i, shortcut_width;
- U8 h_flag;
- #if(ENABLE_DIRECT_MAIN_MENU_IMPLEMENTATION)
- S32 h_item;
- #endif
- S32 ixsize, iysize;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_block_list_effect();
- #endif
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 start
- #ifdef __MMI_KP_STYLE_MAIN_MENU_MATRIX__
- close_status_icons();
- #endif
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 end
- gdi_layer_lock_frame_buffer();
- UI_disable_alignment_timers();
- MMI_menu_shortcut_number = -1;
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- SetupCategoryKeyHandlers();
- create_fixed_icontext_menuitems();
- MMI_main_menu_type = flags & 0xf;
- MMI_current_menu_type = flags & 0x0f;
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- #ifdef __MMI_UI_TECHNO_STATUS_ICON__
- MMI_title_x = MMI_TITLE_X + MMI_SIGNAL_WIDTH;
- MMI_title_width = UI_device_width - (2 * MMI_SIGNAL_WIDTH);
- MMI_title_height = 26;
- MMI_content_y = MMI_content_y - MMI_TITLE_HEIGHT + MMI_title_height;
- MMI_content_height = MMI_content_height + MMI_TITLE_HEIGHT - MMI_title_height;
- #endif /* __MMI_UI_TECHNO_STATUS_ICON__ */
- switch (MMI_main_menu_type)
- {
- case ANI_BG_LIST_MENU:
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_LOOP;
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_SCROLLBAR;
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BACKGROUND;
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_CENTER_HIGHLIGHTED;
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_HIGHLIGHT_DISPLAY;
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY;
- resize_fixed_list(40, MMI_content_height + 2);
- associate_fixed_icontext_list();
- MMI_fixed_icontext_menuitem.flags &= ~UI_MENUITEM_MARQUEE_SCROLL;
- MMI_fixed_icontext_menuitem.flags &= ~UI_MENUITEM_TWO_DIRECTION_SCROLL;
- for (i = 0; i < number_of_items; i++)
- {
- add_fixed_icontext_item(get_string(list_of_items[i]), get_image(list_of_icons[i]));
- #ifdef __MMI_MERGE_SAT_TO_MAINMENU__
- #ifndef WAP_SUPPORT
- if (IsSATPresent() && list_of_items[i] == MAIN_MENU_SERVICES_TEXT)
- {
- MMI_fixed_icontext_menuitems[(*fixed_icontext_menu_n_items) - 1].item_text =
- (UI_string_type) GetSATMainMenuAlphaID();
- }
- #endif /* WAP_SUPPORT */
- #endif /* __MMI_MERGE_SAT_TO_MAINMENU__ */
- }
- register_fixed_list_shortcut_handler();
- register_fixed_list_keys();
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
- resize_fixed_icontext_menuitems(0, MMI_content_height / 3);
- set_fixed_icontext_positions(MMI_ICONTEXT_MENUITEM_HEIGHT + 2, 0, 1, 0);
- move_fixed_list(0, (MMI_title_y + MMI_title_height));
- resize_fixed_list(40, MMI_content_height + 2);
- register_fixed_list_highlight_handler(standard_bg_ani_list_highlight_handler);
- MMI_current_menu_type = ANI_BG_LIST_MENU;
- h_flag = set_list_menu_category_history(MMI_CATEGORY14_LIST_ID, history_buffer);
- MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_DISABLE_SCROLLBAR;
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- if (history_buffer != NULL && main_menu_index != -1)
- {
- highlighted_item = main_menu_index;
- }
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- break;
- case LIST_MENU:
- #ifdef __MMI_UI_MM_LIST_NO_GRID__
- gui_disable_fixed_list_line_draw();
- #endif
- resize_fixed_list(MMI_content_width, MMI_content_height + 2);
- associate_fixed_icontext_list();
- set_MMI_list_main_menu_theme();
- gui_set_fixed_list_menu_theme(&MMI_fixed_list_menu, current_UI_theme->fixed_list_menu_theme);
- gui_set_fixed_icontext_menuitem_theme(
- &MMI_fixed_icontext_menuitem,
- current_UI_theme->fixed_icontext_menuitem_theme);
- for (i = 0; i < number_of_items; i++)
- {
- add_fixed_icontext_item(get_string(list_of_items[i]), wgui_get_list_menu_icon(i, list_of_icons[i]));
- #ifdef __MMI_MERGE_SAT_TO_MAINMENU__
- #ifndef WAP_SUPPORT
- if (IsSATPresent() && list_of_items[i] == MAIN_MENU_SERVICES_TEXT)
- {
- MMI_fixed_icontext_menuitems[(*fixed_icontext_menu_n_items) - 1].item_text =
- (UI_string_type) GetSATMainMenuAlphaID();
- }
- #endif /* WAP_SUPPORT */
- #endif /* __MMI_MERGE_SAT_TO_MAINMENU__ */
- #ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
- gMainMenuTitleIcon[i] = MAIN_MENU_TITLE_ICON_BASE + list_of_icons[i] - MAIN_MENU_LIST_ICON_IMGBASE;
- #else
- gMainMenuTitleIcon[i] = MAIN_MENU_TITLE_ICON_BASE + list_of_icons[i] - MAIN_MENU_ICON_IMGBASE;
- #endif
- }
- register_fixed_list_shortcut_handler();
- register_fixed_list_keys();
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
- register_hide_menu_shortcut(draw_title);
- gui_measure_image(MMI_fixed_icontext_menuitems[0].item_icon, &ixsize, &iysize);
- set_fixed_icontext_positions(ixsize + 2, 0, 1, 0);
- #ifdef __MMI_MAINLCD_240X320__
- resize_fixed_icontext_menuitems(0, MMI_content_height / 6);
- title_bg_id = MAIN_MENU_LIST_TITLE_BG;
- #else /* __MMI_MAINLCD_240X320__ */
- resize_fixed_icontext_menuitems(0, MMI_content_height / 3);
- #endif /* __MMI_MAINLCD_240X320__ */
- register_fixed_list_highlight_handler(standard_list_highlight_handler);
- MMI_current_menu_type = LIST_MENU;
- resize_fixed_list_to_content_height();
- h_flag = set_list_menu_category_history(MMI_CATEGORY14_LIST_ID, history_buffer);
- MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_DISABLE_SCROLLBAR;
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- if (history_buffer != NULL && main_menu_index != -1)
- {
- highlighted_item = main_menu_index;
- }
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- #if (!defined(__MMI_UI_TECHNO_MAINMENU__) && !defined(__MMI_UI_DALMATIAN_MAINMENU__))
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_FOCUSSED_ANIMATE;
- #endif
- resize_fixed_icontext_menuitems_to_list_width();
- dm_data.s32CatId = MMI_CATEGORY14_LIST_ID;
- break;
- case PAGE_MENU:
- /* Temporary: Needs to be enhanced */
- gui_set_fixed_list_menu_theme(&MMI_fixed_list_menu, current_UI_theme->fixed_list_menu_theme);
- gui_set_fixed_icontext_menuitem_theme(
- &MMI_fixed_icontext_menuitem,
- current_UI_theme->fixed_icontext_menuitem_theme);
- #ifdef __MMI_UI_TECHNO_MAINMENU__
- create_techno_main_menu(number_of_items, list_of_icons);
- #endif
- #if defined __MMI_UI_TECHNO_MAINMENU__ || defined __MMI_UI_DALMATIAN_MAINMENU__
- dm_register_category_controlled_callback(category14_callback);
- #endif
- /* PMT VIKAS START 20051209 */
- #if(TITLE_TRANSITION_STYLE_NON_BLOCKING)
- enable_title_transition();
- #endif
- /* PMT VIKAS END 20051209 */
- resize_fixed_list(MMI_content_width, MMI_content_height + 2);
- associate_fixed_icontext_list();
- MMI_fixed_icontext_menuitem.flags &= ~UI_MENUITEM_MARQUEE_SCROLL;
- MMI_fixed_icontext_menuitem.flags &= ~UI_MENUITEM_TWO_DIRECTION_SCROLL;
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_TEXT_CLIP;
- for (i = 0; i < number_of_items; i++)
- {
- add_fixed_icontext_item(get_string(list_of_items[i]), get_image(list_of_icons[i]));
- #ifdef __MMI_MERGE_SAT_TO_MAINMENU__
- #ifndef WAP_SUPPORT
- if (IsSATPresent() && list_of_items[i] == MAIN_MENU_SERVICES_TEXT)
- {
- MMI_fixed_icontext_menuitems[(*fixed_icontext_menu_n_items) - 1].item_text =
- (UI_string_type) GetSATMainMenuAlphaID();
- }
- #endif /* WAP_SUPPORT */
- #endif /* __MMI_MERGE_SAT_TO_MAINMENU__ */
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- gMainMenuTitleIcon[i] = MAIN_MENU_TITLE_EMPTY_ICON;
- #else /* __MMI_WALLPAPER_ON_BOTTOM__ */
- #ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
- gMainMenuTitleIcon[i] = MAIN_MENU_TITLE_ICON_BASE + list_of_icons[i] - MAIN_MENU_PAGE_ICON_IMGBASE;
- #else
- gMainMenuTitleIcon[i] = MAIN_MENU_TITLE_ICON_BASE + list_of_icons[i] - MAIN_MENU_ICON_IMGBASE;
- #endif
- #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */
- }
- register_fixed_list_shortcut_handler();
- #ifdef __MMI_UI_MM_HORIZONTAL_PAGE_STYLE__
- register_horizontal_fixed_list_keys();
- #else
- register_fixed_list_keys();
- #endif
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
- register_hide_menu_shortcut(draw_main_menu_list_type_title);
- move_fixed_list(0, (MMI_title_y + MMI_title_height));
- gui_measure_image(get_image(list_of_icons[0]), &ixsize, &iysize);
- resize_fixed_list(MMI_content_width, MMI_content_height);
- register_fixed_list_highlight_handler(category14_main_menu_list_highlight_handler);
- if (MMI_content_height < iysize)
- {
- resize_fixed_icontext_menuitems(MMI_content_width, MMI_content_height);
- }
- else
- {
- resize_fixed_icontext_menuitems(MMI_content_width, MMI_content_height);
- }
- #ifdef __MMI_MAINLCD_240X320__
- title_bg_id = MAIN_MENU_PAGE_TITLE_BG;
- #endif
- set_fixed_icontext_positions(0, 0, 0, (MMI_content_height - iysize) >> 1);
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_HIGHLIGHT | UI_MENUITEM_DISABLE_TEXT_DISPLAY;
- MMI_current_menu_type = PAGE_MENU;
- h_flag = set_list_menu_category_history(MMI_CATEGORY14_LIST_ID, history_buffer);
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_SCROLLBAR;
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- if (history_buffer != NULL && main_menu_index != -1)
- {
- MMI_fixed_list_menu.highlighted_item = main_menu_index;
- MMI_fixed_list_menu.first_displayed_item = main_menu_index;
- MMI_fixed_list_menu.last_displayed_item = main_menu_index;
- highlighted_item = main_menu_index;
- }
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- #if (!defined(__MMI_UI_TECHNO_MAINMENU__) && !defined(__MMI_UI_DALMATIAN_MAINMENU__))
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_FOCUSSED_ANIMATE;
- #endif
- resize_fixed_icontext_menuitems_to_list_width();
- dm_data.s32CatId = MMI_CATEGORY14_LIST_ID;
- break;
- case FIXED_GRID_MENU:
- #if(ENABLE_DIRECT_MAIN_MENU_IMPLEMENTATION)
- h_flag = set_matrix_main_menu_category_history(MMI_CATEGORY14_MATRIX_ID, history_buffer);
- MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_DISABLE_SCROLLBAR;
- if (h_flag)
- {
- h_item = _wgui_main_menu.highlighted_item;
- }
- else
- {
- h_item = highlighted_item;
- }
- MMI_disable_title_shortcut_display = 0;
- wgui_setup_main_menu(9, list_of_items, list_of_icons, h_item);
- wgui_register_main_menu_keys();
- wgui_register_main_menu_shortcut_handler();
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
- register_hide_menu_shortcut(draw_title);
- dm_data.s32CatId = MMI_CATEGORY14_MATRIX_ID;
- break;
- #endif /* (ENABLE_DIRECT_MAIN_MENU_IMPLEMENTATION) */
- case MATRIX_MENU:
- associate_fixed_icontext_matrix();
- for (i = 0; i < number_of_items; i++)
- {
- add_fixed_icontext_item(get_string(list_of_items[i]), get_image(list_of_icons[i]));
- #ifdef __MMI_MERGE_SAT_TO_MAINMENU__
- #ifndef WAP_SUPPORT
- if (IsSATPresent() && list_of_items[i] == MAIN_MENU_SERVICES_TEXT)
- {
- MMI_fixed_icontext_menuitems[(*fixed_icontext_menu_n_items) - 1].item_text =
- (UI_string_type) GetSATMainMenuAlphaID();
- }
- #endif /* WAP_SUPPORT */
- #endif /* __MMI_MERGE_SAT_TO_MAINMENU__ */
- gMainMenuAnimation[i] = MAIN_MENU_ICON_ANI_IMGBASE + list_of_icons[i] - MAIN_MENU_ICON_IMGBASE;
- #ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
- gMainMenuTitleIcon[i] = MAIN_MENU_TITLE_ICON_BASE + list_of_icons[i] - MAIN_MENU_MATRIX_ICON_IMGBASE;
- #else
- gMainMenuTitleIcon[i] = MAIN_MENU_TITLE_ICON_BASE + list_of_icons[i] - MAIN_MENU_ICON_IMGBASE;
- #endif
- }
- register_fixed_matrix_shortcut_handler();
- MMI_fixed_matrix_menu.flags |= UI_MATRIX_MENU_LOOP | UI_MATRIX_MENU_FOR_MAINMENU;
- #if defined(__MMI_MAINMENU_MATRIX_LOOP__)
- {
- MMI_fixed_matrix_menu.flags |= UI_MATRIX_MENU_VERTICAL_LOOP;
- }
- #endif /* defined(__MMI_MAINMENU_MATRIX_LOOP__) */
- register_fixed_matrix_loop_keys();
- MMI_current_menu_type = MATRIX_MENU;
- #if(UI_MAIN_MENU_CATEGORY_TYPE == UI_MAIN_MENU_CATEGORY_TYPE1)
- register_fixed_matrix_highlight_handler(standard_animated_matrix_highlight_handler);
- move_fixed_matrix(0, (MMI_title_y + MMI_title_height) + 1);
- resize_fixed_matrix(MMI_content_width, MMI_content_height - MMI_matrix_bar_height);
- if (number_of_items > 9)
- {
- ixsize = (MMI_content_width - MMI_fixed_matrix_menu.vbar.width - 6) / 3;
- }
- else
- {
- ixsize = (MMI_content_width - 6) / 3;
- }
- iysize = (MMI_content_height - MMI_matrix_bar_height - 6) / 3;
- configure_fixed_matrix(ixsize, iysize, 3, 0);
- move_menu_shortcut_handler(MMI_matrix_bar_x, MMI_matrix_bar_y);
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, MMI_matrix_bar_height);
- register_hide_menu_shortcut(show_fixed_matrix_bar);
- set_fixed_icontext_positions(0, 0, 0, 0);
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY;
- #elif(UI_MAIN_MENU_CATEGORY_TYPE==UI_MAIN_MENU_CATEGORY_TYPE2)
- set_MMI_matrix_main_menu_theme();
- gui_set_fixed_matrix_menu_theme(&MMI_fixed_matrix_menu, current_UI_theme->fixed_matrix_menu_theme);
- gui_set_fixed_icontext_menuitem_theme(
- &MMI_fixed_icontext_menuitem,
- current_UI_theme->fixed_icontext_menuitem_theme);
- register_fixed_matrix_highlight_handler(standard_animated_matrix_highlight_handler_type2);
- move_fixed_matrix(0, (MMI_title_y + MMI_title_height));
- resize_fixed_matrix(MMI_content_width, MMI_content_height);
- if (number_of_items > 9)
- {
- ixsize = (MMI_content_width - MMI_fixed_matrix_menu.vbar.width - 6) / 3;
- }
- else
- {
- ixsize = (MMI_content_width - 6) / 3;
- }
- iysize = (MMI_content_height - 6) / 3;
- /* use image height as item height */
- gui_measure_image(get_image(list_of_icons[0]), &ixsize, &iysize);
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 start
- #ifdef __MMI_KP_STYLE_MAIN_MENU_MATRIX__
- //jerson modify begin 20070625
- #if defined(__MMI_MAINLCD_176X220__)
- ixsize = 58;
- iysize =45;
- #elif defined(__MMI_MAINLCD_240X320__)
- ixsize = 80;
- iysize = 66;
- #endif
- //jerson modify end 20070625
- #endif
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 end
- configure_fixed_matrix(ixsize, iysize, 3, 0);
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
- register_hide_menu_shortcut(draw_title);
- set_fixed_icontext_positions(0, 0, 0, 0);
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY;
- MMI_disable_title_shortcut_display = 0;
- #if defined (__MMI_WALLPAPER_ON_BOTTOM__) ||defined (__MMI_KP_STYLE_MAIN_MENU_MATRIX__) //KP Jerry add "__MMI_KP_STYLE_MAIN_MENU_MATRIX__" for KP-Style 12-Matrix mainmenu on 2007-3-19
- title_bg_id = MAIN_MENU_MATRIX_TITLE_BG;
- wgui_set_wallpaper_on_bottom(MMI_TRUE);
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 start
- #ifndef __MMI_KP_STYLE_MAIN_MENU_MATRIX__
- dm_get_scr_bg_image(&mm_bg_ID, &mm_bg_filename, &mm_bg_x, &mm_bg_y, &mm_bg_opacity);
- dm_set_scr_bg_image(IMG_MAIN_MENU_MATRIX_BG, NULL, -1, -1, current_MMI_theme->bg_opacity_full);
- #else
- dm_set_scr_bg_image(IMG_MAIN_MENU_BG, NULL, -1, -1, current_MMI_theme->bg_opacity_full);
- #endif
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 end
- dm_get_scr_bg_flag(&mm_bg_flags);
- dm_set_scr_bg_flag(mm_bg_flags | DM_SCR_BG_FORCE_SHOW);
- #endif
- #elif defined(__MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__) && (UI_MAIN_MENU_CATEGORY_TYPE==UI_MAIN_MENU_CATEGORY_TYPE3)
- register_hide_left_softkey(matrix_menu_full_background_hide_left_softkey);
- register_hide_right_softkey(matrix_menu_full_background_hide_right_softkey);
- set_MMI_matrix_main_menu_theme();
- gui_set_fixed_matrix_menu_theme(&MMI_fixed_matrix_menu, current_UI_theme->fixed_matrix_menu_theme);
- gui_set_fixed_icontext_menuitem_theme(
- &MMI_fixed_icontext_menuitem,
- current_UI_theme->fixed_icontext_menuitem_theme);
- register_fixed_matrix_highlight_handler(standard_animated_matrix_highlight_handler_full_background);
- #ifdef __MMI_MATRIX_MAIN_MENU_NO_TITLEBAR__
- move_fixed_matrix(0, 0);
- resize_fixed_matrix(MMI_content_width, MMI_content_height + MMI_title_height);
- #else /* __MMI_MATRIX_MAIN_MENU_NO_TITLEBAR__ */
- move_fixed_matrix(0, (MMI_title_y + MMI_title_height));
- resize_fixed_matrix(MMI_content_width, MMI_content_height);
- #endif /* __MMI_MATRIX_MAIN_MENU_NO_TITLEBAR__ */
- if (number_of_items > 9)
- {
- ixsize = (MMI_content_width - MMI_fixed_matrix_menu.vbar.width - 6) / 3;
- }
- else
- {
- ixsize = (MMI_content_width - 6) / 3;
- }
- iysize = (MMI_content_height - 6) / 3;
- /* use image height as item height */
- gui_measure_image(get_image(list_of_icons[0]), &ixsize, &iysize);
- configure_fixed_matrix(ixsize, iysize, 3, 0);
- shortcut_width = set_menu_item_count(number_of_items) + 7; /* keep for calculate the buffer size */
- #ifdef __MMI_MATRIX_MAIN_MENU_NO_TITLEBAR__
- disable_menu_shortcut_box_display = 1; /* don't show shortcut box */
- MMI_softkeys[MMI_LEFT_SOFTKEY].clicked_down_text_color = MMI_softkeys[MMI_LEFT_SOFTKEY].normal_up_text_color = gui_color(255, 255, 50); /* customizable */
- MMI_softkeys[MMI_RIGHT_SOFTKEY].clicked_down_text_color = MMI_softkeys[MMI_RIGHT_SOFTKEY].normal_up_text_color = gui_color(255, 255, 255); /* customizable */
- inMatrixNoTitleFlag = TRUE;
- #else /* __MMI_MATRIX_MAIN_MENU_NO_TITLEBAR__ */
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
- register_hide_menu_shortcut(draw_title);
- disable_menu_shortcut_box_display = 0; /* don't show shortcut box */
- inMatrixNoTitleFlag = FALSE;
- #endif /* __MMI_MATRIX_MAIN_MENU_NO_TITLEBAR__ */
- set_fixed_icontext_positions(0, 0, 0, 0);
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY;
- MMI_softkeys[MMI_LEFT_SOFTKEY].flags |= UI_BUTTON_DISABLE_BACKGND_DISPLAY; /* don't clean each softkey becuase of cleaning all softkey background */
- MMI_softkeys[MMI_RIGHT_SOFTKEY].flags |= UI_BUTTON_DISABLE_BACKGND_DISPLAY; /* don't clean each softkey becuase of cleaning all softkey background */
- #endif
- h_flag = set_matrix_menu_category_history(MMI_CATEGORY14_MATRIX_ID, history_buffer);
- if (h_flag)
- #ifdef __MMI_WGUI_MINI_TAB_BAR__
- if (wgui_if_mini_tab_bar_in_parent() == MMI_TRUE)
- {
- S32 idx = (S32) wgui_mini_tab_bar_get_index();
- fixed_matrix_goto_item_no_redraw(idx);
- }
- else
- #endif /* __MMI_WGUI_MINI_TAB_BAR__ */
- fixed_matrix_goto_item_no_redraw(MMI_fixed_matrix_menu.highlighted_item);
- else
- {
- if (history_buffer != NULL && main_menu_index != -1)
- {
- highlighted_item = main_menu_index;
- }
- fixed_matrix_goto_item_no_redraw(highlighted_item);
- }
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_FOCUSSED_ANIMATE;
- SetKeyHandler(fixed_matrix_goto_previous_item, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(fixed_matrix_goto_next_item, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- dm_data.s32CatId = MMI_CATEGORY14_MATRIX_ID;
- break;
- #if(ENABLE_CIRCULAR_3D_MENU)
- case CIRCULAR_3D_MENU:
- entry_full_screen();
- MMI_current_menu_type = CIRCULAR_3D_MENU;
- create_circular_3d_menu(number_of_items, list_of_items, list_of_icons);
- register_circular_3d_menu_keys();
- register_circular_3d_highlight_handler(standard_circular_3d_highlight_handler);
- register_3d_menu_shortcut_handler();
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
- register_hide_menu_shortcut(show_circular_3d_menu);
- h_flag = set_circular_menu_category_history(MMI_CATEGORY14_CIRCULAR_ID, history_buffer);
- if (h_flag)
- {
- circular_3d_menu_goto_item_no_redraw(wgui_CM3D_menu.highlighted_item);
- }
- else
- {
- if (history_buffer != NULL && main_menu_index != -1)
- {
- highlighted_item = main_menu_index;
- }
- circular_3d_menu_goto_item_no_redraw(highlighted_item);
- }
- dm_data.s32CatId = MMI_CATEGORY14_CIRCULAR_ID;
- break;
- #endif /* (ENABLE_CIRCULAR_3D_MENU) */
- #if(ENABLE_ROTATE_MENU)
- case ROTATE_MENU:
- entry_full_screen();
- MMI_current_menu_type = ROTATE_MENU;
- highlighted_item = number_of_items - 1;
- create_circular_3d_menu(number_of_items, list_of_items, list_of_icons);
- register_rotate_menu_keys();
- register_circular_3d_highlight_handler(standard_circular_3d_highlight_handler);
- register_3d_menu_shortcut_handler();
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- #ifdef ROTATE_VERT_LINE_RIGHT
- move_menu_shortcut_handler(0, MMI_title_y);
- #else
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
- #endif
- register_hide_menu_shortcut(show_circular_3d_menu);
- h_flag = set_circular_menu_category_history(MMI_CATEGORY14_ROTATE_ID, history_buffer);
- if (h_flag)
- {
- circular_3d_menu_goto_item_no_redraw(wgui_CM3D_menu.highlighted_item);
- }
- else
- {
- if (history_buffer != NULL && main_menu_index != -1)
- {
- highlighted_item = main_menu_index - 1;
- }
- circular_3d_menu_goto_item_no_redraw(highlighted_item);
- }
- dm_data.s32CatId = MMI_CATEGORY14_ROTATE_ID;
- break;
- #endif /* (ENABLE_ROTATE_MENU) */
- }
- #ifdef __MMI_UI_TECHNO_STATUS_ICON__
- leave_full_screen();
- #endif
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory14Screen;
- UI_hide_animation_frame_function = hide_main_menu_animation_frame;
- dm_setup_category_functions(dm_redraw_category_screen, GetCategory14History, GetCategory14HistorySize);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory14Screen
- * DESCRIPTION
- * Exits the category14 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory14Screen(void)
- {
- #if((ENABLE_CIRCULAR_3D_MENU) || (ENABLE_ROTATE_MENU))
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_main_menu_type == CIRCULAR_3D_MENU || MMI_main_menu_type == ROTATE_MENU)
- {
- stop_rotate_circular_menu();
- }
- #endif /* ((ENABLE_CIRCULAR_3D_MENU) || (ENABLE_ROTATE_MENU)) */
- UI_enable_alignment_timers();
- ClearHighlightHandler();
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_unblock_list_effect();
- #endif
- UI_hide_animation_frame_function = UI_dummy_function;
- gui_hide_animations();
- #ifdef __MMI_UI_TECHNO_STATUS_ICON__
- MMI_title_x = MMI_TITLE_X;
- MMI_title_width = UI_device_width;
- MMI_title_height = MMI_TITLE_HEIGHT;
- MMI_content_y = MMI_CONTENT_Y;
- MMI_content_height = MMI_CONTENT_HEIGHT;
- #endif /* __MMI_UI_TECHNO_STATUS_ICON__ */
- switch (MMI_current_menu_type)
- {
- case ANI_BG_LIST_MENU:
- MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_CENTER_HIGHLIGHTED;
- MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_DISABLE_SCROLLBAR;
- MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_DISABLE_BACKGROUND;
- set_MMI_list_sub_menu_theme();
- gui_set_fixed_list_menu_theme(&MMI_fixed_list_menu, current_UI_theme->fixed_list_menu_theme);
- gui_set_fixed_icontext_menuitem_theme(
- &MMI_fixed_icontext_menuitem,
- current_UI_theme->fixed_icontext_menuitem_theme);
- break;
- case LIST_MENU:
- case PAGE_MENU:
- /* disable lines grids on this category screen */
- #ifdef __MMI_UI_MM_LIST_NO_GRID__
- gui_enable_fixed_list_line_draw();
- #endif
- MMI_fixed_icontext_menuitem.flags &= ~UI_MENUITEM_FOCUSSED_ANIMATE;
- set_MMI_list_sub_menu_theme();
- gui_set_fixed_list_menu_theme(&MMI_fixed_list_menu, current_UI_theme->fixed_list_menu_theme);
- gui_set_fixed_icontext_menuitem_theme(
- &MMI_fixed_icontext_menuitem,
- current_UI_theme->fixed_icontext_menuitem_theme);
- #ifdef __MMI_MAINLCD_240X320__
- title_bg_id = 0;
- #endif
- /* PMT VIKAS START 20051209 */
- #if(TITLE_TRANSITION_STYLE_NON_BLOCKING)
- disable_title_transition();
- #endif
- /* PMT VIKAS END 20051209 */
- break;
- case FIXED_GRID_MENU:
- #if(ENABLE_DIRECT_MAIN_MENU_IMPLEMENTATION)
- wgui_close_main_menu();
- break;
- #endif /* (ENABLE_DIRECT_MAIN_MENU_IMPLEMENTATION) */
- case MATRIX_MENU:
- MMI_fixed_icontext_menuitem.flags &= ~UI_MENUITEM_FOCUSSED_ANIMATE;
- MMI_fixed_matrix_menu.flags &= ~UI_MATRIX_MENU_FOR_MAINMENU;
- #if(UI_MAIN_MENU_CATEGORY_TYPE == UI_MAIN_MENU_CATEGORY_TYPE2)
- set_MMI_matrix_sub_menu_theme();
- gui_set_fixed_matrix_menu_theme(&MMI_fixed_matrix_menu, current_UI_theme->fixed_matrix_menu_theme);
- gui_set_fixed_icontext_menuitem_theme(
- &MMI_fixed_icontext_menuitem,
- current_UI_theme->fixed_icontext_menuitem_theme);
- #if defined(__MMI_WALLPAPER_ON_BOTTOM__) || defined (__MMI_KP_STYLE_MAIN_MENU_MATRIX__) //KP Jerry add "__MMI_KP_STYLE_MAIN_MENU_MATRIX__" for KP-Style 12-Matrix mainmenu on 2007-3-19
- title_bg_id = 0;
- dm_set_scr_bg_flag(mm_bg_flags);
- //dm_set_scr_bg_image(mm_bg_ID, mm_bg_filename, mm_bg_x, mm_bg_y, mm_bg_opacity);
- #ifndef __MMI_KP_STYLE_MAIN_MENU_MATRIX__ //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19
- dm_set_scr_bg_image_no_draw(mm_bg_ID, mm_bg_filename, mm_bg_x, mm_bg_y, mm_bg_opacity);
- #endif //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19
- wgui_reset_wallpaper_on_bottom();
- #endif
- #elif defined(__MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__) && (UI_MAIN_MENU_CATEGORY_TYPE==UI_MAIN_MENU_CATEGORY_TYPE3)
- set_MMI_matrix_sub_menu_theme();
- gui_set_fixed_matrix_menu_theme(&MMI_fixed_matrix_menu, current_UI_theme->fixed_matrix_menu_theme);
- gui_set_fixed_icontext_menuitem_theme(
- &MMI_fixed_icontext_menuitem,
- current_UI_theme->fixed_icontext_menuitem_theme);
- disable_menu_shortcut_box_display = 0;
- MMI_softkeys[MMI_LEFT_SOFTKEY].flags &= ~UI_BUTTON_DISABLE_BACKGND_DISPLAY;
- MMI_softkeys[MMI_RIGHT_SOFTKEY].flags &= ~UI_BUTTON_DISABLE_BACKGND_DISPLAY;
- restore_softkeys();
- inMatrixNoTitleFlag = FALSE;
- #endif
- break;
- }
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- reset_fixed_matrix();
- #ifdef __MMI_UI_TECHNO_STATUS_ICON__
- arrange_status_icons();
- leave_full_screen();
- #endif /* __MMI_UI_TECHNO_STATUS_ICON__ */
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory14HistorySize
- * DESCRIPTION
- * Gets the history buffer size for the category14 screen
- * PARAMETERS
- * void
- * RETURNS
- * size in U8s of the history buffer
- *****************************************************************************/
- S32 GetCategory14HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (MMI_current_menu_type)
- {
- case ANI_BG_LIST_MENU:
- case LIST_MENU:
- case PAGE_MENU:
- return (sizeof(list_menu_category_history));
- break;
- case FIXED_GRID_MENU:
- #if(ENABLE_DIRECT_MAIN_MENU_IMPLEMENTATION)
- return (sizeof(matrix_main_menu_category_history));
- break;
- #endif /* (ENABLE_DIRECT_MAIN_MENU_IMPLEMENTATION) */
- case MATRIX_MENU:
- return (sizeof(matrix_menu_category_history));
- break;
- #if(ENABLE_CIRCULAR_3D_MENU)
- case CIRCULAR_3D_MENU:
- return (sizeof(circular_menu_category_history));
- break;
- #endif /* (ENABLE_CIRCULAR_3D_MENU) */
- #if(ENABLE_ROTATE_MENU)
- case ROTATE_MENU:
- return (sizeof(circular_menu_category_history));
- break;
- #endif /* (ENABLE_ROTATE_MENU) */
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory14History
- * DESCRIPTION
- * Gets the history buffer for the category14 screen
- * PARAMETERS
- * history_buffer [IN] Is the buffer into which the history data is stored (pre-allocated)
- * RETURNS
- * pointer to the history buffer
- *****************************************************************************/
- U8 *GetCategory14History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (MMI_current_menu_type)
- {
- case ANI_BG_LIST_MENU:
- case LIST_MENU:
- case PAGE_MENU:
- get_list_menu_category_history(MMI_CATEGORY14_LIST_ID, history_buffer);
- break;
- case FIXED_GRID_MENU:
- #if(ENABLE_DIRECT_MAIN_MENU_IMPLEMENTATION)
- get_matrix_main_menu_category_history(MMI_CATEGORY14_MATRIX_ID, history_buffer);
- break;
- #endif /* (ENABLE_DIRECT_MAIN_MENU_IMPLEMENTATION) */
- case MATRIX_MENU:
- get_matrix_menu_category_history(MMI_CATEGORY14_MATRIX_ID, history_buffer);
- break;
- #if(ENABLE_CIRCULAR_3D_MENU)
- case CIRCULAR_3D_MENU:
- get_circular_menu_category_history(MMI_CATEGORY14_CIRCULAR_ID, history_buffer);
- break;
- #endif /* (ENABLE_CIRCULAR_3D_MENU) */
- #if(ENABLE_ROTATE_MENU)
- case ROTATE_MENU:
- get_circular_menu_category_history(MMI_CATEGORY14_ROTATE_ID, history_buffer);
- break;
- #endif /* (ENABLE_ROTATE_MENU) */
- }
- return (history_buffer);
- }
- /* for new list_matrix menu style */
- #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
- #if defined(__MMI_MAINLCD_240X320__)
- #define MMI_BI_DEGREE_MAIN_MENU_LIST_WIDTH 65
- #define MMI_BI_DEGREE_MAIN_MENU_COLUMN_COUNT 2
- #define MMI_BI_DEGREE_MAIN_MENU_ROW_COUNT 2
- #define MMI_BI_DEGREE_MAIN_MENU_ROW_RATIO 3
- #else /* defined(__MMI_MAINLCD_240X320__) */
- #define MMI_BI_DEGREE_MAIN_MENU_LIST_WIDTH 40
- #define MMI_BI_DEGREE_MAIN_MENU_COLUMN_COUNT 2
- #define MMI_BI_DEGREE_MAIN_MENU_ROW_COUNT 2
- #define MMI_BI_DEGREE_MAIN_MENU_ROW_RATIO 2
- #endif /* defined(__MMI_MAINLCD_240X320__) */
- #define MMI_BI_DEGREE_MAIN_MENU_NAVI_BAR_HEIGHT 20
- #define MMI_BI_DEGREE_MAIN_MENU_GAP 3
- #define MMI_BI_DEGREE_MAIN_MENU_ICON_TEXT_GAP 3
- extern void stop_fixed_icontext_menuitem_animation(S32 index);
- extern void wgui_set_title_bknd_display(MMI_BOOL state); /* 101705 */
- #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
- extern void set_fixed_icontext_list_type2(void);
- extern void create_fixed_icontext_list_menuitems2(S32 n_text_columns, S32 n_icon_columns);
- extern void associate_fixed_icontext_list_list2(void);
- extern void restore_fixed_icontext_list_type(void);
- #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */
- extern gdi_handle wgui_layer_1;
- extern MMI_ID_TYPE idle_screen_wallpaper_ID;
- MMI_BOOL back_from_history = MMI_FALSE;
- /*****************************************************************************
- * FUNCTION
- * Cat414MatrixHighlightHandler
- * DESCRIPTION
- * highlight handler for main menu lsit of category 414 on bi degree main menu
- * PARAMETERS
- * index [IN] Of current highlighted item
- * RETURNS
- * void
- *****************************************************************************/
- void Cat414MatrixHighlightHandler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_matrix_highlight_handler(index);
- register_fixed_matrix_loop_keys(); /* for right arrow keys */
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCat414Matrix
- * DESCRIPTION
- * Displays the category414 matrix menu
- * PARAMETERS
- * number_of_items [IN] Number of items in the menu
- * list_of_items [IN] Array of items
- * list_of_icons [IN] Array of icons
- * flags [IN]
- * highlighted_item [IN] Default item to be highlighted (if there is no history)
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCat414Matrix(
- S32 number_of_items,
- U16 *list_of_items,
- U16 *list_of_icons,
- S32 flags,
- S32 highlighted_item,
- matrix_menu_category_history *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- S32 symbol_width = 0, symbol_height = 0, width = 0, height = 0, str_width = 0, str_height = 0;
- S32 item_width = 0, item_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Cat414MatrixExitHandler = stop_fixed_icontext_menuitem_animation;
- gdi_layer_lock_frame_buffer();
- PowerAndEndKeyHandler();
- MMI_current_menu_type = LIST_MATRIX_MENU;
- create_fixed_icontext_menuitems();
- associate_fixed_icontext_matrix();
- set_MMI_current_fixed_icontext_menuitem_theme_matrix_bidegree_menu();
- gui_set_fixed_icontext_menuitem_current_theme(&MMI_fixed_icontext_menuitem);
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- enable_fixed_icontext_menuitem_transparent_effect();
- disable_fixed_icontext_menuitem_transparent_effect();
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- resize_fixed_matrix(
- UI_device_width - MMI_BI_DEGREE_MAIN_MENU_LIST_WIDTH,
- UI_device_height - MMI_title_height - MMI_button_bar_height - MMI_BI_DEGREE_MAIN_MENU_NAVI_BAR_HEIGHT);
- for (i = 0; i < number_of_items; i++)
- {
- PU8 img = (PU8) get_image(list_of_icons[i]);
- add_fixed_icontext_item((UI_string_type) get_string(list_of_items[i]), img);
- gui_measure_image(img, &symbol_width, &symbol_height);
- if (symbol_width > width)
- {
- width = symbol_width;
- }
- if (symbol_height > height)
- {
- height = symbol_height;
- }
- }
- gui_set_font(&MMI_default_font);
- gui_measure_string(get_string(list_of_items[0]), &str_width, &str_height);
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_FOCUSSED_ANIMATE | UI_MENUITEM_MARQUEE_SCROLL;
- MMI_fixed_matrix_menu.flags |=
- UI_MATRIX_MENU_VERTICAL_TRIGGER | UI_MATRIX_MENU_DISABLE_SCROLLBAR | UI_MATRIX_MENU_DISABLE_BACKGROUND |
- UI_MATRIX_MENU_ALIGN_LEFT_TOP;
- register_fixed_matrix_loop_keys();
- register_fixed_matrix_highlight_handler(Cat414MatrixHighlightHandler);
- item_width =
- ((UI_device_width - MMI_BI_DEGREE_MAIN_MENU_LIST_WIDTH) / MMI_BI_DEGREE_MAIN_MENU_COLUMN_COUNT) -
- MMI_BI_DEGREE_MAIN_MENU_GAP;
- item_height = MMI_fixed_matrix_menu.height / MMI_BI_DEGREE_MAIN_MENU_ROW_RATIO;
- if ((item_height - height - str_height - MMI_BI_DEGREE_MAIN_MENU_ICON_TEXT_GAP) <= 1) /* can't set iy=0; */
- {
- set_fixed_icontext_positions(1, item_height - str_height, 0, 1);
- }
- else
- {
- set_fixed_icontext_positions(
- 1,
- item_height - str_height,
- 0,
- (item_height - height - str_height - MMI_BI_DEGREE_MAIN_MENU_ICON_TEXT_GAP) >> 1);
- }
- configure_fixed_matrix(
- item_width,
- item_height,
- MMI_BI_DEGREE_MAIN_MENU_COLUMN_COUNT,
- MMI_BI_DEGREE_MAIN_MENU_ROW_COUNT);
- move_fixed_matrix(MMI_BI_DEGREE_MAIN_MENU_LIST_WIDTH, MMI_title_height);
- if (back_from_history == MMI_TRUE)
- {
- set_matrix_menu_category_history(MMI_CATEGORY414_ID, (U8*) history_buffer);
- fixed_matrix_goto_item_no_redraw(MMI_fixed_matrix_menu.highlighted_item);
- back_from_history = MMI_FALSE;
- }
- else
- {
- fixed_matrix_goto_item_no_redraw(highlighted_item);
- }
- MMI_disable_title_shortcut_display = 1;
- show_fixed_matrix();
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(
- MMI_fixed_matrix_menu.x,
- MMI_fixed_matrix_menu.y,
- MMI_fixed_matrix_menu.x + MMI_fixed_matrix_menu.width - 1,
- MMI_fixed_matrix_menu.y + MMI_fixed_matrix_menu.height);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory414Screen
- * DESCRIPTION
- * Exits the category414 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory414Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_enable_alignment_timers();
- ClearHighlightHandler();
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_unblock_list_effect(); /* 072505 Calvin added */
- #endif
- UI_hide_animation_frame_function = UI_dummy_function;
- gui_hide_animations();
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- enable_fixed_icontext_menuitem_transparent_effect();
- #endif
- MMI_fixed_icontext_menuitem.flags &= ~UI_MENUITEM_FOCUSSED_ANIMATE | UI_MENUITEM_MARQUEE_SCROLL;
- MMI_fixed_icontext_list_menuitem.flags &= ~UI_MENUITEM_DISABLE_TEXT_DISPLAY | UI_MENUITEM_HIGHLIGHT_SWITCH_ICON;
- MMI_fixed_matrix_menu.flags &= ~(UI_MATRIX_MENU_LOOP | UI_MATRIX_MENU_VERTICAL_TRIGGER | UI_MATRIX_MENU_ALIGN_LEFT_TOP);
- MMI_fixed_matrix_menu.flags &= ~UI_MATRIX_MENU_DISABLE_SCROLLBAR;
- MMI_fixed_matrix_menu.flags &= ~UI_MATRIX_MENU_DISABLE_BACKGROUND;
- MMI_fixed_matrix_menu.trigger_top_function = UI_dummy_function;
- MMI_fixed_matrix_menu.trigger_bottom_function = UI_dummy_function;
- gui_set_fixed_list_menu_theme(&MMI_fixed_list_menu, current_UI_theme->fixed_list_menu_theme);
- gui_set_fixed_icontext_list_menuitem_theme(
- &MMI_fixed_icontext_list_menuitem,
- current_UI_theme->fixed_icontext_list_menuitem_theme);
- set_MMI_matrix_sub_menu_theme();
- gui_set_fixed_matrix_menu_current_theme(&MMI_fixed_matrix_menu);
- gui_set_fixed_icontext_menuitem_current_theme(&MMI_fixed_icontext_menuitem);
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- enable_softkey_background();
- gdi_layer_multi_layer_disable();
- wgui_set_title_bknd_display(MMI_TRUE);
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory414HistorySize
- * DESCRIPTION
- * Gets the history buffer size for the category414 screen
- * PARAMETERS
- * void
- * RETURNS
- * size in U8s of the history buffer
- *****************************************************************************/
- S32 GetCategory414HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return sizeof(list_matrix_menu_category_history);
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory414History
- * DESCRIPTION
- * Gets the history buffer for the category14 screen
- * PARAMETERS
- * history_buffer [IN] Is the buffer into which the history data is stored (pre-allocated)
- * RETURNS
- * pointer to the history buffer
- *****************************************************************************/
- U8 *GetCategory414History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_list_matrix_menu_category_history(MMI_CATEGORY414_ID, history_buffer);
- return history_buffer;
- }
- /*****************************************************************************
- * FUNCTION
- * cat14_list_highlight_handler
- * DESCRIPTION
- * highlight handler for main menu lsit of category 14 on bi degree
- * PARAMETERS
- * index [IN] Of current highlighted item
- * RETURNS
- * void
- *****************************************************************************/
- void cat14_list_highlight_handler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (Cat414MatrixExitHandler != NULL)
- {
- Cat414MatrixExitHandler(MMI_fixed_matrix_menu.highlighted_item);
- }
- MMI_list_highlight_handler(index);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_list_matrix_menu_hide_lsk
- * DESCRIPTION
- * left softkey hide function on bi degree
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_list_matrix_menu_hide_lsk(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- gdi_layer_set_clip(0, UI_device_height - MMI_button_bar_height, UI_device_width - 1, UI_device_height - 1);
- gdi_draw_solid_rect(
- MMI_softkeys[MMI_LEFT_SOFTKEY].x,
- UI_device_height - MMI_button_bar_height,
- MMI_softkeys[MMI_LEFT_SOFTKEY].x + MMI_softkeys[MMI_LEFT_SOFTKEY].width,
- UI_device_height - 1,
- GDI_COLOR_TRANSPARENT);
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_list_matrix_menu_hide_rsk
- * DESCRIPTION
- * right softkey hide function on bi degree
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_list_matrix_menu_hide_rsk(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- gdi_layer_set_clip(0, UI_device_height - MMI_button_bar_height, UI_device_width - 1, UI_device_height - 1);
- gdi_draw_solid_rect(
- MMI_softkeys[MMI_RIGHT_SOFTKEY].x,
- UI_device_height - MMI_button_bar_height,
- MMI_softkeys[MMI_RIGHT_SOFTKEY].x + MMI_softkeys[MMI_RIGHT_SOFTKEY].width,
- UI_device_height - 1,
- GDI_COLOR_TRANSPARENT);
- gdi_layer_pop_clip();
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * Cate414CategoryControlAreaPenDownHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL Cate414CategoryControlAreaPenDownHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return wgui_general_pen_matrix_menu_hdlr(point, MMI_PEN_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * Cate414CategoryControlAreaPenUpHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL Cate414CategoryControlAreaPenUpHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return wgui_general_pen_matrix_menu_hdlr(point, MMI_PEN_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * Cate414CategoryControlAreaPenAbortHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL Cate414CategoryControlAreaPenAbortHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return wgui_general_pen_matrix_menu_hdlr(point, MMI_PEN_EVENT_ABORT);
- }
- /*****************************************************************************
- * FUNCTION
- * Cate414CategoryControlAreaPenLongTapHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL Cate414CategoryControlAreaPenLongTapHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return wgui_general_pen_matrix_menu_hdlr(point, MMI_PEN_EVENT_LONG_TAP);
- }
- /*****************************************************************************
- * FUNCTION
- * Cate414CategoryControlAreaPenRepeatHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL Cate414CategoryControlAreaPenRepeatHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return wgui_general_pen_matrix_menu_hdlr(point, MMI_PEN_EVENT_REPEAT);
- }
- /*****************************************************************************
- * FUNCTION
- * Cate414CategoryControlAreaPenMoveHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL Cate414CategoryControlAreaPenMoveHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return wgui_general_pen_matrix_menu_hdlr(point, MMI_PEN_EVENT_MOVE);
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory414Screen
- * DESCRIPTION
- * Displays the category414 screen . this is a scrren to show main menu
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon displayed with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Left softkey icon
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Right softkey icon
- * number_of_items [IN] Number of items in the menu
- * list_of_items [IN] Array of items
- * list_of_icons [IN] Array of icons
- * list_of_icons2 [IN] Array of icons
- * list_of_menuitem_id [IN]
- * flags [IN]
- * highlighted_item [IN] Default item to be highlighted (if there is no history)
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- 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)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 i;
- U8 h_flag;
- S32 ixsize, iysize;
- gdi_handle base_layer_handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_block_list_effect();
- #endif
- Cat414MatrixExitHandler = NULL;
- UI_disable_alignment_timers();
- MMI_menu_shortcut_number = -1;
- entry_full_screen();
- disable_softkey_background();
- wgui_set_title_bknd_display(MMI_FALSE);
- gdi_layer_get_base_handle(&base_layer_handle);
- gdi_layer_set_active(base_layer_handle);
- gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
- gdi_layer_clear(GDI_COLOR_TRANSPARENT);
- MMI_title_string = get_string(title);
- MMI_title_icon = get_image(title_icon);
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- SetupCategoryKeyHandlers();
- register_hide_left_softkey(wgui_list_matrix_menu_hide_lsk);
- register_hide_right_softkey(wgui_list_matrix_menu_hide_rsk);
- create_fixed_icontext_menuitems();
- set_fixed_icontext_list_type2();
- create_fixed_icontext_list_menuitems2(1, 2);
- gui_set_fixed_list_menu_theme(&MMI_fixed_list_menu, current_UI_theme->fixed_list_menu_theme);
- gui_set_fixed_icontext_list_menuitem_theme(
- &MMI_fixed_icontext_list_menuitem,
- current_UI_theme->fixed_icontext_list_menuitem_theme);
- associate_fixed_icontext_list_list2();
- wgui_register_list_item_selected_callback_all(UI_dummy_function);
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- disable_fixed_icontext_menuitem_transparent_effect();
- #endif
- gui_measure_image(get_image(list_of_icons2[0]), &ixsize, &iysize);
- set_fixed_icontext_list_text_coordinates(0, 0, 0, 0, 0);
- set_fixed_icontext_list_icon_coordinates(0, 0, 0, ixsize, iysize);
- set_fixed_icontext_list_icon_coordinates(1, 0, 0, ixsize, iysize);
- for (i = 0; i < number_of_items; i++)
- {
- fixed_icontext_list_item_insert(i);
- add_fixed_icontext_list_item_icon(i, 0, get_image(list_of_icons[i]));
- add_fixed_icontext_list_item_icon(i, 1, get_image(list_of_icons2[i]));
- add_fixed_icontext_list_item_text(i, 0, NULL);
- }
- register_fixed_list_highlight_handler(cat14_list_highlight_handler);
- resize_fixed_icontext_list_menuitems(ixsize, iysize);
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY | UI_MENUITEM_HIGHLIGHT_SWITCH_ICON;
- MMI_current_menu_type = LIST_MENU;
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_SCROLLBAR | UI_LIST_MENU_DISABLE_BACKGROUND;
- MMI_fixed_matrix_menu.trigger_top_function = fixed_list_goto_previous_item;
- MMI_fixed_matrix_menu.trigger_bottom_function = fixed_list_goto_next_item;
- h_flag = set_list_matrix_menu_category_history(MMI_CATEGORY414_ID, history_buffer);
- if (h_flag)
- {
- back_from_history = MMI_TRUE;
- }
- else
- {
- back_from_history = MMI_FALSE;
- }
- gdi_layer_unlock_frame_buffer();
- restore_fixed_icontext_list_type();
- ExitCategoryFunction = ExitCategory414Screen;
- dm_add_image(get_image(IMG_MAIN_MENU_BG), NULL, NULL);
- #ifdef __MMI_TOUCH_SCREEN__
- wgui_register_category_screen_control_area_pen_handlers(
- Cate414CategoryControlAreaPenDownHandler,
- MMI_PEN_EVENT_DOWN);
- wgui_register_category_screen_control_area_pen_handlers(Cate414CategoryControlAreaPenUpHandler, MMI_PEN_EVENT_UP);
- wgui_register_category_screen_control_area_pen_handlers(
- Cate414CategoryControlAreaPenMoveHandler,
- MMI_PEN_EVENT_MOVE);
- wgui_register_category_screen_control_area_pen_handlers(
- Cate414CategoryControlAreaPenLongTapHandler,
- MMI_PEN_EVENT_LONG_TAP);
- wgui_register_category_screen_control_area_pen_handlers(
- Cate414CategoryControlAreaPenRepeatHandler,
- MMI_PEN_EVENT_REPEAT);
- wgui_register_category_screen_control_area_pen_handlers(
- Cate414CategoryControlAreaPenAbortHandler,
- MMI_PEN_EVENT_ABORT);
- #endif /* __MMI_TOUCH_SCREEN__ */
- dm_setup_category_functions(dm_redraw_category_screen, GetCategory414History, GetCategory414HistorySize);
- dm_register_category_controlled_callback(NULL);
- dm_data.s32CatId = MMI_CATEGORY414_ID;
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32flags = 0;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */