gui_fixed_menuitems.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:278k
源码类别:
MTK
开发平台:
C/C++
- }
- gui_measure_string(s, (S32*) & char_width, (S32*) & char_height);
- if (char_width <= line_width)
- {
- if (!r2lMMIFlag)
- {
- cursor_pos_x = x + ((line_width - char_width) >> 1);
- }
- else
- {
- cursor_pos_x = x - ((line_width - char_width) >> 1);
- }
- gui_move_text_cursor(cursor_pos_x, cursor_pos_y);
- gui_print_text(s);
- return;
- }
- gui_move_text_cursor(x, y);
- gui_push_clip();
- gui_set_clip(x, y, x + line_width, y + char_height);
- while (s[char_index] != terminal[0] && total_rows <= number_of_rows)
- {
- gui_measure_character(s[char_index], (S32*) & char_width, (S32*) & char_height);
- if (current_line_width + char_width < line_width - es_width)
- {
- gui_print_character(s[char_index++]);
- if (!r2lMMIFlag)
- {
- cursor_pos_x += char_width;
- }
- else
- {
- cursor_pos_x -= char_width;
- }
- current_line_width += char_width;
- gui_move_text_cursor(cursor_pos_x, cursor_pos_y);
- if (line_height < char_height)
- {
- line_height = char_height;
- }
- }
- else
- {
- if (total_rows < number_of_rows) /* still can add new lines */
- {
- if (line_height < char_height)
- {
- line_height = char_height;
- }
- total_rows++;
- cursor_pos_x = x;
- cursor_pos_y += line_height + 1;
- current_line_width = 0;
- gui_move_text_cursor(cursor_pos_x, cursor_pos_y);
- gui_print_character(s[char_index++]);
- if (!r2lMMIFlag)
- {
- cursor_pos_x += char_width;
- }
- else
- {
- cursor_pos_x -= char_width;
- }
- current_line_width += char_width;
- gui_move_text_cursor(cursor_pos_x, cursor_pos_y);
- }
- else
- {
- gui_print_text((UI_string_type) es);
- break;
- }
- }
- }
- gui_pop_clip();
- }
- #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */
- /*****************************************************************************
- * FUNCTION
- * gui_show_fixed_icontext_menuitem
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * common_item_data [?]
- * x [IN]
- * y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_show_fixed_icontext_menuitem(void *item, void *common_item_data, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1, y1, x2, y2;
- /* relative x offset of text inside menu item.
- (which might be different from m->text_x in Arabic or scrolling) */
- S32 text_x = 0;
- /* relative y offset of text inside menu item. */
- S32 text_y = 0;
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- S32 hint_height = 0;
- #endif
- #if (defined __MMI_UI_HINTS_IN_MENUITEM__ || defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__)
- MMI_BOOL show_hint_in_menuitem = MMI_FALSE;
- #endif
- S32 ani_w, ani_h;
- color text_color;
- UI_filled_area *f = NULL;
- fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) common_item_data;
- fixed_icontext_menuitem_type *mi = (fixed_icontext_menuitem_type*) item;
- U32 flags;
- UI_string_type _text;
- PU8 _icon;
- U8 animation_flag = 0;
- S32 sw = 0, sh = 0, max_text_width = 0;
- S32 is_text_full_width = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = mi->flags;
- flags |= m->flags;
- _text = mi->item_text;
- _icon = mi->item_icon;
- x1 = x;
- y1 = y;
- x2 = x1 + m->width - 1;
- y2 = y1 + m->height - 1;
- #ifdef __MMI_UI_HINTS_IN_MENUITEM__
- if ((m->ext_flags & UI_MENUITEM_SHOW_ALL_HINTS) ||
- ((flags & UI_MENUITEM_STATE_FOCUSSED) && (m->ext_flags & UI_MENUITEM_SHOW_HIGHLIGHTED_HINT)))
- {
- if (gui_get_current_pop_up_description_string())
- {
- show_hint_in_menuitem = MMI_TRUE;
- }
- }
- #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */
- #if (defined __MMI_UI_HINTS_IN_MENUITEM__ || defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__)
- if (show_hint_in_menuitem
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- || (m->ext_flags & UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT)
- #endif
- )
- {
- gui_show_two_line_icontext_menuitem(item, common_item_data, x, y);
- return;
- }
- #endif /* (defined __MMI_UI_HINTS_IN_MENUITEM__ || defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__) */
- if (flags & UI_MENUITEM_INLINE_EDIT_OBJECT)
- {
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- /* Remove the display of background filler when the default text effect is enabled */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (!(mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT))
- #endif
- {
- if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
- {
- gui_draw_filled_area(x1 + 2, y1, x2, y2, m->focussed_filler);
- }
- }
- /* display the focussed inline item with different coordinates when the default
- text effect is enabled. */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if ((mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT))
- {
- if (r2lMMIFlag)
- {
- gui_display_pop_up_description(x + 2, y + 1, m->width - m->text_x, ((m->height - 1) - 1));
- }
- else
- {
- gui_display_pop_up_description(x + m->text_x, y + 1, m->width - m->text_x, ((m->height - 1) - 1));
- }
- }
- else
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- {
- gui_display_pop_up_description(x + 2, y, m->width - 2, m->height);
- }
- }
- else
- {
- /* START TARUN PMT 20041016 : For Font size variation */
- gui_set_font(m->text_font);
- /* END TARUN PMT 20041016 */
- /* display the unfocussed inline item with different coordinates when the default
- text effect is enabled. */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if ((mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT))
- {
- if (r2lMMIFlag)
- {
- wgui_show_inline_edit_menuitem(x + 2, y + 1, m->width - m->text_x, ((m->height - 1) - 1));
- }
- else
- {
- wgui_show_inline_edit_menuitem(x + m->text_x, y + 1, m->width - m->text_x, ((m->height - 1) - 1));
- }
- }
- else
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- {
- wgui_show_inline_edit_menuitem(x + 2, y, m->width - 2, m->height);
- }
- }
- return;
- }
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_FOCUSED_ICONTEXT_ITEM;
- #endif
- GUI_current_fixed_icontext_menuitem_x = x;
- GUI_current_fixed_icontext_menuitem_y = y;
- }
- if (!(flags & UI_MENUITEM_DISABLE_TEXT_DISPLAY))
- {
- /* Autocalculate the text position based on font */
- gui_set_font(m->text_font);
- gui_measure_string(_text, &sw, &sh);
- if (flags & UI_MENUITEM_CENTER_TEXT_X)
- {
- m->text_x = (m->width >> 1) - (sw >> 1);
- }
- if (flags & UI_MENUITEM_CENTER_TEXT_Y)
- {
- m->text_y = (m->height >> 1) - (sh >> 1);
- }
- }
- /* Autocalculate the icon position */
- #ifndef __MMI_KP_STYLE_MAIN_MENU_MATRIX__ //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19
- if (_icon != UI_NULL_IMAGE)
- #endif //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19
- {
- S32 icon_width, icon_height;
- gui_measure_image(_icon, &icon_width, &icon_height);
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 start
- #ifdef __MMI_KP_STYLE_MAIN_MENU_MATRIX__
- if(GetActiveScreenId() == MAIN_MENU_SCREENID)
- {
- //jerson modify begin 20070625
- #if defined(__MMI_MAINLCD_176X220__)
- icon_width = 58;
- icon_height =45;
- #elif defined(__MMI_MAINLCD_240X320__)
- icon_width = 80;
- icon_height =66;
- #endif
- //jerson modify end 20070625
- }
- #endif
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 end
- if (flags & UI_MENUITEM_CENTER_ICON_X)
- {
- m->icon_x = (m->width >> 1) - (icon_width >> 1);
- }
- if (flags & UI_MENUITEM_CENTER_ICON_Y)
- {
- m->icon_y = (m->height >> 1) - (icon_height >> 1);
- }
- }
- /* Compute text_x and text_y */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (MMI_current_menu_type == LIST_MENU)
- {
- text_x = m->text_x + TEXT_ICON_GAP; /* To show gap from grid */
- }
- else
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- {
- text_x = m->text_x;
- }
- text_y = m->text_y;
- /* For inline edit captions to appear from left when there is no icon */
- if ((flags & UI_MENUITEM_DISABLE_ICON) && (_icon == UI_NULL_IMAGE))
- {
- is_text_full_width = 1;
- text_x = 2;
- }
- if (r2lMMIFlag)
- {
- text_x = m->width - 1 - text_x;
- }
- #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
- if (MMI_current_menu_type == LIST_MATRIX_MENU)
- {
- is_text_full_width = 1;
- }
- #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- /* To hide the text and icon of the menuitem up to the last frame for flash feel effect */
- if (gblock_list_effect == 0)
- {
- if (gui_get_current_list_effect() == MMI_UI_LIST_HIGHLIGHT_EFFECT_FLASH_FEELING &&
- MMI_current_menu_type == LIST_MENU)
- {
- if (flash_feel_last_frame == 0)
- {
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- _icon = UI_NULL_IMAGE;
- flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY;
- }
- }
- }
- }
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- /* Setup text scroll and background filler */
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- text_x += m->scroll_x;
- }
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && (flags & UI_MENUITEM_FOCUSSED_ANIMATE))
- {
- animation_flag = 1;
- }
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(flags & UI_MENUITEM_DISABLE_HIGHLIGHT))
- {
- if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
- {
- f = m->focussed_filler;
- }
- text_color = m->focussed_text_color;
- }
- else if (flags & UI_MENUITEM_STATE_DISABLED)
- {
- if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND) && !(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
- {
- f = m->disabled_filler;
- }
- text_color = m->focussed_text_color;
- }
- else if (flags & UI_MENUITEM_STATE_SELECTED)
- {
- f = m->selected_filler;
- text_color = m->selected_text_color;
- if (flags & UI_MENUITEM_SELECTED_ANIMATE)
- {
- animation_flag = 1;
- }
- }
- else
- {
- if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND) && !(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
- {
- f = m->normal_filler;
- }
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- // if condition is not correct. It fails when any other flag is ON
- // along with UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT.
- if (mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT)
- {
- f = m->selected_filler;
- }
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- text_color = m->normal_text_color;
- }
- gui_push_clip();
- if (MMI_current_menu_type == MATRIX_MENU)
- {
- if (animation_flag)
- {
- gui_measure_image(MMI_mm_animation, &ani_w, &ani_h);
- if (ani_w > m->width)
- {
- m->icon_x -= ((ani_w - m->width) >> 1); /* 030705 Calvin added */
- //if ( ( x1+m->icon_x - ((ani_w-m->width)>>1) ) > MMI_fixed_matrix_menu.x )
- // m->icon_x -= ((ani_w-m->width)>>1);
- //if ( x1+m->icon_x+ani_w > MMI_fixed_matrix_menu.x+MMI_fixed_matrix_menu.width )
- // m->icon_x -= ((ani_w-m->width)>>1);
- if (x1 + m->icon_x < MMI_fixed_matrix_menu.x)
- {
- m->icon_x = MMI_fixed_matrix_menu.x - x1;
- }
- if (x1 + m->icon_x + ani_w > MMI_fixed_matrix_menu.x + MMI_fixed_matrix_menu.width)
- {
- m->icon_x = MMI_fixed_matrix_menu.x + MMI_fixed_matrix_menu.width - x1 - ani_w;
- }
- }
- if (ani_h > m->height)
- {
- m->icon_y -= ((ani_h - m->height) >> 1); /* 030705 Calvin added */
- //if ( ( y1+m->icon_y - ((ani_h-m->height)>>1) ) > MMI_fixed_matrix_menu.y )
- // m->icon_y -= ((ani_h-m->height)>>1);
- //if ( y1+m->icon_y+ani_h > MMI_fixed_matrix_menu.y+MMI_fixed_matrix_menu.height )
- // m->icon_y -= ((ani_h-m->height)>>1);
- if (y1 + m->icon_y < MMI_fixed_matrix_menu.y)
- {
- m->icon_y = MMI_fixed_matrix_menu.y - y1;
- }
- if (y1 + m->icon_y + ani_h > MMI_fixed_matrix_menu.y + MMI_fixed_matrix_menu.height)
- {
- m->icon_y = MMI_fixed_matrix_menu.y + MMI_fixed_matrix_menu.height - y1 - ani_h;
- }
- }
- gui_set_clip(x1 + m->icon_x, y1 + m->icon_y, x1 + m->icon_x + ani_w - 1, y1 + m->icon_y + ani_h - 1);
- }
- else
- {
- gui_measure_image(_icon, &ani_w, &ani_h);
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 start
- #ifdef __MMI_KP_STYLE_MAIN_MENU_MATRIX__
- if(GetActiveScreenId() == MAIN_MENU_SCREENID)
- {
- //jerson modify begin 20070625
- #if defined(__MMI_MAINLCD_176X220__)
- ani_w = 58;
- ani_h =45;
- #elif defined(__MMI_MAINLCD_240X320__)
- ani_w = 80;
- ani_h =66;
- #endif
- //jerson modify end 20070625
- }
- #endif
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 end
- gui_set_clip(x1, y1, x1 + m->width + ani_w - 1, y1 + m->height + ani_h - 1);
- }
- }
- else
- {
- if (MMI_current_menu_type == MATRIX_MENU_EMS)
- {
- gui_set_clip(x1 - 1, y1 - 1, x2 + 1, y2 + 1);
- }
- else
- {
- gui_set_clip(x1, y1, x2, y2);
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- hint_height = 0;
- if (_icon != UI_NULL_IMAGE && line_draw && MMI_current_menu_type == LIST_MENU)
- {
- if (r2lMMIFlag)
- {
- gui_draw_vertical_line(y1, y2 + hint_height, (x2 - (m->text_x + TEXT_ICON_GAP) + ((TEXT_ICON_GAP) >> 1)), current_MMI_theme->list_background_filler->border_color); /* Assume icon is square in shape add 2 for inline edit items having gap from grid */
- }
- else
- {
- gui_draw_vertical_line(y1, y2 + hint_height, m->text_x - ((TEXT_ICON_GAP) >> 1) + 2, current_MMI_theme->list_background_filler->border_color); /* Assume icon is square in shape add 2 for inline edit items having gap from grid */
- }
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- }
- }
- if (m->flags & UI_MENUITEM_DISABLE_HIGHLIGHT_DISPLAY)
- {
- f = NULL;
- }
- if (MMI_current_menu_type != MATRIX_MENU && f != NULL && MMI_current_menu_type != MATRIX_MENU_EMS)
- {
- #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
- if (MMI_current_menu_type == LIST_MATRIX_MENU)
- {
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- set_start_position_and_item_parameters_for_list_highlighter_effect(item, common_item_data, x1, y1);
- #endif
- if (r2lMMIFlag)
- {
- gui_draw_filled_area(x1, y1 + text_y, x1 + text_x, y2, f);
- }
- else
- {
- gui_draw_filled_area(x1 + text_x, y1 + text_y, x2, y2, f);
- }
- }
- else
- #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */
- {
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- // if condition is not correct. It fails when any other flag is ON
- // along with UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT.
- if (mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT)
- {
- /* gui_draw_filled_area(x1 + m->text_x - 1, y1 + 2, x2, y2-1, f); */
- if (r2lMMIFlag)
- {
- gui_draw_filled_area(x1 + 1, y1 + 1, x2 - m->text_x + 1, y2 - 1, f);
- }
- else
- {
- gui_draw_filled_area(x1 + m->text_x, y1 + 1, x2, y2 - 1, f);
- }
- }
- else
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- {
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- if (is_draw_next_frame_list_highlight_effect_value())
- #endif
- {
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_HIGHLIGHT_ICONTEXT_ITEM;
- }
- #endif
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- set_start_position_and_item_parameters_for_list_highlighter_effect(item, common_item_data, x1, y1);
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw)
- {
- gui_draw_list_filled_area(x1 + 1, y1 + 1, x2, y2, f);
- }
- else
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- gui_draw_list_filled_area(x1 + 1, y1, x2, y2, f);
- #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw && GUI_current_fixed_icontext_menuitem_scroll)
- {
- gui_draw_filled_area(x1 + 1, y1 + 1, x2, y2, f);
- }
- else
- {
- gui_draw_filled_area(x1 + 1, y1, x2, y2, f);
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- gui_draw_filled_area(x1, y1, x2, y2, &f1);
- gui_draw_filled_area(x1 + 1, y1+1, x2-1, y2-1, f);
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- }
- }
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw && MMI_current_menu_type == LIST_MENU)
- {
- if (!r2lMMIFlag)
- {
- gui_draw_vertical_line(MMI_fixed_list_menu.y + 1, MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 2, MMI_fixed_list_menu.x, current_MMI_theme->list_background_filler->border_color); /* line from top to end at left end */
- gui_draw_vertical_line(MMI_fixed_list_menu.y + 1, MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 2, MMI_fixed_list_menu.vbar.x - 2, current_MMI_theme->list_background_filler->border_color); /* line from top to end at right end */
- }
- }
- if (_icon != UI_NULL_IMAGE && line_draw && MMI_current_menu_type == LIST_MENU)
- {
- if (r2lMMIFlag)
- {
- gui_draw_vertical_line(y1, y2 + hint_height, (x2 - (m->text_x + TEXT_ICON_GAP) + ((TEXT_ICON_GAP) >> 1)) /*-(((TEXT_ICON_GAP )>>1)) */ , current_MMI_theme->list_background_filler->border_color); /* Assume icon is square in shape add 2 for inline edit items having gap from grid */
- }
- else
- {
- gui_draw_vertical_line(y1, y2 + hint_height, m->text_x - ((TEXT_ICON_GAP) >> 1) + 2, current_MMI_theme->list_background_filler->border_color); /* vertical partion between icon and text add 2 for inline edit items having gap from grid */
- }
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- }
- #ifndef __MMI_KP_STYLE_MAIN_MENU_MATRIX__ //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19
- if (_icon != UI_NULL_IMAGE && !((m->ext_flags & UI_MENUITEM_EXT_SHOW_IN_MARQUEE) && animation_flag))
- #endif //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19
- {
- if (mi->item_icon_handle != GDI_ERROR_HANDLE)
- {
- gdi_image_stop_animation(mi->item_icon_handle);
- mi->item_icon_handle = GDI_ERROR_HANDLE;
- }
- if (animation_flag)
- {
- #if(UI_MAIN_MENU_ANIMATION_TYPE == UI_MAIN_MENU_ANIMATION_TYPE1)
- /* to store animation handle. */
- gdi_image_draw_animation(x1 + m->icon_x, y1 + m->icon_y, _icon, &mi->item_icon_handle);
- /* mi->item_icon_handle=gui_show_transparent_animated_image(x1+m->icon_x,y1+m->icon_y,_icon,m->icon_transparent_color); */
- #elif(UI_MAIN_MENU_ANIMATION_TYPE==UI_MAIN_MENU_ANIMATION_TYPE2)
- // mi->item_icon_handle=gui_show_transparent_animated_image_frames(x1+m->icon_x,y1+m->icon_y,_icon,m->icon_transparent_color,1,0);
- // gdi_image_draw_animation_frames(x1+m->icon_x,y1+m->icon_y,mi->item_icon,(gdi_handle *)&mi->item_icon_handle,1);
- if (MMI_current_menu_type == MATRIX_MENU)
- {
- gdi_image_draw_animation(
- x1 + m->icon_x,
- y1 + m->icon_y,
- MMI_mm_animation,
- (gdi_handle*) & mi->item_icon_handle);
- }
- else if (MMI_current_menu_type == MATRIX_MENU_EMS)
- {
- /* extern gdi_color GDI_COLOR_BLACK; */
- gdi_image_draw_animation(
- x1 + m->icon_x,
- y1 + m->icon_y,
- mi->item_icon,
- (gdi_handle*) & mi->item_icon_handle);
- gdi_draw_rect(x1 - 1, y1 - 1, x2 + 1, y2 + 1, GDI_COLOR_BLACK);
- }
- else
- {
- gdi_image_draw_animation(
- x1 + m->icon_x,
- y1 + m->icon_y,
- mi->item_icon,
- (gdi_handle*) & mi->item_icon_handle);
- }
- #endif /* UI_MAIN_MENU_ANIMATION_TYPE */
- }
- else if (m->flags & UI_MENUITEM_STATE_ANIMATE)
- {
- gui_show_transparent_animated_image_frame(
- x1 + m->icon_x,
- y1 + m->icon_y,
- _icon,
- m->icon_transparent_color,
- 1);
- m->flags &= ~UI_MENUITEM_STATE_ANIMATE;
- }
- else if (MMI_current_menu_type == LIST_MENU)
- {
- S32 x_clip = 0, y_clip = 0;
- gui_push_clip();
- if (m->icon_x > 0)
- {
- x_clip = m->icon_x;
- }
- if (m->icon_y > 0)
- {
- y_clip = m->icon_y;
- }
- if (!r2lMMIFlag)
- {
- gui_set_clip(x1 + x_clip, y1 + y_clip, x1 + m->text_x - 2, y1 + m->height - 2);
- gdi_image_draw_animation_single_frame(x1 + m->icon_x, y1 + m->icon_y, (U8*) _icon, 0);
- }
- else
- {
- gui_set_clip(x2 - m->text_x + 2, y1 + y_clip, x2 - x_clip, y1 + m->height - 2);
- gdi_image_draw_animation_single_frame(x2 - m->text_x + 2, y1 + m->icon_y, (U8*) _icon, 0);
- }
- gui_pop_clip();
- }
- else if(flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- gui_draw_filled_area(x1, y1, x2, y2, &f1);
- gui_draw_filled_area(x1 + 1, y1+1, x2-1, y2-1, f);
- gui_show_transparent_animated_image_frame(x1+m->icon_x,y1+m->icon_y,_icon,m->icon_transparent_color,0);
- }
- else
- {
- /* gui_show_transparent_animated_image_frame(x1+m->icon_x,y1+m->icon_y,_icon,m->icon_transparent_color,0); */
- gdi_image_draw_animation_single_frame(x1 + m->icon_x, y1 + m->icon_y, (U8*) _icon, 0);
- }
- }
- if (!(flags & UI_MENUITEM_DISABLE_TEXT_DISPLAY))
- {
- gui_push_text_clip();
- if (!(flags & UI_MENUITEM_DISABLE_TEXT_CLIP))
- {
- if (is_text_full_width)
- {
- /* FIXME. text_x might not be 0 */
- gui_set_text_clip(x1, y1, x2, y2);
- max_text_width = m->width;
- }
- else
- {
- if (m->icon_x > m->text_x)
- {
- gui_set_text_clip(x1, y1, x1 + m->icon_x - 1, y2);
- max_text_width = m->icon_x - m->text_x;
- }
- else
- {
- if (!r2lMMIFlag)
- {
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- gui_set_text_clip(x1 + m->text_x + TEXT_ICON_GAP, y1, x2 - 2, y2);
- #else /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- if (f && (f->flags & UI_FILLED_AREA_BORDER))
- {
- /* Leave space for border of background filler */
- gui_set_text_clip(x1 + m->text_x, y1, x2 - 2, y2);
- }
- else
- {
- gui_set_text_clip(x1 + m->text_x, y1, x2, y2);
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- }
- else
- {
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- gui_set_text_clip(x2 - m->width + 1 + TEXT_ICON_GAP, y1, x2 - m->text_x - TEXT_ICON_GAP, y2);
- #else /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- if (f && (f->flags & UI_FILLED_AREA_BORDER))
- {
- /* Leave space for border of background filler */
- gui_set_text_clip(x1 + 2, y1, x2 - m->text_x, y2);
- }
- else
- {
- gui_set_text_clip(x1, y1, x2 - m->text_x, y2);
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- }
- max_text_width = x2 - (x1 + m->text_x) + 1;
- }
- }
- }
- else
- {
- max_text_width = m->width - m->text_x;
- }
- /* move the cursor by 3 pixels when the default text effect is enabled and the
- menu item is to be shown inside rectangle. */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT)
- {
- if (!r2lMMIFlag)
- {
- gui_move_text_cursor(x1 + text_x + 3, y1 + text_y);
- }
- else
- {
- gui_move_text_cursor(x1 + text_x - 3, y1 + text_y);
- }
- }
- else
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- {
- gui_move_text_cursor(x1 + text_x, y1 + text_y);
- }
- gui_set_line_height(sh);
- gui_set_text_color(text_color);
- #if(UI_USE_WORD_SCROLLING_TEXT)
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && GUI_current_fixed_icontext_menuitem_scroll)
- {
- GUI_current_fixed_icontext_menuitem_scroll_text_end = GUI_current_fixed_icontext_menuitem_scroll_text;
- if (gui_print_truncated_text2
- (x1 + text_x, y1 + text_y, max_text_width, &GUI_current_fixed_icontext_menuitem_scroll_text_end))
- {
- GUI_current_fixed_icontext_menuitem_scroll_text_end = _text;
- }
- }
- else
- {
- gui_print_truncated_text2(x1 + text_x, y1 + text_y, max_text_width, &_text);
- }
- #else /* (UI_USE_WORD_SCROLLING_TEXT) */
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && (flags & UI_MENUITEM_MARQUEE_SCROLL) &&
- GUI_current_fixed_icontext_menuitem_scroll)
- {
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_HIGHLIGHT_ICONTEXT_MARQUEE_SCROLL;
- #endif
- /* fix long text in inline-select display overlap issue */
- if (!(mi->ext_flags & UI_MENUITEM_EXT_DISABLE_FOCUSSED_TEXT_DISPLAY))
- {
- gui_print_text(_text);
- }
- if (!r2lMMIFlag)
- {
- gui_move_text_cursor(x1 + text_x + m->text_width + UI_text_menuitem_scroll_gap, y1 + text_y);
- }
- else
- {
- gui_move_text_cursor(x1 + text_x - (m->text_width + UI_text_menuitem_scroll_gap), y1 + text_y);
- }
- gui_set_line_height(sh);
- gui_print_text(_text);
- }
- #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
- else if (MMI_current_menu_type == LIST_MATRIX_MENU)
- {
- print_wrap_string(_text, x1 + text_x, y1 + text_y, 1, max_text_width);
- }
- #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */
- else
- {
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- /*
- * Text is getting displayed behind the left button in case of Inline Selection
- * when the menu item is focussed. So remove the display of text when the item
- * is focussed and UI_MENUITEM_EXT_DISABLE_FOCUSSED_TEXT_DISPLAY flag is ON
- * for that item.
- */
- if (!
- ((flags & UI_MENUITEM_STATE_FOCUSSED) &&
- (mi->ext_flags & UI_MENUITEM_EXT_DISABLE_FOCUSSED_TEXT_DISPLAY)))
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- {
- gui_print_text(_text);
- }
- }
- #endif /* (UI_USE_WORD_SCROLLING_TEXT) */
- gui_pop_text_clip();
- }
- if (flags & UI_MENUITEM_DOTTED_UNDERLINE)
- {
- static const U8 dotted_line_bitvalues[] = {1, 1, 1, 1, 0, 0, 0};
- S32 r = max_text_width % 7; /* pattern width */
- if (r == 0)
- {
- r = 7;
- }
- gdi_draw_line_style(
- m->text_x,
- y2,
- m->text_x + max_text_width - 1 - r,
- y2,
- gdi_act_color_from_rgb(255, 112, 125, 240),
- sizeof(dotted_line_bitvalues),
- dotted_line_bitvalues);
- }
- gui_pop_clip();
- #if(UI_ENABLE_POP_UP_DESCRIPTIONS)
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(m->ext_flags & UI_MENUITEM_EXT_SHOW_IN_MARQUEE))
- {
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- /* pass the modified parameters in the function so that there is proper gapping
- between the menu items. */
- if (mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT)
- {
- gui_display_pop_up_description(x, y + 1, m->width, ((m->height - 1) - 1));
- }
- else
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- {
- gui_display_pop_up_description(x, y, m->width, m->height);
- }
- }
- #endif /* (UI_ENABLE_POP_UP_DESCRIPTIONS) */
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_HIGHLIGHT_NONE;
- #endif
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_menuitem_translate_pen_event
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * common_item_data [?]
- * item_x [IN]
- * item_y [IN]
- * pen_event [IN]
- * x [IN]
- * y [IN]
- * menuitem_event [?]
- * menuitem_param [?]
- * RETURNS
- *
- *****************************************************************************/
- BOOL gui_fixed_icontext_menuitem_translate_pen_event(
- void *item,
- void *common_item_data,
- S32 item_x,
- S32 item_y,
- mmi_pen_event_type_enum pen_event,
- S16 x,
- S16 y,
- gui_list_pen_enum *menuitem_event,
- gui_pen_event_param_struct *menuitem_param)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gui_wait_longpress_enum w;
- fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) common_item_data;
- fixed_icontext_menuitem_type *mi = (fixed_icontext_menuitem_type*) item;
- U32 flags = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (mi)
- {
- flags |= mi->flags;
- }
- if (m)
- {
- flags |= m->flags;
- }
- *menuitem_event = GUI_LIST_PEN_NONE;
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- /* FIXME: do not check pen up/down here */
- if( ( pen_event == MMI_PEN_EVENT_UP || pen_event == MMI_PEN_EVENT_DOWN ) && gui_get_two_line_menuitem_height())
- {
- mmi_two_line_translate_pen_event(x, y, pen_event, menuitem_event);
- if (*menuitem_event == GUI_LIST_PEN_TWO_LINE_NEXT || *menuitem_event == GUI_LIST_PEN_TWO_LINE_PREVIOUS)
- {
- if (pen_event == MMI_PEN_EVENT_DOWN)
- {
- *menuitem_event = GUI_LIST_PEN_NONE;
- }
- return MMI_TRUE;
- }
- }
- #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */
- GUI_PEN_EVENT_PARAM_SET_VOID(menuitem_param);
- if (flags & UI_MENUITEM_PEN_USE_LONGPRESS)
- {
- w = gui_pen_wait_longpress(pen_event, x, y);
- if (w == GUI_WAIT_LONGPRESS_READY)
- {
- *menuitem_event = GUI_LIST_PEN_ITEM_SELECTED;
- }
- return MMI_TRUE;
- }
- else
- {
- return MMI_FALSE;
- }
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * gui_hide_fixed_icontext_menuitem
- * DESCRIPTION
- * Hides a fixed icontext menuitem
- * PARAMETERS
- * item [IN] Is a specific fixed icontext menuitem object
- * common_item_data [IN] Is the fixed icontext menuitem object (common_data)
- * x [IN] Is the position at which the menuitem was displayed
- * y [IN] Is the position at which the menuitem was displayed
- * RETURNS
- * void
- *****************************************************************************/
- void gui_hide_fixed_icontext_menuitem(void *item, void *common_item_data, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1, y1, x2, y2, iwidth, iheight, ix1, iy1, ix2, iy2;
- UI_filled_area *f;
- fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) common_item_data;
- fixed_icontext_menuitem_type *mi = (fixed_icontext_menuitem_type*) item;
- U32 flags;
- PU8 _icon;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = mi->flags;
- flags |= m->flags;
- _icon = mi->item_icon;
- /* Autocalculate the icon position */
- if (_icon != UI_NULL_IMAGE)
- {
- S32 icon_width, icon_height;
- gui_measure_image(_icon, &icon_width, &icon_height);
- if (flags & UI_MENUITEM_CENTER_ICON_X)
- {
- m->icon_x = (m->width >> 1) - (icon_width >> 1);
- }
- if (flags & UI_MENUITEM_CENTER_ICON_Y)
- {
- m->icon_y = (m->height >> 1) - (icon_height >> 1);
- }
- }
- x1 = x;
- y1 = y;
- x2 = x1 + m->width - 1;
- y2 = y1 + m->height - 1;
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(flags & UI_MENUITEM_DISABLE_HIGHLIGHT))
- {
- f = m->focussed_filler;
- }
- else if (flags & UI_MENUITEM_STATE_DISABLED)
- {
- f = m->disabled_filler;
- }
- else if (flags & UI_MENUITEM_STATE_SELECTED)
- {
- f = m->selected_filler;
- }
- else
- {
- f = m->normal_filler;
- }
- gui_set_clip(x1, y1, x2, y2);
- gui_measure_image(_icon, &iwidth, &iheight);
- ix1 = m->icon_x + x1;
- iy1 = m->icon_y + y1;
- ix2 = ix1 + iwidth - 1;
- iy2 = iy1 + iheight - 1;
- gui_push_clip();
- gui_set_clip(ix1, iy1, ix2, iy2);
- gui_draw_filled_area(x1, y1, x2, y2, f);
- gui_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * gui_measure_fixed_icontext_menuitem
- * DESCRIPTION
- * Measures a fixed icontext menuitem
- * PARAMETERS
- * item [?]
- * common_item_data [IN] Is the fixed icontext menuitem object (common_data)
- * width [OUT]
- * height [OUT]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_measure_fixed_icontext_menuitem(void *item, void *common_item_data, S32 *width, S32 *height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_icontext_menuitem *t = (fixed_icontext_menuitem*) common_item_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item);
- *width = t->width;
- *height = t->height;
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- // TODO: configure UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT in other place
- if (current_fixed_list_menuitem_display_index == -1 && gui_get_two_line_menuitem_height())
- {
- *height = *height << 1;
- t->ext_flags |= UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT;
- return;
- }
- else
- {
- t->ext_flags &= ~UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT;
- }
- #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */
- #ifdef __MMI_UI_HINTS_IN_MENUITEM__
- if (t->ext_flags & UI_MENUITEM_SHOW_HIGHLIGHTED_HINT && current_fixed_list_menuitem_display_index == -1 &&
- gui_get_current_pop_up_description_string())
- {
- *height = (*height) << 1;
- }
- else if (t->ext_flags & UI_MENUITEM_SHOW_ALL_HINTS && gui_get_current_pop_up_description_string())
- {
- *height = (*height) << 1;
- }
- #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_highlight_fixed_icontext_menuitem
- * DESCRIPTION
- * Highlights a fixed icontext menuitem (not visually)
- * PARAMETERS
- * item [IN] Is a specific fixed icontext menuitem object
- * common_item_data [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_highlight_fixed_icontext_menuitem(void *item, void *common_item_data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_icontext_menuitem_type *t = (fixed_icontext_menuitem_type*) item;
- fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) common_item_data;
- U32 flags;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = m->flags;
- flags |= t->flags;
- GUI_current_fixed_icontext_menuitem_common_data = m;
- GUI_current_fixed_icontext_menuitem_data = t;
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- gui_set_current_two_line_menuitem_data();
- #endif
- gui_fixed_icontext_menuitem_stop_scroll();
- #ifdef __MMI_UI_HINTS_IN_MENUITEM__
- gui_resize_fixed_icontext_menuitem(m, m->width, m->height);
- if (MMI_current_menu_type == LIST_MATRIX_MENU)
- {
- m->scroll_width = m->width - m->text_x;
- }
- #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */
- gui_fixed_icontext_menuitem_start_scroll();
- if (t->flags & UI_MENUITEM_DISABLE_HIGHLIGHT)
- {
- return;
- }
- t->flags |= UI_MENUITEM_STATE_FOCUSSED;
- t->flags |= UI_MENUITEM_STATE_ANIMATE;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_remove_highlight_fixed_icontext_menuitem
- * DESCRIPTION
- * Removes the highlight of a fixed icontext menuitem (not visually)
- * PARAMETERS
- * item [IN] Is a specific fixed icontext menuitem object
- * common_item_data [IN]
- * RETURNS
- * void
- *****************************************************************************/
- #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
- static scrolling_text gui_two_line_scroll_text;
- #endif
- void gui_remove_highlight_fixed_icontext_menuitem(void *item, void *common_item_data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_icontext_menuitem_type *t = (fixed_icontext_menuitem_type*) item;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
- gui_scrolling_text_stop(&gui_two_line_scroll_text);
- #endif
- UI_UNUSED_PARAMETER(common_item_data);
- t->flags &= ~UI_MENUITEM_STATE_FOCUSSED;
- #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
- gui_reset_current_two_line_menuitem_data();
- #endif
- t->flags &= ~UI_MENUITEM_STATE_ANIMATE;
- if (t->item_icon_handle != GDI_ERROR_HANDLE)
- {
- gdi_image_stop_animation(t->item_icon_handle);
- t->item_icon_handle = GDI_ERROR_HANDLE;
- }
- }
- /* GUI: fixed icon text list menuitem functions */
- UI_fixed_icontext_list_menuitem_theme *current_fixed_icontext_list_menuitem_theme = NULL;
- /*****************************************************************************
- * FUNCTION
- * gui_set_fixed_icontext_list_menuitem_current_theme
- * DESCRIPTION
- * Applies the current theme to a fixed icontext list menuitem
- * PARAMETERS
- * m [IN] Is the fixed icontext list menuitem object (common data)
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- UI_filled_area fixed_icontext_list_menuitem_transparent_filled_area;
- #endif
- void gui_set_fixed_icontext_list_menuitem_current_theme(fixed_icontext_list_menuitem *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->disabled_filler = current_fixed_icontext_list_menuitem_theme->disabled_filler;
- m->flags |= current_fixed_icontext_list_menuitem_theme->flags;
- m->focussed_filler = current_fixed_icontext_list_menuitem_theme->focussed_filler;
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- if (!m->focussed_filler->flags & UI_FILLED_AREA_TYPE_BITMAP)
- {
- fixed_icontext_list_menuitem_transparent_filled_area = *(m->focussed_filler);
- m->focussed_filler = &fixed_icontext_list_menuitem_transparent_filled_area;
- fixed_icontext_list_menuitem_transparent_filled_area.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- fixed_icontext_list_menuitem_transparent_filled_area.c.alpha = HIGHLIGHTER_COLOR_OPACITY_VALUE;
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- m->normal_filler = current_fixed_icontext_list_menuitem_theme->normal_filler;
- m->selected_filler = current_fixed_icontext_list_menuitem_theme->selected_filler;
- for (i = 0; i < m->n_text_columns; i++)
- {
- m->normal_text_colors[i] = current_fixed_icontext_list_menuitem_theme->normal_text_colors[i];
- m->focussed_text_colors[i] = current_fixed_icontext_list_menuitem_theme->focussed_text_colors[i];
- m->selected_text_colors[i] = current_fixed_icontext_list_menuitem_theme->selected_text_colors[i];
- m->disabled_text_colors[i] = current_fixed_icontext_list_menuitem_theme->disabled_text_colors[i];
- m->text_fonts[i] = current_fixed_icontext_list_menuitem_theme->text_fonts[i];
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_set_fixed_icontext_list_menuitem_theme
- * DESCRIPTION
- * Applies the given theme to a fixed icontext list menuitem
- * PARAMETERS
- * m [IN] Is the fixed icontext list menuitem object (common data)
- * t [IN] Is the theme
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_fixed_icontext_list_menuitem_theme(
- fixed_icontext_list_menuitem *m,
- UI_fixed_icontext_list_menuitem_theme *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->disabled_filler = t->disabled_filler;
- m->flags |= t->flags;
- m->focussed_filler = t->focussed_filler;
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- if (!m->focussed_filler->flags & UI_FILLED_AREA_TYPE_BITMAP)
- {
- fixed_icontext_list_menuitem_transparent_filled_area = *(m->focussed_filler);
- m->focussed_filler = &fixed_icontext_list_menuitem_transparent_filled_area;
- fixed_icontext_list_menuitem_transparent_filled_area.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- fixed_icontext_list_menuitem_transparent_filled_area.c.alpha = HIGHLIGHTER_COLOR_OPACITY_VALUE;
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- m->normal_filler = t->normal_filler;
- m->selected_filler = t->selected_filler;
- for (i = 0; i < m->n_text_columns; i++)
- {
- m->normal_text_colors[i] = t->normal_text_colors[i];
- m->focussed_text_colors[i] = t->focussed_text_colors[i];
- m->selected_text_colors[i] = t->selected_text_colors[i];
- m->disabled_text_colors[i] = t->disabled_text_colors[i];
- m->text_fonts[i] = t->text_fonts[i];
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_create_fixed_icontext_list_menuitem
- * DESCRIPTION
- * Creates a fixed icontext list menuitem
- * PARAMETERS
- * m [IN] Is the fixed icontext list menuitem object (common data)
- * width [IN] Width is the width of the fixed icontext list menuitem
- * height [IN] Height is the height of the fixed icontext list menuitem
- * n_text_columns [IN] Is the number of text columns
- * n_icon_columns [IN] Is the number of icon columns
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_fixed_icontext_list_menuitem(
- fixed_icontext_list_menuitem *m,
- S32 width,
- S32 height,
- S32 n_text_columns,
- S32 n_icon_columns)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->width = width;
- m->height = height;
- m->flags = 0;
- m->ext_flags = 0;
- m->icon_transparent_color = gui_transparent_color(0, 0, 0);
- if (n_icon_columns > FIXED_ICONTEXT_LIST_MAX_ICON_COLUMNS)
- {
- n_icon_columns = FIXED_ICONTEXT_LIST_MAX_ICON_COLUMNS;
- }
- if (n_text_columns > FIXED_ICONTEXT_LIST_MAX_TEXT_COLUMNS)
- {
- n_text_columns = FIXED_ICONTEXT_LIST_MAX_TEXT_COLUMNS;
- }
- m->n_icon_columns = n_icon_columns;
- m->n_text_columns = n_text_columns;
- gui_set_fixed_icontext_list_menuitem_current_theme(m);
- m->scroll_x = 0;
- m->scroll_width = width;
- m->post_display_function = NULL;
- m->parent_list = NULL;
- m->parent_matrix = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_list_menuitem_set_post_display
- * DESCRIPTION
- *
- * PARAMETERS
- * m [?]
- * post_display_function [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_list_menuitem_set_post_display(
- fixed_icontext_list_menuitem *m,
- void (*post_display_function) (void *item, void *common_item_data, S32 x, S32 y))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->post_display_function = post_display_function;
- }
- /* Text scrolling related functions within the menu item */
- fixed_icontext_list_menuitem *GUI_current_fixed_icontext_list_menuitem_common_data = NULL;
- fixed_icontext_list_menuitem_type *GUI_current_fixed_icontext_list_menuitem_data = NULL;
- U8 GUI_current_fixed_icontext_list_menuitem_scroll = 0;
- U8 GUI_current_fixed_icontext_list_menuitem_scroll_direction;
- S32 GUI_current_fixed_icontext_list_menuitem_x;
- S32 GUI_current_fixed_icontext_list_menuitem_y;
- S32 GUI_current_fixed_icontext_list_menuitem_scroll_counter = 0;
- /* Current text column for marqueeing. Auto selected with UI_MENUITEM_AUTO_CHOOSE_MARQUEE. */
- S32 GUI_current_fixed_icontext_list_menuitem_column = 0;
- UI_string_type GUI_current_fixed_icontext_list_menuitem_scroll_text = NULL;
- UI_string_type GUI_current_fixed_icontext_list_menuitem_scroll_text_end = NULL;
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_list_menuitem_scroll_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_list_menuitem_scroll_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 flags = GUI_current_fixed_icontext_list_menuitem_common_data->flags;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags |= GUI_current_fixed_icontext_list_menuitem_data->flags;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_reset_current_list_effect();
- #endif
- if (GUI_current_fixed_icontext_list_menuitem_scroll_counter)
- {
- GUI_current_fixed_icontext_list_menuitem_scroll_counter--;
- }
- else
- {
- #if(UI_USE_WORD_SCROLLING_TEXT)
- GUI_current_fixed_icontext_list_menuitem_scroll_text = GUI_current_fixed_icontext_list_menuitem_scroll_text_end;
- #else /* (UI_USE_WORD_SCROLLING_TEXT) */
- if (flags & UI_MENUITEM_MARQUEE_SCROLL)
- {
- if (!r2lMMIFlag)
- {
- GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x -= UI_text_menuitem_scroll_size;
- if (GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x <=
- (-(GUI_current_fixed_icontext_list_menuitem_common_data->text_width + UI_text_menuitem_scroll_gap)))
- {
- GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x = 0;
- }
- }
- else
- {
- GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x += UI_text_menuitem_scroll_size;
- if (GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x >=
- (GUI_current_fixed_icontext_list_menuitem_common_data->text_width + UI_text_menuitem_scroll_gap))
- {
- GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x = 0;
- }
- }
- }
- else
- {
- if (GUI_current_fixed_icontext_list_menuitem_scroll_direction == 0)
- {
- GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x -= UI_text_menuitem_scroll_size;
- if ((GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x +
- GUI_current_fixed_icontext_list_menuitem_common_data->text_width) <=
- (GUI_current_fixed_icontext_list_menuitem_common_data->scroll_width))
- {
- GUI_current_fixed_icontext_list_menuitem_scroll_direction = 1;
- GUI_current_fixed_icontext_list_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- }
- }
- else if (GUI_current_fixed_icontext_list_menuitem_scroll_direction == 1)
- {
- GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x += UI_text_menuitem_scroll_size;
- if (GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x >= 0)
- {
- GUI_current_fixed_icontext_list_menuitem_scroll_direction = 0;
- GUI_current_fixed_icontext_list_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- }
- }
- }
- #endif /* (UI_USE_WORD_SCROLLING_TEXT) */
- GUI_current_fixed_icontext_list_menuitem_common_data->ext_flags |= UI_MENUITEM_EXT_SHOW_IN_MARQUEE;
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- if (!gui_is_current_transparency_with_multi_layer())
- {
- gui_fixed_icontext_list_disable_transparent_effect(GUI_current_fixed_icontext_list_menuitem_common_data); /* To hide text below scrolling text */
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- gui_show_fixed_icontext_list_menuitem(
- (void*)GUI_current_fixed_icontext_list_menuitem_data,
- (void*)GUI_current_fixed_icontext_list_menuitem_common_data,
- GUI_current_fixed_icontext_list_menuitem_x,
- GUI_current_fixed_icontext_list_menuitem_y);
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- gui_fixed_icontext_list_enable_transparent_effect(GUI_current_fixed_icontext_list_menuitem_common_data); /* To enable transparency */
- #endif
- GUI_current_fixed_icontext_list_menuitem_common_data->ext_flags &= ~UI_MENUITEM_EXT_SHOW_IN_MARQUEE;
- gui_BLT_double_buffer(
- GUI_current_fixed_icontext_list_menuitem_x,
- GUI_current_fixed_icontext_list_menuitem_y,
- GUI_current_fixed_icontext_list_menuitem_x + GUI_current_fixed_icontext_list_menuitem_common_data->width - 1,
- GUI_current_fixed_icontext_list_menuitem_y + GUI_current_fixed_icontext_list_menuitem_common_data->height - 1);
- }
- gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_icontext_list_menuitem_scroll_handler);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_list_menuitem_reset_scroll_text_column
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_list_menuitem_reset_scroll_text_column(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* This cannot be done in gui_fixed_icontext_list_menuitem_stop_scroll()
- because we need to keep text scroll column unchanged when highlight is switched */
- GUI_current_fixed_icontext_list_menuitem_column = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_list_menuitem_start_scroll
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_list_menuitem_start_scroll(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_icontext_list_menuitem_type *t =
- (fixed_icontext_list_menuitem_type*) GUI_current_fixed_icontext_list_menuitem_data;
- fixed_icontext_list_menuitem *m =
- (fixed_icontext_list_menuitem*) GUI_current_fixed_icontext_list_menuitem_common_data;
- S32 w;
- U32 flags;
- BOOL do_scroll = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = m->flags;
- flags |= t->flags;
- gui_add_cleanup_hook(gui_fixed_icontext_list_menuitem_reset_scroll_text_column);
- if (flags & UI_MENUITEM_AUTO_CHOOSE_MARQUEE)
- {
- S32 i;
- for (i = 0; i < m->n_text_columns; i++)
- {
- gui_set_font(m->text_fonts[i]);
- w = gui_get_string_width(t->item_texts[i]);
- m->text_width = w;
- m->scroll_x = 0;
- if (w >= m->text_coordinates[i].width - 1)
- {
- GUI_current_fixed_icontext_list_menuitem_column = i;
- m->scroll_width = m->text_coordinates[i].width;
- do_scroll = MMI_TRUE;
- break;
- }
- }
- }
- else
- {
- if (GUI_current_fixed_icontext_list_menuitem_column >= m->n_text_columns)
- {
- MMI_DBG_ASSERT(0);
- GUI_current_fixed_icontext_list_menuitem_column = 0;
- }
- gui_set_font(m->text_fonts[GUI_current_fixed_icontext_list_menuitem_column]);
- w = gui_get_string_width(t->item_texts[GUI_current_fixed_icontext_list_menuitem_column]);
- m->text_width = w;
- m->scroll_x = 0;
- if (w >= m->scroll_width - 1)
- {
- do_scroll = MMI_TRUE;
- }
- }
- if (do_scroll)
- {
- #if(UI_USE_WORD_SCROLLING_TEXT)
- GUI_current_fixed_icontext_list_menuitem_scroll_text =
- t->item_texts[GUI_current_fixed_icontext_list_menuitem_column];
- GUI_current_fixed_icontext_list_menuitem_scroll = 1;
- GUI_current_fixed_icontext_list_menuitem_scroll_direction = 0;
- GUI_current_fixed_icontext_list_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- if (gui_get_current_list_effect() && gblock_list_effect != 1)
- {
- gui_register_callback_menuitem_scroll(gui_fixed_icontext_list_menuitem_scroll_handler);
- }
- else
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_icontext_list_menuitem_scroll_handler);
- }
- #else /* (UI_USE_WORD_SCROLLING_TEXT) */
- if ((flags & UI_MENUITEM_MARQUEE_SCROLL) || (flags & UI_MENUITEM_TWO_DIRECTION_SCROLL))
- {
- GUI_current_fixed_icontext_list_menuitem_scroll = 1;
- GUI_current_fixed_icontext_list_menuitem_scroll_direction = 0;
- GUI_current_fixed_icontext_list_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- if (gui_get_current_list_effect() && gblock_list_effect != 1)
- {
- gui_register_callback_menuitem_scroll(gui_fixed_icontext_list_menuitem_scroll_handler);
- }
- else
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_icontext_list_menuitem_scroll_handler);
- }
- }
- #endif /* (UI_USE_WORD_SCROLLING_TEXT) */
- }
- else
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- {
- gui_register_callback_menuitem_scroll(gui_dummy_scroll_handler_for_list_effects);
- GUI_current_fixed_icontext_list_menuitem_scroll = 0;
- }
- #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- GUI_current_fixed_icontext_list_menuitem_scroll = 0;
- }
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_list_menuitem_stop_scroll
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_list_menuitem_stop_scroll(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GUI_current_fixed_icontext_list_menuitem_scroll)
- {
- gui_cancel_timer(gui_fixed_icontext_list_menuitem_scroll_handler);
- GUI_current_fixed_icontext_list_menuitem_scroll = 0;
- }
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_register_callback_menuitem_scroll(gui_dummy_scroll_handler_for_list_effects);
- gui_restore_current_list_effect();
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_list_menuitem_set_text_coordinates
- * DESCRIPTION
- * Sets the co-ordinates for a text column
- * PARAMETERS
- * m [IN] Is the fixed icontext list menuitem object (common data)
- * text_column [IN] Is the column number of the text column (zero based)
- * x [IN] Is the position of this text column within the menuitem
- * y [IN] Is the position of this text column within the menuitem
- * width [IN] Are the dimensions of the this text column
- * height [IN] Are the dimensions of the this text column
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_list_menuitem_set_text_coordinates(
- fixed_icontext_list_menuitem *m,
- S32 text_column,
- S32 x,
- S32 y,
- S32 width,
- S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (text_column >= m->n_text_columns)
- {
- return;
- }
- m->text_coordinates[text_column].x = x;
- m->text_coordinates[text_column].y = y;
- m->text_coordinates[text_column].width = width;
- m->text_coordinates[text_column].height = height;
- if (text_column == GUI_current_fixed_icontext_list_menuitem_column)
- {
- m->scroll_width = width;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_list_menuitem_set_icon_coordinates
- * DESCRIPTION
- * Sets the co-ordinates for a icon column
- * PARAMETERS
- * m [IN] Is the fixed icontext list menuitem object (common data)
- * icon_column [IN] Is the column number of the icon column (zero based)
- * x [IN] Is the position of this icon column within the menuitem
- * y [IN] Is the position of this icon column within the menuitem
- * width [IN] Are the dimensions of the this icon column
- * height [IN] Are the dimensions of the this icon column
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_list_menuitem_set_icon_coordinates(
- fixed_icontext_list_menuitem *m,
- S32 icon_column,
- S32 x,
- S32 y,
- S32 width,
- S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (icon_column >= m->n_icon_columns)
- {
- return;
- }
- m->icon_coordinates[icon_column].x = x;
- m->icon_coordinates[icon_column].y = y;
- m->icon_coordinates[icon_column].width = width;
- m->icon_coordinates[icon_column].height = height;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_resize_fixed_icontext_list_menuitem
- * DESCRIPTION
- * Changes the size of a fixed icontext list menuitem
- * PARAMETERS
- * m [IN] Is the fixed icontext list menuitem object (common data)
- * width [IN] Is the new width
- * height [IN] Is the new height
- * RETURNS
- * void
- *****************************************************************************/
- void gui_resize_fixed_icontext_list_menuitem(fixed_icontext_list_menuitem *m, S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->width = width;
- m->height = height;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_show_fixed_icontext_list_menuitem
- * DESCRIPTION
- * Displays the fixed icontext list menuitem
- * PARAMETERS
- * item [IN] Is a specific fixed icontext list menuitem object
- * common_item_data [IN] Is the fixed icontext list menuitem object (common_data)
- * x [IN] Is the position at which the menuitem is displayed
- * y [IN] Is the position at which the menuitem is displayed
- * RETURNS
- * void
- *****************************************************************************/
- void gui_show_fixed_icontext_list_menuitem(void *item, void *common_item_data, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1, y1, x2, y2;
- S32 ix1, iy1, ix2, iy2;
- color text_color;
- UI_filled_area *f = NULL;
- fixed_icontext_list_menuitem *m = (fixed_icontext_list_menuitem*) common_item_data;
- fixed_icontext_list_menuitem_type *mi = (fixed_icontext_list_menuitem_type*) item;
- U32 flags;
- UI_string_type _text;
- PU8 _icon;
- U8 animation_flag = 0;
- U8 focussed_flag = 0;
- U8 disabled_flag = 0;
- U8 selected_flag = 0;
- S32 i;
- color c;
- S32 sw, sh;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = mi->flags;
- flags |= m->flags;
- c = gui_color(0, 0, 0);
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- GUI_current_fixed_icontext_list_menuitem_x = x;
- GUI_current_fixed_icontext_list_menuitem_y = y;
- }
- x1 = x;
- y1 = y;
- y2 = y1 + m->height - 1;
- x2 = x1 + m->width - 1;
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(flags & UI_MENUITEM_DISABLE_HIGHLIGHT))
- {
- f = m->focussed_filler;
- focussed_flag = 1;
- if (flags & UI_MENUITEM_FOCUSSED_ANIMATE)
- {
- animation_flag = 1;
- }
- }
- else if (flags & UI_MENUITEM_STATE_DISABLED)
- {
- if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND))
- {
- f = m->disabled_filler;
- }
- disabled_flag = 1;
- }
- else if (flags & UI_MENUITEM_STATE_SELECTED)
- {
- f = m->selected_filler;
- f->flags |= UI_FILLED_AREA_BORDER|UI_FILLED_AREA_ROUNDED_BORDER;
- if (flags & UI_MENUITEM_SELECTED_ANIMATE)
- {
- animation_flag = 1;
- }
- selected_flag = 1;
- }
- else
- {
- if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND))
- {
- f = m->normal_filler;
- }
- }
- gui_push_clip();
- gui_set_clip(x1, y1, x2, y2);
- if (f != NULL && (!(flags & UI_MENUITEM_HIGHLIGHT_SWITCH_ICON)))
- {
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- if (is_draw_next_frame_list_highlight_effect_value())
- #endif
- {
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_HIGHLIGHT_ICONTEXT_LIST;
- }
- #endif
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- set_start_position_and_item_parameters_for_list_highlighter_effect(item, common_item_data, x1, y1);
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw)
- {
- gui_draw_list_filled_area(x1, y1 + 1, x2 - 1, y2, f);
- }
- else
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- {
- gui_draw_list_filled_area(x1, y1, x2, y2, f);
- }
- #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if ((line_draw && GUI_current_fixed_icontext_menuitem_scroll))
- {
- gui_draw_filled_area(x1, y1 + 1, x2 - 1, y2, f);
- }
- else
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- {
- gui_draw_filled_area(x1, y1, x2, y2, &f1);
- gui_draw_filled_area(x1+1, y1+1, x2-1, y2-1, f);
- }
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw)
- {
- gui_draw_vertical_line(
- MMI_fixed_list_menu.y + 1,
- MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 2,
- MMI_fixed_list_menu.x,
- current_MMI_theme->list_background_filler->border_color);
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- }
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- /* To hide the text and icon of the menuitem up to the last frame for flash feel effect */
- if (gblock_list_effect == 0)
- {
- if (gui_get_current_list_effect() == MMI_UI_LIST_HIGHLIGHT_EFFECT_FLASH_FEELING &&
- MMI_current_menu_type == LIST_MENU)
- {
- if (flash_feel_last_frame == 0)
- {
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY;
- }
- }
- }
- }
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- for (i = 0; i < m->n_icon_columns; i++)
- {
- /* For bi-degree main menu */
- /* selected item, should draw selected image */
- if (flags & UI_MENUITEM_HIGHLIGHT_SWITCH_ICON)
- {
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- i++;
- }
- /* normal item, should clear previous drawn image */
- else
- {
- #ifdef __GDI_MEMORY_PROFILE_2__
- gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);
- #endif
- continue;
- }
- }
- if (mi->item_icon_handles[i] != GDI_ERROR_HANDLE)
- {
- gdi_image_stop_animation(mi->item_icon_handles[i]);
- mi->item_icon_handles[i] = GDI_ERROR_HANDLE;
- }
- _icon = mi->item_icons[i];
- /* _icon_handle=mi->item_icon_handles[i]; */
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- /* To hide the icon of the menuitem up to the last frame for flash feel effect */
- if (gblock_list_effect == 0)
- {
- if (gui_get_current_list_effect() == MMI_UI_LIST_HIGHLIGHT_EFFECT_FLASH_FEELING &&
- MMI_current_menu_type == LIST_MENU)
- {
- if (flash_feel_last_frame == 0)
- {
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- _icon = UI_NULL_IMAGE;
- }
- }
- }
- }
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- /* Autocalculate the icon position */
- if (_icon != UI_NULL_IMAGE)
- {
- S32 icon_width, icon_height;
- gui_measure_image(_icon, &icon_width, &icon_height);
- if (flags & UI_MENUITEM_CENTER_ICON_X)
- {
- m->icon_coordinates[i].x = (m->width >> 1) - (icon_width >> 1);
- }
- if (!(m->flags & MENU_MUTLIROW_ICON_LIST))
- {
- if (flags & UI_MENUITEM_CENTER_ICON_Y)
- {
- m->icon_coordinates[i].y = (m->height >> 1) - (icon_height >> 1);
- }
- }
- }
- if (r2lMMIFlag)
- {
- ix1 = x2 - m->icon_coordinates[i].x - m->icon_coordinates[i].width + 1;
- }
- else
- {
- ix1 = m->icon_coordinates[i].x + x1;
- }
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw && m->icon_coordinates[i].width)
- {
- gui_reset_clip();
- if (!r2lMMIFlag)
- {
- gui_draw_vertical_line(y1, y2, m->icon_coordinates[i].x - ((TEXT_ICON_GAP + 1) >> 1), current_MMI_theme->list_background_filler->border_color); /* Vertical partition for diff type */
- }
- else
- {
- gui_draw_vertical_line(y1, y2, ix1 - ((TEXT_ICON_GAP + 1) >> 1), current_MMI_theme->list_background_filler->border_color); /* Vertical partition for diff type */
- }
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- iy1 = m->icon_coordinates[i].y + y1;
- ix2 = ix1 + m->icon_coordinates[i].width - 1;
- iy2 = iy1 + m->icon_coordinates[i].height - 1;
- if (ix2 > x2)
- {
- ix2 = x2;
- }
- if (iy2 > y2)
- {
- iy2 = y2;
- }
- gui_set_clip(ix1, iy1, ix2, iy2);
- if (_icon != UI_NULL_IMAGE)
- {
- if (animation_flag)
- {
- #if(UI_MAIN_MENU_ANIMATION_TYPE == UI_MAIN_MENU_ANIMATION_TYPE1)
- gdi_image_draw_animation(ix1, iy1, _icon, &(mi->item_icon_handles[i]) /* &animation_handle */ );
- /* mi->item_icon_handles[i]=gui_show_transparent_animated_image(ix1,iy1,_icon,m->icon_transparent_color); */
- #elif(UI_MAIN_MENU_ANIMATION_TYPE==UI_MAIN_MENU_ANIMATION_TYPE2)
- gdi_image_draw_animation(ix1, iy1, _icon, &(mi->item_icon_handles[i]) /* &animation_handle */ );
- /* mi->item_icon_handles[i]=gui_show_transparent_animated_image_frames(ix1,iy1,_icon,m->icon_transparent_color,1,0); */
- #endif
- m->flags |= UI_MENUITEM_STATE_ANIMATE;
- }
- else if (m->flags & UI_MENUITEM_STATE_ANIMATE)
- {
- gui_show_transparent_animated_image_frame(ix1, iy1, _icon, m->icon_transparent_color, 0);
- m->flags &= ~UI_MENUITEM_STATE_ANIMATE;
- }
- else
- {
- gui_show_transparent_animated_image_frame(ix1, iy1, _icon, m->icon_transparent_color, 0);
- }
- }
- /* For bi-degree main menu */
- if (flags & UI_MENUITEM_HIGHLIGHT_SWITCH_ICON)
- {
- break;
- }
- }
- gui_push_text_clip();
- gui_set_text_clip(x1, y1, x2, y2); /* 20051028 Calvin added: reset text clip */
- if (!(flags & UI_MENUITEM_DISABLE_TEXT_DISPLAY))
- {
- for (i = 0; i < m->n_text_columns; i++)
- {
- _text = mi->item_texts[i];
- gui_set_font(m->text_fonts[i]);
- gui_measure_string(_text, &sw, &sh);
- if (flags & UI_MENUITEM_CENTER_TEXT_X)
- {
- m->text_coordinates[i].x = (m->width >> 1) - (sw >> 1);
- ix1 = m->text_coordinates[i].x + x1;
- ix2 = ix1 + m->text_coordinates[i].width - 1;
- }
- if (!(m->flags & MENU_MUTLIROW_ICON_LIST))
- {
- if (flags & UI_MENUITEM_CENTER_TEXT_Y)
- {
- m->text_coordinates[i].y = (m->height >> 1) - (sh >> 1);
- iy1 = m->text_coordinates[i].y + y1;
- iy2 = iy1 + m->text_coordinates[i].height - 1;
- }
- }
- if (r2lMMIFlag)
- {
- ix1 = x2 - m->text_coordinates[i].x - m->text_coordinates[i].width + 1;
- }
- else
- {
- ix1 = m->text_coordinates[i].x + x1;
- }
- iy1 = m->text_coordinates[i].y + y1;
- ix2 = ix1 + m->text_coordinates[i].width - 1;
- iy2 = iy1 + m->text_coordinates[i].height - 1;
- if (ix2 > x2)
- {
- ix2 = x2;
- }
- if (iy2 > y2)
- {
- iy2 = y2;
- }
- if ((i == 0) && (flags & UI_MENUITEM_FILL_COL1))
- {
- int j;
- gui_set_clip((ix1 - x1), y1, ix2, y2);
- for (j = 0; j < FIXED_ICONTEXT_LIST_MAX_TEXT_COLUMNS; j++)
- {
- m->focussed_text_colors[j] = c;
- }
- gui_draw_filled_area((ix1 - x1), y1, ix2, y2, &colorangewgui_pop_up_dialog_background);
- }
- if ((i == 1) && (flags & UI_MENUITEM_FILL_COL2))
- {
- int j;
- gui_set_clip((ix1 - x1), y1, ix2, y2);
- for (j = 0; j < FIXED_ICONTEXT_LIST_MAX_TEXT_COLUMNS; j++)
- {
- m->focussed_text_colors[j] = c;
- }
- gui_draw_filled_area((ix1 - x1), y1, ix2, y2, &colorangewgui_pop_up_dialog_background);
- }
- if (_text != NULL)
- {
- if (_text[0] != ' ')
- {
- if (disabled_flag)
- {
- text_color = m->disabled_text_colors[i];
- }
- else if (focussed_flag)
- {
- text_color = m->focussed_text_colors[i];
- }
- else if (selected_flag)
- {
- text_color = m->selected_text_colors[i];
- }
- else
- {
- text_color = m->normal_text_colors[i];
- }
- if (!(flags & UI_MENUITEM_DISABLE_TEXT_CLIP))
- {
- gui_set_text_clip(ix1, iy1, ix2, iy2);
- }
- gui_set_text_color(text_color);
- /* Added specifically to right justify second column in case of two column display with numbers */
- if ((i == 1) && (flags & UI_MENUITEM_RIGHT_JUSTIFY_COL2))
- {
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(ix1 + sw, iy1);
- }
- else
- {
- gui_move_text_cursor(ix2 - sw, iy1);
- }
- gui_set_line_height(sh);
- gui_print_text(_text);
- }
- else
- {
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) &&
- ((i == GUI_current_fixed_icontext_list_menuitem_column) ||
- (m->flags & MENU_MUTLIROW_ICON_LIST)))
- /* Second Column Text Scroll Change For Multi Row List */
- {
- if (sw > m->text_coordinates[i].width)
- {
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(ix2 + m->scroll_x, iy1);
- }
- else
- {
- gui_move_text_cursor(ix1 + m->scroll_x, iy1);
- }
- }
- else
- {
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(ix2, iy1);
- }
- else
- {
- gui_move_text_cursor(ix1, iy1);
- }
- }
- gui_set_line_height(sh);
- /* trucate too long number/name in call list. */
- if (flags & UI_MENUITEM_TRUNCATE_CONTENT)
- {
- if (r2lMMIFlag)
- {
- gui_print_truncated_text(ix2, iy1, m->text_coordinates[0].width, _text);
- }
- else
- {
- gui_print_truncated_text(ix1, iy1, m->text_coordinates[0].width, _text);
- }
- }
- else
- {
- #if(UI_USE_WORD_SCROLLING_TEXT)
- if (GUI_current_fixed_icontext_list_menuitem_scroll)
- {
- GUI_current_fixed_icontext_list_menuitem_scroll_text_end =
- GUI_current_fixed_icontext_list_menuitem_scroll_text;
- if (gui_print_truncated_text2
- (ix1 + m->scroll_x, iy1, ix2 - ix1 + 1,
- &GUI_current_fixed_icontext_list_menuitem_scroll_text_end))
- {
- GUI_current_fixed_icontext_menuitem_scroll_text_end = _text;
- }
- }
- else
- {
- gui_print_truncated_text2(ix1 + m->scroll_x, iy1, ix2 - ix1 + 1, &_text);
- }
- #else /* (UI_USE_WORD_SCROLLING_TEXT) */
- gui_print_text(_text);
- if ((flags & UI_MENUITEM_MARQUEE_SCROLL) &&
- GUI_current_fixed_icontext_list_menuitem_scroll)
- {
- if (sw > m->text_coordinates[i].width)
- {
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(
- ix2 + m->scroll_x - (m->text_width + UI_text_menuitem_scroll_gap),
- iy1);
- }
- else
- {
- gui_move_text_cursor(
- ix1 + m->scroll_x + m->text_width + UI_text_menuitem_scroll_gap,
- iy1);
- }
- gui_set_line_height(sh);
- gui_print_text(_text);
- }
- }
- #endif /* (UI_USE_WORD_SCROLLING_TEXT) */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw)
- {
- gui_reset_clip();
- if (!r2lMMIFlag)
- {
- gui_draw_vertical_line(y1, y2, m->text_coordinates[i].x - ((TEXT_ICON_GAP + 1) >> 1), current_MMI_theme->list_background_filler->border_color); /* Line before text item */
- }
- if (r2lMMIFlag && (m->n_text_columns > 1) && m->text_coordinates[i].width)
- {
- gui_draw_vertical_line(y1, y2, x2 - (m->text_coordinates[i].x - ((TEXT_ICON_GAP + 1) >> 1)), current_MMI_theme->list_background_filler->border_color); /* Line before text item */
- }
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- }
- }
- else
- {
- gui_set_line_height(sh);
- if (flags & UI_MENUITEM_TRUNCATE_CONTENT)
- {
- if (r2lMMIFlag)
- {
- gui_print_truncated_text(ix2, iy1, m->text_coordinates[0].width, _text);
- }
- else
- {
- gui_print_truncated_text(ix1, iy1, m->text_coordinates[0].width, _text);
- }
- }
- else
- {
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(ix2, iy1);
- }
- else
- {
- gui_move_text_cursor(ix1, iy1);
- }
- gui_print_text(_text);
- }
- }
- }
- }
- }
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw)
- {
- gui_reset_clip();
- if (!r2lMMIFlag)
- {
- gui_draw_vertical_line(y1, y2, m->text_coordinates[i].x - ((TEXT_ICON_GAP + 1) >> 1), current_MMI_theme->list_background_filler->border_color); /* To handle scrolling text overlapping */
- }
- if (r2lMMIFlag && (m->n_text_columns > 1) && m->text_coordinates[i].width)
- {
- gui_draw_vertical_line(y1, y2, x2 - (m->text_coordinates[i].x - ((TEXT_ICON_GAP + 1) >> 1)), current_MMI_theme->list_background_filler->border_color); /* Line before text item */
- }
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- }
- }
- if (m->post_display_function)
- {
- m->post_display_function(item, common_item_data, x, y);
- }
- gui_pop_text_clip();
- gui_pop_clip();
- #if(UI_ENABLE_POP_UP_DESCRIPTIONS)
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(m->ext_flags & UI_MENUITEM_EXT_SHOW_IN_MARQUEE))
- {
- gui_display_pop_up_description(x, y, m->width, m->height);
- }
- #endif /* (UI_ENABLE_POP_UP_DESCRIPTIONS) */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_measure_fixed_icontext_list_menuitem
- * DESCRIPTION
- * Measures a fixed icontext list menuitem
- * PARAMETERS
- * item [?]
- * m [?]
- * width [OUT]
- * height [OUT]
- * common_item_data(?) [IN] Is the fixed icontext list menuitem object (common_data)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_measure_fixed_icontext_list_menuitem(void *item, void *m, S32 *width, S32 *height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_icontext_list_menuitem *t = (fixed_icontext_list_menuitem*) m;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item);
- *width = t->width;
- *height = t->height;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_highlight_fixed_icontext_list_menuitem
- * DESCRIPTION
- * Highlights a fixed icontext list menuitem (not visually)
- * PARAMETERS
- * item [IN] Is a specific fixed icontext list menuitem object
- * common_item_data [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_highlight_fixed_icontext_list_menuitem(void *item, void *common_item_data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_icontext_list_menuitem_type *t = (fixed_icontext_list_menuitem_type*) item;
- fixed_icontext_list_menuitem *m = (fixed_icontext_list_menuitem*) common_item_data;
- U32 flags;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = m->flags;
- flags |= t->flags;
- GUI_current_fixed_icontext_list_menuitem_common_data = m;
- GUI_current_fixed_icontext_list_menuitem_data = t;
- gui_fixed_icontext_list_menuitem_stop_scroll();
- gui_fixed_icontext_list_menuitem_start_scroll();
- if (t->flags & UI_MENUITEM_DISABLE_HIGHLIGHT)
- {
- return;
- }
- t->flags |= UI_MENUITEM_STATE_FOCUSSED;
- }