gui_fixed_menuitems.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:278k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * FUNCTION
- * gui_remove_highlight_fixed_icontext_list_menuitem
- * DESCRIPTION
- * Removes the highlight of 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_remove_highlight_fixed_icontext_list_menuitem(void *item, void *common_item_data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = 0;
- fixed_icontext_list_menuitem_type *t = (fixed_icontext_list_menuitem_type*) item;
- fixed_icontext_list_menuitem *m = (fixed_icontext_list_menuitem*) common_item_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- t->flags &= ~UI_MENUITEM_STATE_FOCUSSED;
- for (i = 0; i < m->n_icon_columns; i++)
- {
- if (t->item_icon_handles[i] != GDI_ERROR_HANDLE)
- {
- gdi_image_stop_animation(t->item_icon_handles[i]);
- t->item_icon_handles[i] = GDI_ERROR_HANDLE;
- }
- }
- }
- /* GUI: fixed two state menuitem functions */
- UI_fixed_twostate_menuitem_theme *current_fixed_twostate_menuitem_theme = NULL;
- /*****************************************************************************
- * FUNCTION
- * gui_set_fixed_twostate_menuitem_current_theme
- * DESCRIPTION
- * Applies the current theme to a fixed twostate menuitem
- * PARAMETERS
- * m [IN] Is the fixed twostate menuitem object (common data)
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- UI_filled_area fixed_twostate_menuitem_transparent_filled_area;
- #endif
- void gui_set_fixed_twostate_menuitem_current_theme(fixed_twostate_menuitem *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->disabled_filler = current_fixed_twostate_menuitem_theme->disabled_filler;
- m->disabled_text_color = current_fixed_twostate_menuitem_theme->disabled_text_color;
- m->flags |= current_fixed_twostate_menuitem_theme->flags;
- m->focussed_filler = current_fixed_twostate_menuitem_theme->focussed_filler;
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- if (!m->focussed_filler->flags & UI_FILLED_AREA_TYPE_BITMAP)
- {
- fixed_twostate_menuitem_transparent_filled_area = *(m->focussed_filler);
- m->focussed_filler = &fixed_twostate_menuitem_transparent_filled_area;
- fixed_twostate_menuitem_transparent_filled_area.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- fixed_twostate_menuitem_transparent_filled_area.c.alpha = HIGHLIGHTER_COLOR_OPACITY_VALUE;
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- m->focussed_text_color = current_fixed_twostate_menuitem_theme->focussed_text_color;
- m->normal_filler = current_fixed_twostate_menuitem_theme->normal_filler;
- m->normal_text_color = current_fixed_twostate_menuitem_theme->normal_text_color;
- m->selected_filler = current_fixed_twostate_menuitem_theme->selected_filler;
- m->selected_text_color = current_fixed_twostate_menuitem_theme->selected_text_color;
- m->text_font = current_fixed_twostate_menuitem_theme->text_font;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_set_fixed_twostate_menuitem_theme
- * DESCRIPTION
- * Applies the given theme to a fixed twostate menuitem
- * PARAMETERS
- * m [IN] Is the fixed twostate menuitem object (common data)
- * t [IN] Is the theme
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_fixed_twostate_menuitem_theme(fixed_twostate_menuitem *m, UI_fixed_twostate_menuitem_theme *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->disabled_filler = t->disabled_filler;
- m->disabled_text_color = t->disabled_text_color;
- 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_twostate_menuitem_transparent_filled_area = *(m->focussed_filler);
- m->focussed_filler = &fixed_twostate_menuitem_transparent_filled_area;
- fixed_twostate_menuitem_transparent_filled_area.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- fixed_twostate_menuitem_transparent_filled_area.c.alpha = HIGHLIGHTER_COLOR_OPACITY_VALUE;
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- m->focussed_text_color = t->focussed_text_color;
- m->normal_filler = t->normal_filler;
- m->normal_text_color = t->normal_text_color;
- m->selected_filler = t->selected_filler;
- m->selected_text_color = t->selected_text_color;
- m->text_font = t->text_font;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_create_fixed_twostate_menuitem
- * DESCRIPTION
- * Creates a fixed twostate menuitem
- * PARAMETERS
- * m [IN] Is the fixed twostate menuitem object (common data)
- * width [IN] Width is the width of the fixed twostate menuitem
- * height [IN] Height is the height of the fixed twostate menuitem
- * ON_icon [IN]
- * OFF_icon [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_fixed_twostate_menuitem(fixed_twostate_menuitem *m, S32 width, S32 height, PU8 ON_icon, PU8 OFF_icon)
- {
- /*----------------------------------------------------------------*/
- /* 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);
- gui_set_fixed_twostate_menuitem_current_theme(m);
- m->OFF_icon = OFF_icon;
- m->ON_icon = ON_icon;
- m->icon_x = 0;
- m->icon_y = 0;
- /* Autocalculate the icon position */
- if (m->OFF_icon != UI_NULL_IMAGE)
- {
- S32 icon_width, icon_height;
- gui_measure_image(m->OFF_icon, &icon_width, &icon_height);
- if (m->flags & UI_MENUITEM_CENTER_ICON_X)
- {
- m->icon_x = (m->width >> 1) - (icon_width >> 1);
- }
- if (m->flags & UI_MENUITEM_CENTER_ICON_Y)
- {
- m->icon_y = (m->height >> 1) - (icon_height >> 1);
- }
- }
- m->scroll_x = 0;
- m->scroll_width = width;
- m->parent_list = NULL;
- m->parent_matrix = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_twostate_menuitem_set_text_position
- * DESCRIPTION
- * Sets the text position within a fixed twostate menuitem
- * PARAMETERS
- * m [IN] Is the fixed twostate menuitem object (common data)
- * x [IN] Is the position of the text (offset from the left-top corner of the menuitem)
- * y [IN] Is the position of the text (offset from the left-top corner of the menuitem)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_twostate_menuitem_set_text_position(fixed_twostate_menuitem *m, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->text_x = x;
- m->text_y = y;
- if (m->icon_x > m->text_x)
- {
- m->scroll_width = m->icon_x - m->text_x;
- }
- else
- {
- m->scroll_width = m->width - m->text_x;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_twostate_menuitem_set_icon_position
- * DESCRIPTION
- * Sets the icon position within a fixed twostate menuitem
- * PARAMETERS
- * m [IN] Is the fixed twostate menuitem object (common data)
- * x [IN] Is the position of the icon (offset from the left-top corner of the menuitem)
- * y [IN] Is the position of the icon (offset from the left-top corner of the menuitem)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_twostate_menuitem_set_icon_position(fixed_twostate_menuitem *m, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->icon_x = x;
- m->icon_x = y;
- if (m->icon_x > m->text_x)
- {
- m->scroll_width = m->icon_x - m->text_x;
- }
- else
- {
- m->scroll_width = m->width - m->text_x;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_twostate_menuitem_set_icons
- * DESCRIPTION
- * sets the two state icons
- * PARAMETERS
- * m [IN] Is the fixed twostate menuitem object (common_data)
- * ON_icon [IN] Is the icon that is displayed when the item is selected
- * OFF_icon [IN] Is the icon that is displayed when the item is not selected
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_twostate_menuitem_set_icons(fixed_twostate_menuitem *m, PU8 ON_icon, PU8 OFF_icon)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->OFF_icon = OFF_icon;
- m->ON_icon = ON_icon;
- /* Autocalculate the icon position */
- if (m->OFF_icon != UI_NULL_IMAGE)
- {
- S32 icon_width, icon_height;
- gui_measure_image(m->OFF_icon, &icon_width, &icon_height);
- if (m->flags & UI_MENUITEM_CENTER_ICON_X)
- {
- m->icon_x = (m->width >> 1) - (icon_width >> 1);
- }
- if (m->flags & UI_MENUITEM_CENTER_ICON_Y)
- {
- m->icon_y = (m->height >> 1) - (icon_height >> 1);
- }
- }
- if (m->icon_x > m->text_x)
- {
- m->scroll_width = m->icon_x - m->text_x;
- }
- else
- {
- m->scroll_width = m->width - m->text_x;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_resize_fixed_twostate_menuitem
- * DESCRIPTION
- * Changes the size of a fixed twostate menuitem
- * PARAMETERS
- * m [IN] Is the fixed twostate menuitem object (common data)
- * width [IN] Is the new width
- * height [IN] Is the new height
- * RETURNS
- * void
- *****************************************************************************/
- void gui_resize_fixed_twostate_menuitem(fixed_twostate_menuitem *m, S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->width = width;
- m->height = height;
- if (m->icon_x > m->text_x)
- {
- m->scroll_width = m->icon_x - m->text_x;
- }
- /* PMT VIKAS START 20051202 */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- else
- {
- m->scroll_width = m->width - (m->text_x + TEXT_ICON_GAP); /* As TEXT_ICON_GAP is add in text x to start show text */
- }
- #else /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- else
- {
- m->scroll_width = m->width - m->text_x;
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- /* PMT VIKAS END 20051202 */
- }
- /* Text scrolling related functions within the menu item */
- fixed_twostate_menuitem *GUI_current_fixed_twostate_menuitem_common_data = NULL;
- fixed_twostate_menuitem_type *GUI_current_fixed_twostate_menuitem_data = NULL;
- U8 GUI_current_fixed_twostate_menuitem_scroll = 0;
- U8 GUI_current_fixed_twostate_menuitem_scroll_direction;
- S32 GUI_current_fixed_twostate_menuitem_x;
- S32 GUI_current_fixed_twostate_menuitem_y;
- S32 GUI_current_fixed_twostate_menuitem_scroll_counter = 0;
- UI_string_type GUI_current_fixed_twostate_menuitem_scroll_text = NULL;
- UI_string_type GUI_current_fixed_twostate_menuitem_scroll_text_end = NULL;
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_twostate_menuitem_scroll_handler
- * DESCRIPTION
- * Scoll the menu item text
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_twostate_menuitem_scroll_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 flags = GUI_current_fixed_twostate_menuitem_common_data->flags;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags |= GUI_current_fixed_twostate_menuitem_data->flags;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_reset_current_list_effect();
- #endif
- if (GUI_current_fixed_twostate_menuitem_scroll_counter)
- {
- GUI_current_fixed_twostate_menuitem_scroll_counter--;
- }
- else
- {
- #if(UI_USE_WORD_SCROLLING_TEXT)
- GUI_current_fixed_twostate_menuitem_scroll_text = GUI_current_fixed_twostate_menuitem_scroll_text_end;
- #else /* (UI_USE_WORD_SCROLLING_TEXT) */
- if (flags & UI_MENUITEM_MARQUEE_SCROLL)
- {
- if (r2lMMIFlag)
- {
- GUI_current_fixed_twostate_menuitem_common_data->scroll_x += UI_text_menuitem_scroll_size;
- if (GUI_current_fixed_twostate_menuitem_common_data->scroll_x >=
- (GUI_current_fixed_twostate_menuitem_common_data->text_width + UI_text_menuitem_scroll_gap))
- {
- GUI_current_fixed_twostate_menuitem_common_data->scroll_x = 0;
- }
- }
- else
- {
- GUI_current_fixed_twostate_menuitem_common_data->scroll_x -= UI_text_menuitem_scroll_size;
- if (GUI_current_fixed_twostate_menuitem_common_data->scroll_x <=
- (-(GUI_current_fixed_twostate_menuitem_common_data->text_width + UI_text_menuitem_scroll_gap)))
- {
- GUI_current_fixed_twostate_menuitem_common_data->scroll_x = 0;
- }
- }
- }
- else
- {
- if (GUI_current_fixed_twostate_menuitem_scroll_direction == 0)
- {
- GUI_current_fixed_twostate_menuitem_common_data->scroll_x -= UI_text_menuitem_scroll_size;
- if ((GUI_current_fixed_twostate_menuitem_common_data->scroll_x +
- GUI_current_fixed_twostate_menuitem_common_data->text_width) <=
- (GUI_current_fixed_twostate_menuitem_common_data->scroll_width))
- {
- GUI_current_fixed_twostate_menuitem_scroll_direction = 1;
- GUI_current_fixed_twostate_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- }
- }
- else if (GUI_current_fixed_twostate_menuitem_scroll_direction == 1)
- {
- GUI_current_fixed_twostate_menuitem_common_data->scroll_x += UI_text_menuitem_scroll_size;
- if (GUI_current_fixed_twostate_menuitem_common_data->scroll_x >= 0)
- {
- GUI_current_fixed_twostate_menuitem_scroll_direction = 0;
- GUI_current_fixed_twostate_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- }
- }
- }
- #endif /* (UI_USE_WORD_SCROLLING_TEXT) */
- /*
- * WAP might display two-state fixed list as list box outside of content region.
- * We should disable scrolling text when it locates outside the content region,
- * otherwise it will overlap with the title bar or softkey.
- */
- if (GUI_current_fixed_twostate_menuitem_y >= MMI_content_y &&
- (GUI_current_fixed_twostate_menuitem_y + GUI_current_fixed_twostate_menuitem_common_data->height - 1)
- < (MMI_content_y + MMI_content_height))
- {
- GUI_current_fixed_twostate_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_twostate_menuitem_disable_transparent_effect(GUI_current_fixed_twostate_menuitem_common_data); /* To hide text below scrolling text */
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- gui_show_fixed_twostate_menuitem(
- (void*)GUI_current_fixed_twostate_menuitem_data,
- (void*)GUI_current_fixed_twostate_menuitem_common_data,
- GUI_current_fixed_twostate_menuitem_x,
- GUI_current_fixed_twostate_menuitem_y);
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- gui_fixed_twostate_menuitem_enable_transparent_effect(GUI_current_fixed_twostate_menuitem_common_data); /* To enable transparency */
- #endif
- GUI_current_fixed_twostate_menuitem_common_data->ext_flags &= ~UI_MENUITEM_EXT_SHOW_IN_MARQUEE;
- gui_BLT_double_buffer(
- GUI_current_fixed_twostate_menuitem_x,
- GUI_current_fixed_twostate_menuitem_y,
- GUI_current_fixed_twostate_menuitem_x + GUI_current_fixed_twostate_menuitem_common_data->width - 1,
- GUI_current_fixed_twostate_menuitem_y + GUI_current_fixed_twostate_menuitem_common_data->height - 1);
- }
- }
- /* start timer of scrolling text */
- gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_twostate_menuitem_scroll_handler);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_twostate_menuitem_start_scroll
- * DESCRIPTION
- * start the scrolling of menu item text
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_twostate_menuitem_start_scroll(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_twostate_menuitem_type *t = (fixed_twostate_menuitem_type*) GUI_current_fixed_twostate_menuitem_data;
- fixed_twostate_menuitem *m = (fixed_twostate_menuitem*) GUI_current_fixed_twostate_menuitem_common_data;
- S32 w;
- U32 flags;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = m->flags;
- flags |= t->flags;
- gui_set_font(m->text_font);
- w = gui_get_string_width(t->item_text);
- m->text_width = w;
- m->scroll_x = 0;
- if (w >= (m->scroll_width - 1))
- {
- #if(UI_USE_WORD_SCROLLING_TEXT)
- GUI_current_fixed_twostate_menuitem_scroll_text = t->item_text;
- GUI_current_fixed_twostate_menuitem_scroll = 1;
- GUI_current_fixed_twostate_menuitem_scroll_direction = 0;
- GUI_current_fixed_twostate_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_twostate_menuitem_scroll_handler);
- }
- else
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_twostate_menuitem_scroll_handler);
- }
- #else /* (UI_USE_WORD_SCROLLING_TEXT) */
- if ((flags & UI_MENUITEM_MARQUEE_SCROLL) || (flags & UI_MENUITEM_TWO_DIRECTION_SCROLL))
- {
- GUI_current_fixed_twostate_menuitem_scroll = 1;
- GUI_current_fixed_twostate_menuitem_scroll_direction = 0;
- GUI_current_fixed_twostate_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_twostate_menuitem_scroll_handler);
- }
- else
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_twostate_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_twostate_menuitem_scroll = 0;
- }
- #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- GUI_current_fixed_twostate_menuitem_scroll = 0;
- }
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_twostate_menuitem_stop_scroll
- * DESCRIPTION
- * stop the scrolling of menu item text
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_twostate_menuitem_stop_scroll(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GUI_current_fixed_twostate_menuitem_scroll)
- {
- gui_cancel_timer(gui_fixed_twostate_menuitem_scroll_handler);
- GUI_current_fixed_twostate_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_show_fixed_twostate_menuitem
- * DESCRIPTION
- * Displays the fixed twostate menuitem
- * PARAMETERS
- * item [IN] Is a specific fixed twostate menuitem object
- * common_item_data [IN] Is the fixed twostate 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_twostate_menuitem(void *item, void *common_item_data, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1, y1, x2, y2;
- S32 text_x, text_y;
- color text_color;
- UI_filled_area *f = NULL;
- fixed_twostate_menuitem *m = (fixed_twostate_menuitem*) common_item_data;
- fixed_twostate_menuitem_type *mi = (fixed_twostate_menuitem_type*) item;
- U32 flags;
- UI_string_type _text;
- /* byte animation_flag=0; */
- S32 sw, sh;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- PU8 temp_on_icon = m->ON_icon;
- PU8 temp_off_icon = m->OFF_icon;
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- #if(UI_USE_WORD_SCROLLING_TEXT)
- S32 text_width;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = mi->flags;
- flags |= m->flags;
- _text = mi->item_text;
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- GUI_current_fixed_twostate_menuitem_x = x;
- GUI_current_fixed_twostate_menuitem_y = y;
- }
- /* Autocalculate the text position based on font */
- gui_set_font(m->text_font); /* set 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);
- }
- x1 = x;
- y1 = y;
- x2 = x1 + m->width - 1;
- y2 = y1 + m->height - 1;
- if (r2lMMIFlag)
- {
- text_x = x2 - m->text_x; /* xt_x=m->width-2-m->text_x; */
- }
- else
- {
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- text_x = m->text_x + TEXT_ICON_GAP; /* To display text grid gap */
- #else
- text_x = m->text_x;
- #endif
- }
- text_y = m->text_y;
- #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)
- {
- temp_on_icon = UI_NULL_IMAGE;
- temp_off_icon = UI_NULL_IMAGE;
- flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY;
- }
- }
- }
- }
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- text_x += m->scroll_x;
- }
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(flags & UI_MENUITEM_DISABLE_HIGHLIGHT))
- {
- f = m->focussed_filler;
- text_color = m->focussed_text_color;
- /* 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;
- }
- text_color = m->focussed_text_color;
- }
- else if (flags & UI_MENUITEM_STATE_SELECTED)
- {
- if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND))
- {
- 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))
- {
- f = m->normal_filler;
- }
- text_color = m->normal_text_color;
- }
- gui_push_clip();
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw)
- {
- if (GUI_current_fixed_twostate_menuitem_scroll)
- {
- gui_set_clip(x1, y1 + 1, x2 - 1, y2);
- }
- else
- {
- gui_set_clip(x1, y1, x2, y2);
- }
- }
- #else /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- gui_set_clip(x1, y1, x2 + 2, y2 + 2);
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- if (f != NULL)
- {
- #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_TWOSTATE_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 && MMI_current_menu_type == LIST_MENU)
- {
- if (GUI_current_fixed_twostate_menuitem_scroll)
- {
- gui_draw_list_filled_area(x1, y1 + 1, x2 - 1, y2, f);
- }
- else
- {
- gui_draw_list_filled_area(x1, y1 + 1, x2 - 1, y2, f);
- }
- }
- #else /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- gui_draw_list_filled_area(x1, y1, x2, y2, f);
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw && MMI_current_menu_type == LIST_MENU)
- {
- if (GUI_current_fixed_twostate_menuitem_scroll)
- {
- gui_draw_filled_area(x1, y1, x2 - 1, y2, f);
- }
- else
- {
- gui_draw_filled_area(x1, y1, x2, y2, f);
- }
- }
- #else /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- gui_draw_filled_area(x1, y1, x2, y2, f);
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- }
- if (flags & UI_MENUITEM_STATE_SELECTED)
- {
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- /* To hide the ON icon of the menuitem up to the last frame for flash feel effect */
- if (temp_on_icon != UI_NULL_IMAGE)
- #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- if (m->ON_icon != UI_NULL_IMAGE)
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- if (!r2lMMIFlag)
- {
- gui_show_transparent_image(x1 + m->icon_x, y1 + m->icon_y, m->ON_icon, m->icon_transparent_color);
- }
- else
- {
- gui_show_transparent_image(
- x2 - m->icon_x - m->text_x + 5,
- y1 + m->icon_y,
- m->ON_icon,
- m->icon_transparent_color);
- }
- }
- }
- else
- {
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- /* To hide the ON icon of the menuitem up to the last frame for flash feel effect */
- if (temp_off_icon != UI_NULL_IMAGE)
- #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- if (m->OFF_icon != UI_NULL_IMAGE)
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- /* show transparent image */
- if (!r2lMMIFlag)
- {
- gui_show_transparent_image(x1 + m->icon_x, y1 + m->icon_y, m->OFF_icon, m->icon_transparent_color);
- }
- else
- {
- gui_show_transparent_image(
- x2 - m->icon_x - m->text_x + 5,
- y1 + m->icon_y,
- m->OFF_icon,
- m->icon_transparent_color);
- }
- }
- }
- if (!(flags & UI_MENUITEM_DISABLE_TEXT_DISPLAY))
- {
- gui_push_text_clip();
- if (m->icon_x > m->text_x)
- {
- gui_set_text_clip(x1, y1, x2 - (m->width - m->icon_x), y2);
- #if(UI_USE_WORD_SCROLLING_TEXT)
- text_width = x2 - (m->width - m->icon_x) - x1 + 1;
- #endif
- }
- else
- {
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- 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
- #if(UI_USE_WORD_SCROLLING_TEXT)
- text_width = x2 - (x1 + m->text_x) + 1;
- #endif
- }
- if (r2lMMIFlag)
- {
- gui_set_text_clip(x1, y1, x2 - m->text_x, y2);
- }
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(text_x, y1 + text_y);
- }
- else
- {
- gui_move_text_cursor(x1 + text_x, y1 + text_y);
- }
- gui_set_text_color(text_color); /* set text clor */
- gui_set_line_height(sh);
- #if(UI_USE_WORD_SCROLLING_TEXT)
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && GUI_current_fixed_twostate_menuitem_scroll)
- {
- GUI_current_fixed_twostate_menuitem_scroll_text_end = GUI_current_fixed_twostate_menuitem_scroll_text;
- if (gui_print_truncated_text2
- (x1 + text_x, y1 + text_y, text_width, &GUI_current_fixed_twostate_menuitem_scroll_text_end))
- {
- GUI_current_fixed_twostate_menuitem_scroll_text_end = _text;
- }
- }
- else
- {
- gui_print_truncated_text2(x1 + text_x, y1 + text_y, text_width, &_text);
- }
- #else /* (UI_USE_WORD_SCROLLING_TEXT) */
- gui_print_text(_text); /* print text */
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && (flags & UI_MENUITEM_MARQUEE_SCROLL) &&
- GUI_current_fixed_twostate_menuitem_scroll)
- {
- 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); /* print text */
- }
- #endif /* (UI_USE_WORD_SCROLLING_TEXT) */
- gui_pop_text_clip();
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw)
- {
- gui_reset_clip();
- if (r2lMMIFlag)
- {
- gui_draw_vertical_line(y1, y2, (x2 - (m->text_x) + ((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, m->text_x - ((TEXT_ICON_GAP) >> 1), 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__ */
- }
- 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); /* display popp description */
- }
- #endif /* (UI_ENABLE_POP_UP_DESCRIPTIONS) */
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_twostate_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_twostate_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 */
- /*----------------------------------------------------------------*/
- BOOL ret = MMI_TRUE, pen_inside = MMI_FALSE;
- S32 iwidth, iheight;
- fixed_twostate_menuitem *m = (fixed_twostate_menuitem*) common_item_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item);
- *menuitem_event = GUI_LIST_PEN_NONE;
- GUI_PEN_EVENT_PARAM_SET_VOID(menuitem_param);
- if (m->OFF_icon != UI_NULL_IMAGE)
- {
- gui_measure_image(m->OFF_icon, &iwidth, &iheight);
- }
- else
- {
- iwidth = iheight = 0;
- }
- item_x += m->icon_x;
- item_y += m->icon_y;
- if (PEN_CHECK_BOUND(x, y, item_x, item_y, iwidth, iheight))
- {
- pen_inside = MMI_TRUE;
- }
- if (pen_event == MMI_PEN_EVENT_DOWN)
- {
- if (!pen_inside)
- {
- /* The following pen events will not be directed to twostate menuitem */
- ret = MMI_FALSE;
- }
- }
- else if (pen_event == MMI_PEN_EVENT_UP)
- {
- if (pen_inside)
- {
- /* Outside of the image, it is not controlled by menuitem */
- *menuitem_event = GUI_TWOSTATE_PEN_TOGGLE;
- }
- }
- return ret;
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * gui_measure_fixed_twostate_menuitem
- * DESCRIPTION
- * Measures a fixed twostate menuitem
- * PARAMETERS
- * item [?]
- * common_item_data [IN] Is the fixed twostate menuitem object (common_data)
- * width [OUT]
- * height [OUT]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_measure_fixed_twostate_menuitem(void *item, void *common_item_data, S32 *width, S32 *height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_twostate_menuitem *t = (fixed_twostate_menuitem*) common_item_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item);
- *width = t->width;
- *height = t->height;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_highlight_fixed_twostate_menuitem
- * DESCRIPTION
- * Highlights a fixed twostate menuitem (not visually)
- * PARAMETERS
- * item [IN] Is a specific fixed twostate menuitem object
- * common_item_data [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_highlight_fixed_twostate_menuitem(void *item, void *common_item_data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_twostate_menuitem_type *t = (fixed_twostate_menuitem_type*) item;
- fixed_twostate_menuitem *m = (fixed_twostate_menuitem*) common_item_data;
- U32 flags;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = m->flags;
- flags |= t->flags;
- GUI_current_fixed_twostate_menuitem_common_data = m;
- GUI_current_fixed_twostate_menuitem_data = t;
- gui_fixed_twostate_menuitem_stop_scroll();
- gui_fixed_twostate_menuitem_start_scroll();
- if (t->flags & UI_MENUITEM_DISABLE_HIGHLIGHT)
- {
- return;
- }
- t->flags |= UI_MENUITEM_STATE_FOCUSSED;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_remove_highlight_fixed_twostate_menuitem
- * DESCRIPTION
- * Removes the highlight of a fixed twostate menuitem (not visually)
- * PARAMETERS
- * item [IN] Is a specific fixed twostate menuitem object
- * common_item_data [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_remove_highlight_fixed_twostate_menuitem(void *item, void *common_item_data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_twostate_menuitem_type *t = (fixed_twostate_menuitem_type*) item;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(common_item_data);
- t->flags &= ~UI_MENUITEM_STATE_FOCUSSED;
- }
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- #define LIST_EFFECT_TYPE__(A) MMI_UI_LIST_HIGHLIGHT_EFFECT_##A
- #define LIST_EFFECT_TYPE_(A) LIST_EFFECT_TYPE__(A)
- #define LIST_EFFECT_TYPE(A) LIST_EFFECT_TYPE_(A)
- /* 122205 MMI_features.h revise Start */
- static gui_list_effect_styles goriginal_list_effect = LIST_EFFECT_TYPE_(UI_LIST_EFFECT_TYPE);
- static gui_list_effect_styles current_list_effect = LIST_EFFECT_TYPE_(UI_LIST_EFFECT_TYPE);
- static gui_list_effect_styles backup_current_list_effect = LIST_EFFECT_TYPE_(UI_LIST_EFFECT_TYPE);
- /* 122205 MMI_features.h revise End */
- static void *ghighlight_item;
- static void *ghighlight_common_item_data;
- static S32 xstart_effect, ystart_effect, xend_effect, yend_effect;
- static S32 gstartX1, gstartY1;
- static UI_filled_area backup_filler;
- static S32 list_highlight_effect_current_frame = 0;
- static is_draw_next_frame_list_highlight_effect = 0;
- extern fixed_list_menu MMI_fixed_list_menu;
- void (*gui_call_menuitem_scroll) (void);
- /*****************************************************************************
- * FUNCTION
- * gui_draw_list_highlight_effect_last_frame
- * DESCRIPTION
- * Display the last frame of list highlight effect.
- * PARAMETERS
- * void
- * S32(?) [IN] X1,S32 y1,S32 x2,S32 y2,UI_filled_area *f
- * RETURNS
- * void
- *****************************************************************************/
- void gui_draw_list_highlight_effect_last_frame(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!ghighlight_item || !ghighlight_common_item_data)
- {
- MMI_DBG_ASSERT(0);
- return;
- }
- gui_lock_double_buffer();
- MMI_fixed_list_menu.item_display_function(ghighlight_item, ghighlight_common_item_data, gstartX1, gstartY1);
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(xstart_effect, ystart_effect, xend_effect, yend_effect);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_draw_animated_highlight_filler
- * DESCRIPTION
- * Draw the animated highlighter filler
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_draw_animated_highlight_filler(S32 x1, S32 y1, S32 x2, S32 y2, UI_filled_area *f)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 Max_frames;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- xstart_effect = x1;
- ystart_effect = y1;
- xend_effect = x2;
- yend_effect = y2;
- Max_frames = gui_image_n_frames(get_image(IMG_LIST_HIGHLIGHTER)); /* Read the no of frames in the gif image. */
- if (list_highlight_effect_current_frame == Max_frames)
- {
- gui_push_clip();
- gui_set_clip(x1, y1, x2, y2);
- gdi_image_draw_animation_single_frame(x1, y1, get_image(IMG_LIST_HIGHLIGHTER), 0);
- list_highlight_effect_current_frame++;
- gui_pop_clip();
- /* To call filler for last time. */
- gui_draw_list_highlight_effect_last_frame();
- list_highlight_effect_current_frame = 0;
- gui_scroll_start_handler_for_list_effects();
- return;
- }
- else if (list_highlight_effect_current_frame < Max_frames)
- {
- gui_push_clip();
- gui_set_clip(x1, y1, x2, y2);
- gui_show_animated_image_frame(x1, y1, get_image(IMG_LIST_HIGHLIGHTER), (S16) list_highlight_effect_current_frame); /* Show frame by frame no. */
- list_highlight_effect_current_frame++; /* Treat list_highlight_effect_current_frame as frame no. */
- gui_pop_clip();
- /* To call filler repeatedly */
- gui_start_timer(LIST_ANIMATION_HIGHLIGHTER_TIMER, gui_callback_highlighter_text_filler);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_draw_transparent_color_filler
- * DESCRIPTION
- * Draw the transparent highlighter filler with increasing opacity
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_draw_transparent_color_filler(S32 x1, S32 y1, S32 x2, S32 y2, UI_filled_area *f)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- xstart_effect = x1;
- ystart_effect = y1;
- xend_effect = x2;
- yend_effect = y2;
- if (list_highlight_effect_current_frame + TRANSPARENCY_START_OPACITY_VALUE == 0)
- {
- /* Last alpha value is reached. nothing more to do. */
- list_highlight_effect_current_frame = 0;
- gui_scroll_start_handler_for_list_effects();
- return;
- }
- else
- {
- if ((list_highlight_effect_current_frame + TRANSPARENCY_START_OPACITY_VALUE) > MAX_OPACITY_VALUE_FACTOR) /* For start Transparency from some values greater then 0. */
- {
- gui_push_clip();
- gui_set_clip(x1, y1, x2, y2);
- backup_filler = *f;
- /* To disable Transparent effect flag for flash feeling */
- if (backup_filler.flags & UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR && (wgui_is_wallpaper_on_bottom() == MMI_FALSE)) /* 072505 Calvin modified */
- {
- backup_filler.flags &= ~UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- }
- gui_draw_filled_area(x1, y1, x2, y2, &backup_filler);
- list_highlight_effect_current_frame = -TRANSPARENCY_START_OPACITY_VALUE;
- gui_pop_clip();
- /* To call filler repeatedly */
- gui_start_timer(LIST_TRANSPARENT_HIGHLIGHTER_TIMER, gui_callback_highlighter_text_filler);
- }
- else
- {
- gui_push_clip();
- gui_set_clip(x1, y1, x2, y2);
- backup_filler = *f;
- #if 0
- /* under construction !*/
- /* under construction !*/
- #else /* 0 */
- backup_filler.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- backup_filler.c.alpha =
- (list_highlight_effect_current_frame + TRANSPARENCY_START_OPACITY_VALUE) * MAX_OPACITY_VALUE_FACTOR;
- #endif /* 0 */
- gui_draw_filled_area(x1, y1, x2, y2, &backup_filler);
- list_highlight_effect_current_frame += JUMP_IN_HIGHLIGHTERS_EFFECTS_FRAME;
- gui_pop_clip();
- /* To call filler repeatedly */
- gui_start_timer(LIST_TRANSPARENT_HIGHLIGHTER_TIMER, gui_callback_highlighter_text_filler);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_draw_flash_feeling_filler
- * DESCRIPTION
- * Draw the flash feeling highlighter filler with increasing width
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_draw_flash_feeling_filler(S32 x1, S32 y1, S32 x2, S32 y2, UI_filled_area *f)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 f_count; /* f_count is the gap of texts upper and below positions from the top and bottom of the highlighter and uses as the no of frames */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- f_count = get_menu_item_height() >> 1;
- if (list_highlight_effect_current_frame > f_count)
- {
- list_highlight_effect_current_frame = 0;
- flash_feel_last_frame = 0;
- gui_scroll_start_handler_for_list_effects();
- }
- else if (list_highlight_effect_current_frame == f_count)
- {
- /* To achieve the original hilighter height */
- xstart_effect = x1;
- ystart_effect = y1;
- xend_effect = x2;
- yend_effect = y2;
- backup_filler = *f;
- /* To disable Transparent effect flag for flash feeling */
- if (backup_filler.flags & UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR && (wgui_is_wallpaper_on_bottom() == MMI_FALSE)) /* 072505 Calvin modified */
- {
- backup_filler.flags &= ~UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- }
- gui_draw_filled_area(x1, y1, x2, y2, &backup_filler);
- list_highlight_effect_current_frame++;
- flash_feel_last_frame = 1;
- gui_start_timer(LIST_FLASH_HIGHLIGHTER_TIMER, gui_callback_highlighter_text_filler);
- }
- else
- {
- xstart_effect = x1;
- ystart_effect = y1 + f_count - list_highlight_effect_current_frame;
- xend_effect = x2;
- yend_effect = y2 - f_count + list_highlight_effect_current_frame;
- gui_push_clip();
- gui_set_clip(x1, ystart_effect, x2, yend_effect);
- backup_filler = *f;
- /* To disable Transparent effect flag for flash feeling */
- if (backup_filler.flags & UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR)
- {
- backup_filler.flags &= ~UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- }
- gui_draw_filled_area(x1, y1, x2, y2, &backup_filler);
- gui_pop_clip();
- list_highlight_effect_current_frame += JUMP_IN_HIGHLIGHTERS_EFFECTS_FRAME;
- if ((list_highlight_effect_current_frame) >= f_count)
- {
- list_highlight_effect_current_frame = f_count; /* To handle counter if jump more then 1 in list_highlight_effect_current_frame */
- }
- /* To call filler repeatedly */
- gui_start_timer(LIST_FLASH_HIGHLIGHTER_TIMER, gui_callback_highlighter_text_filler);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_get_current_list_effect
- * DESCRIPTION
- * Return the current list effect
- * PARAMETERS
- * void
- * RETURNS
- * S32
- *****************************************************************************/
- S32 gui_get_current_list_effect(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return current_list_effect;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_set_current_list_effect
- * DESCRIPTION
- * Set the current list effect to filler recieved by function as argument
- * PARAMETERS
- * list_style [IN]
- * wgui_list_effect_styles(?) [IN] Effect type
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_current_list_effect(gui_list_effect_styles list_style)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- current_list_effect = list_style;
- backup_current_list_effect = current_list_effect;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_reset_current_list_effect
- * DESCRIPTION
- * Reset the current list effect to normal filler for some cases
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_reset_current_list_effect(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (current_list_effect != MMI_UI_LIST_HIGHLIGHT_EFFECT_NONE)
- {
- backup_current_list_effect = current_list_effect;
- }
- current_list_effect = MMI_UI_LIST_HIGHLIGHT_EFFECT_NONE;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_set_current_list_effect_to_default
- * DESCRIPTION
- * Set the current list effect to defult or the selected filler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_current_list_effect_to_default(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- current_list_effect = goriginal_list_effect;
- backup_current_list_effect = goriginal_list_effect; /* restore as current list effect is also set to default */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_restore_current_list_effect
- * DESCRIPTION
- * Restore the current list effect from the backup_current_list_effect
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_restore_current_list_effect(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- current_list_effect = backup_current_list_effect;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_block_list_effect
- * DESCRIPTION
- * set the list effect Block flag off
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_block_list_effect(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gblock_list_effect = 1;
- gui_reset_current_list_effect();
- }
- /*****************************************************************************
- * FUNCTION
- * gui_unblock_list_effect
- * DESCRIPTION
- * set the list effect Block flag on
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_unblock_list_effect(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gblock_list_effect = 0;
- gui_restore_current_list_effect();
- }
- /*****************************************************************************
- * FUNCTION
- * gui_draw_list_filled_area
- * DESCRIPTION
- * This function decide the effect to be called according to current list effect flag
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_draw_list_filled_area(S32 x1, S32 y1, S32 x2, S32 y2, UI_filled_area *f)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gblock_list_effect == 1)
- {
- gui_reset_current_list_effect(); /* This is to block the effects in case of inline edit screens. */
- }
- switch (current_list_effect)
- {
- case MMI_UI_LIST_HIGHLIGHT_EFFECT_NONE:
- {
- /* Disable transparent effect if we do not have screen background layer. */
- UI_filled_area tf = *f;
- if (!gui_is_current_transparency_with_multi_layer())
- {
- tf.flags &= ~UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- }
- gui_draw_filled_area(x1, y1, x2, y2, &tf);
- break;
- }
- case MMI_UI_LIST_HIGHLIGHT_EFFECT_TRANSPARENCY:
- /* For increasing opacity highlighter */
- gui_draw_transparent_color_filler(x1, y1, x2, y2, f);
- break;
- case MMI_UI_LIST_HIGHLIGHT_EFFECT_FLASH_FEELING:
- /* For flash type of highlighter */
- gui_draw_flash_feeling_filler(x1, y1, x2, y2, f);
- break;
- case MMI_UI_LIST_HIGHLIGHT_EFFECT_ANIMATION:
- /* For showing any animation as a gif file in place of highlighter */
- gui_draw_animated_highlight_filler(x1, y1, x2, y2, f);
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_callback_highlighter_text_filler
- * DESCRIPTION
- * Display the all other things on highlighter then filler.
- * PARAMETERS
- * void
- * S32(?) [IN] X1,S32 y1,S32 x2,S32 y2,UI_filled_area *f
- * RETURNS
- * void
- *****************************************************************************/
- void gui_callback_highlighter_text_filler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- GDI_HANDLE lcd;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!ghighlight_item || !ghighlight_common_item_data)
- {
- MMI_DBG_ASSERT(0);
- return;
- }
- gdi_lcd_get_active(&lcd);
- gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
- gui_lock_double_buffer();
- is_draw_next_frame_list_highlight_effect = 1;
- gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
- MMI_fixed_list_menu.item_display_function(ghighlight_item, ghighlight_common_item_data, gstartX1, gstartY1);
- gdi_layer_pop_and_restore_active();
- is_draw_next_frame_list_highlight_effect = 0;
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(xstart_effect, ystart_effect, xend_effect, yend_effect);
- gdi_lcd_set_active(lcd);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_stop_list_highlight_effect
- * DESCRIPTION
- * Close the timer associated with highlighter filler.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_stop_list_highlight_effect(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flash_feel_last_frame = 0;
- list_highlight_effect_current_frame = 0;
- gui_cancel_timer(gui_callback_highlighter_text_filler);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_register_callback_menuitem_scroll
- * DESCRIPTION
- * Set the associated scroll handler
- * PARAMETERS
- * f [IN] )(void)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_register_callback_menuitem_scroll(void (*f) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_call_menuitem_scroll = f; /* set the call function */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_scroll_start_handler_for_list_effects
- * DESCRIPTION
- * Set the associated scroll handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_scroll_start_handler_for_list_effects(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gui_call_menuitem_scroll)
- {
- gui_call_menuitem_scroll(); /* call the corresponding scroll handler */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_dummy_scroll_handler_for_list_effects
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_dummy_scroll_handler_for_list_effects(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* For the cases where text size is not suitable for scroll */
- }
- /*****************************************************************************
- * FUNCTION
- * is_draw_next_frame_list_highlight_effect_value
- * DESCRIPTION
- * Return the is_draw_next_frame_list_highlight_effect value
- * PARAMETERS
- * void
- * RETURNS
- * S32 is_draw_next_frame_list_highlight_effect
- *****************************************************************************/
- S32 is_draw_next_frame_list_highlight_effect_value(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return is_draw_next_frame_list_highlight_effect;
- }
- /*****************************************************************************
- * FUNCTION
- * set_start_position_and_item_parameters_for_list_highlighter_effect
- * DESCRIPTION
- * Set the gstartX1 and gstartY1
- * PARAMETERS
- * item [?]
- * common_item_data [?]
- * x [IN] S32 y
- * y [IN]
- * RETURNS
- * S32 is_draw_next_frame_list_highlight_effect(?)
- *****************************************************************************/
- void set_start_position_and_item_parameters_for_list_highlighter_effect(
- void *item,
- void *common_item_data,
- S32 x,
- S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ghighlight_item = item;
- ghighlight_common_item_data = common_item_data;
- gstartX1 = x;
- gstartY1 = y;
- }
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
- /*****************************************************************************
- * FUNCTION
- * UI_dummy_set_current_two_line_menuitem_data
- * DESCRIPTION
- * dummy function to set two line menuitem data
- * PARAMETERS
- * void
- * RETURNS
- * string to be displayed(?)
- *****************************************************************************/
- void UI_dummy_set_current_two_line_menuitem_data(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * UI_dummy_reset_current_two_line_menuitem_data
- * DESCRIPTION
- * dummy function to reset two line menuitem data
- * PARAMETERS
- * void
- * RETURNS
- * string to be displayed(?)
- *****************************************************************************/
- void UI_dummy_reset_current_two_line_menuitem_data(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return;
- }
- #endif /* (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__) */
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- /*****************************************************************************
- * FUNCTION
- * UI_dummy_show_two_line_menuitem_part
- * DESCRIPTION
- * dummy function to show two line menuitem part
- * PARAMETERS
- * void
- * RETURNS
- * string to be displayed(?)
- *****************************************************************************/
- void UI_dummy_show_two_line_menuitem_part(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * UI_dummy_move_two_line_menuitem_part
- * DESCRIPTION
- * dummy function to move two line menuitem part
- * PARAMETERS
- * x [IN]
- * y [IN]
- * RETURNS
- * string to be displayed(?)
- *****************************************************************************/
- void UI_dummy_move_two_line_menuitem_part(S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * UI_dummy_resize_two_line_menuitem_part
- * DESCRIPTION
- * dummy function to resize two line menuitem part
- * PARAMETERS
- * x [IN]
- * y [IN]
- * RETURNS
- * string to be displayed(?)
- *****************************************************************************/
- void UI_dummy_resize_two_line_menuitem_part(S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * UI_dummy_get_two_line_menuitem_height
- * DESCRIPTION
- * dummy function to whether the current menuitem is two line
- * PARAMETERS
- * void
- * RETURNS
- * string to be displayed
- *****************************************************************************/
- pBOOL UI_dummy_get_two_line_menuitem_height(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * UI_dummy_two_line_get_thumbnail_flags
- * DESCRIPTION
- * dummy function that returns thumbnail flags
- * PARAMETERS
- * void
- * RETURNS
- * no thumbnail flag
- *****************************************************************************/
- U8 UI_dummy_two_line_get_thumbnail_flags(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return 0;
- }
- /*----------------------------------------------------------------------------
- The various callbakcs for two line menu item are defined below this line.
- ----------------------------------------------------------------------------*/
- U8(*gui_two_line_get_thumbnail_flags) (void) = UI_dummy_two_line_get_thumbnail_flags;
- void (*gui_reset_two_line) (void) = UI_dummy_function;
- void (*gui_two_line_toggle_thumbnail_direction) (void) = UI_dummy_function;
- void (*gui_set_current_two_line_menuitem_data) (void) = UI_dummy_set_current_two_line_menuitem_data;
- #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */
- #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
- void (*gui_reset_current_two_line_menuitem_data) (void) = UI_dummy_set_current_two_line_menuitem_data;
- #endif
- #if defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- void (*gui_show_two_line_menuitem_part) (void) = UI_dummy_show_two_line_menuitem_part;
- void (*gui_move_two_line_menuitem_part) (S32 x, S32 y) = UI_dummy_move_two_line_menuitem_part;
- void (*gui_resize_two_line_menuitem_part) (S32 x, S32 y) = UI_dummy_resize_two_line_menuitem_part;
- pBOOL(*gui_get_two_line_menuitem_height) (void) = UI_dummy_get_two_line_menuitem_height;
- #endif /* defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */
- // TODO: modify function name
- #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
- /*****************************************************************************
- * FUNCTION
- * scrolling_text_draw_two_line_background
- * DESCRIPTION
- * Function to display backgrounds for two line hint/select menuitem
- * with scrolling
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * co(?) [IN] Ordinates for background draw area
- * RETURNS
- * void
- *****************************************************************************/
- void scrolling_text_draw_two_line_background(S32 x1, S32 y1, S32 x2, S32 y2)
- {
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!gui_is_current_transparency_with_multi_layer())
- {
- gui_fixed_icontext_disable_transparent_effect(&MMI_fixed_icontext_menuitem); /* To hide text below scrolling text */
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- gui_draw_filled_area(x1, y1, x2, y2, MMI_fixed_icontext_menuitem.focussed_filler);
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- gui_fixed_icontext_enable_transparent_effect(&MMI_fixed_icontext_menuitem); /* To hide text below scrolling text */
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * line_scrolling_text_timer_handler
- * DESCRIPTION
- * called on timer expiry to draw two line hint/select menuitem text
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void line_scrolling_text_timer_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_handle_scrolling_text(&gui_two_line_scroll_text);
- }
- /*****************************************************************************
- * FUNCTION
- * two_line_menuitem_cleanup_function
- * DESCRIPTION
- * clean up function mainly to stop scrolling text on category exit.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void two_line_menuitem_cleanup_function(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_scrolling_text_stop(&gui_two_line_scroll_text);
- gui_reset_current_two_line_menuitem_data();
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- gui_reset_two_line();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * gui_show_two_line_icontext_menuitem
- * DESCRIPTION
- * Function to display an two line hint/select menuitem
- * PARAMETERS
- * item [?]
- * common_item_data [?]
- * x [IN]
- * y [IN]
- * pointer(?) [IN] To menuitem, common data and letft corner co-ordinates
- * RETURNS
- * void
- *****************************************************************************/
- void gui_show_two_line_icontext_menuitem(void *item, void *common_item_data, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* Locals Start */
- S32 x1, y1, x2, y2;
- S32 text_x1 = 0;
- S32 text_x2 = 0;
- S32 text_y1 = 0;
- S32 text_y2 = 0;
- S32 icon_x = 0;
- S32 icon_y = 0;
- S32 icon_width = 0;
- S32 icon_height = 0;
- S32 image_width = 0;
- S32 image_height = 0;
- S32 sw = 0, sh = 0;
- U8 show_two_line_hints = 1;
- U8 thumbnail_flags = 0;
- U32 flags;
- 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;
- UI_string_type _text = NULL;
- #ifdef __MMI_UI_HINTS_IN_MENUITEM__
- UI_string_type _hint_text = NULL;
- #endif
- PU8 _icon = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Locals End */
- gui_add_cleanup_hook(two_line_menuitem_cleanup_function);//053006 2 line Calvin
- 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) - 1;
- gui_lock_double_buffer();
- #if defined(__MMI_UI_HINTS_IN_MENUITEM__) && defined(__MMI_UI_TWO_LINE_MENUITEM_STYLES__)
- if ((_hint_text = gui_get_current_pop_up_description_string()) == NULL ||
- (m->ext_flags & UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT))
- #elif defined (__MMI_UI_HINTS_IN_MENUITEM__)
- if ((_hint_text = gui_get_current_pop_up_description_string()) == NULL)
- #endif
- {
- show_two_line_hints = 0;
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- thumbnail_flags = gui_two_line_get_thumbnail_flags();
- #endif
- }
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- if (r2lMMIFlag && thumbnail_flags)
- {
- gui_two_line_toggle_thumbnail_direction();
- thumbnail_flags = gui_two_line_get_thumbnail_flags();
- }
- #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_reset_current_list_effect();
- #endif
- /* Draw Filler Start */
- if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS) && (flags & UI_MENUITEM_STATE_FOCUSSED))
- {
- gui_push_clip();
- gui_set_clip(x1, y1, x2, y2);
- f = m->focussed_filler;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- /* Currently special list effect is not supported in two-line menu item */
- gui_draw_list_filled_area(x1, y1, x2, y2, f);
- #else
- gui_draw_filled_area(x1, y1, x2, y2, f);
- #endif
- gui_pop_clip();
- }
- /* Draw Filler End */
- if (!show_two_line_hints)
- {
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- if (!gui_is_current_transparency_with_multi_layer())
- {
- gui_fixed_icontext_disable_transparent_effect(m); /* To hide text below scrolling text */
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- }
- if (_icon != UI_NULL_IMAGE)
- {
- gui_measure_image(_icon, &icon_width, &icon_height);
- }
- else
- {
- icon_width = icon_height = 0;
- }
- /* scenario 0 - No Image, 1 - LEFT Image, 2 - RIGHT Image */
- if (show_two_line_hints
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- || (thumbnail_flags == UI_TWO_LINE_MENUITEM_NO_THUMBNAIL)
- #endif
- )
- {
- image_width = image_height = 0;
- if (r2lMMIFlag)
- {
- /* Icon calculation */
- icon_x = x2 - m->text_x + 2; /* Use text position to compute icon position */
- icon_y = y1;
- /* Text calculation */
- text_x1 = x1;
- text_x2 = x2 - m->text_x;
- text_y1 = y1;
- text_y2 = text_y1 + ((y2 - y1) >> 1);
- }
- else
- {
- /* Icon calculation */
- icon_x = x1 + m->icon_x;
- icon_y = y1;
- /* Text calculation */
- text_x1 = x1 + m->text_x;
- text_x2 = x2;
- text_y1 = y1;
- text_y2 = text_y1 + ((y2 - y1) >> 1);
- }
- if ((flags & UI_MENUITEM_DISABLE_ICON) && (_icon == UI_NULL_IMAGE))
- {
- if (r2lMMIFlag)
- {
- text_x2 = x2 - 2;
- }
- else
- {
- text_x1 = x1 + 2;
- }
- }
- }
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- else if (thumbnail_flags & UI_TWO_LINE_MENUITEM_LEFT_ALIGN_THUMBNAIL)
- {
- image_width = image_height = (m->height << 1);
- /* Icon calculation */
- icon_x = x2 - m->text_x + 2;
- icon_y = y1;
- /* Text calculation */
- text_x1 = x1 + image_width + 2;
- text_x2 = x2 - (m->text_x + GUI_TWO_LINE_TEXT_ICON_GAP);
- text_y1 = y1;
- text_y2 = text_y1 + ((y2 - y1) >> 1);
- if ((flags & UI_MENUITEM_DISABLE_ICON) && (_icon == UI_NULL_IMAGE))
- {
- text_x2 = x2 - GUI_TWO_LINE_TEXT_ICON_GAP;
- }
- }
- else if (thumbnail_flags & UI_TWO_LINE_MENUITEM_RIGHT_ALIGN_THUMBNAIL)
- {
- image_width = image_height = (m->height << 1);
- /* Icon calculation */
- icon_x = x1 + m->icon_x;
- if ((flags & UI_MENUITEM_DISABLE_ICON) && (_icon == UI_NULL_IMAGE))
- {
- text_x1 = x1 + 2;
- }
- else
- {
- text_x1 = x1 + m->text_x;
- }
- icon_y = y1;
- /* Text calulation */
- text_x2 = x2 - image_width - 2;
- text_y1 = y1;
- text_y2 = text_y1 + ((y2 - y1) >> 1);
- }
- #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */
- /* Text Start */
- if (_text != NULL && (!(flags & UI_MENUITEM_DISABLE_TEXT_DISPLAY)))
- {
- gui_push_text_clip();
- gui_set_text_clip(text_x1, text_y1, text_x2, text_y2);
- gui_set_font(MMI_fixed_icontext_menuitem.text_font);
- gui_measure_string((UI_string_type) _text, &sw, &sh);
- text_y1 += (m->height >> 1) - (sh >> 1); /* Center Vertically */
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_FOCUSED_TWO_LINE_ICONTEXT;
- #endif
- /* Use another scroll handler */
- gui_fixed_icontext_menuitem_stop_scroll();
- gui_set_text_color(MMI_fixed_icontext_menuitem.focussed_text_color);
- }
- else
- {
- gui_set_text_color(MMI_fixed_icontext_menuitem.normal_text_color);
- }
- if (sw < (text_x2 - text_x1 - 1) || (!(flags & UI_MENUITEM_STATE_FOCUSSED)))
- {
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(text_x2, text_y1);
- }
- else
- {
- gui_move_text_cursor(text_x1, text_y1);
- }
- gui_print_text((UI_string_type) _text);
- }
- else
- {
- gui_create_scrolling_text(
- &gui_two_line_scroll_text,
- text_x1,
- text_y1,
- text_x2 - text_x1,
- sh + 1,
- (UI_string_type) _text,
- line_scrolling_text_timer_handler,
- scrolling_text_draw_two_line_background,
- MMI_fixed_icontext_menuitem.focussed_text_color,
- MMI_fixed_icontext_menuitem.focussed_text_color);
- gui_show_scrolling_text(&gui_two_line_scroll_text);
- }
- gui_pop_text_clip();
- }
- //Text End
- //Icon Start
- if (_icon != UI_NULL_IMAGE)
- {
- gui_push_clip();
- gui_measure_image(_icon, &sw, &sh);
- icon_y += (m->height >> 1) - (sh >> 1); /* Center Vertically */
- gui_set_clip(icon_x, icon_y, icon_x + sw, icon_y + sh);
- /* gui_show_transparent_animated_image_frame(icon_x,icon_y,_icon,m->icon_transparent_color,0); */
- gdi_image_draw_animation_single_frame(icon_x, icon_y, (U8*) _icon, 0);
- gui_pop_clip();
- }
- /* Icon End */
- #ifdef __MMI_UI_HINTS_IN_MENUITEM__
- if (show_two_line_hints)
- {
- S32 hint_x1 = text_x1; /* Use the same X position as item text */
- S32 hint_y1 = y + m->height;
- S32 hint_x2 = text_x2;
- S32 hint_y2 = hint_y1 + m->height - 1;
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_HIGHLIGHT_TWO_LINE_HINTS;
- #endif
- gui_show_two_line_hint_part(hint_x1, hint_x2, hint_y1, hint_y2, _hint_text, flags);
- gui_unlock_double_buffer();
- return;
- }
- #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- /* Two Line Start */
- {
- gui_move_two_line_menuitem_part(x1 + 2, y1 + m->height);
- gui_resize_two_line_menuitem_part(x2 - x1 - 4, m->height);
- gui_show_two_line_menuitem_part();
- gui_unlock_double_buffer();
- return;
- }
- /* Two Line End */
- #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_two_line_scroller_stop
- * DESCRIPTION
- * Function to stop two line scroll timer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_two_line_scroller_stop(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_scrolling_text_stop(&gui_two_line_scroll_text);
- }
- #endif /* (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__) */