gui_fixed_menuitems.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:278k
源码类别:

MTK

开发平台:

C/C++

  1.     }
  2.     gui_measure_string(s, (S32*) & char_width, (S32*) & char_height);
  3.     if (char_width <= line_width)
  4.     {
  5.         if (!r2lMMIFlag)
  6.         {
  7.             cursor_pos_x = x + ((line_width - char_width) >> 1);
  8.         }
  9.         else
  10.         {
  11.             cursor_pos_x = x - ((line_width - char_width) >> 1);
  12.         }
  13.         gui_move_text_cursor(cursor_pos_x, cursor_pos_y);
  14.         gui_print_text(s);
  15.         return;
  16.     }
  17.     gui_move_text_cursor(x, y);
  18.     gui_push_clip();
  19.     gui_set_clip(x, y, x + line_width, y + char_height);
  20.     while (s[char_index] != terminal[0] && total_rows <= number_of_rows)
  21.     {
  22.         gui_measure_character(s[char_index], (S32*) & char_width, (S32*) & char_height);
  23.         if (current_line_width + char_width < line_width - es_width)
  24.         {
  25.             gui_print_character(s[char_index++]);
  26.             if (!r2lMMIFlag)
  27.             {
  28.                 cursor_pos_x += char_width;
  29.             }
  30.             else
  31.             {
  32.                 cursor_pos_x -= char_width;
  33.             }
  34.             current_line_width += char_width;
  35.             gui_move_text_cursor(cursor_pos_x, cursor_pos_y);
  36.             if (line_height < char_height)
  37.             {
  38.                 line_height = char_height;
  39.             }
  40.         }
  41.         else
  42.         {
  43.             if (total_rows < number_of_rows)    /* still can add new lines */
  44.             {
  45.                 if (line_height < char_height)
  46.                 {
  47.                     line_height = char_height;
  48.                 }
  49.                 total_rows++;
  50.                 cursor_pos_x = x;
  51.                 cursor_pos_y += line_height + 1;
  52.                 current_line_width = 0;
  53.                 gui_move_text_cursor(cursor_pos_x, cursor_pos_y);
  54.                 gui_print_character(s[char_index++]);
  55.                 if (!r2lMMIFlag)
  56.                 {
  57.                     cursor_pos_x += char_width;
  58.                 }
  59.                 else
  60.                 {
  61.                     cursor_pos_x -= char_width;
  62.                 }
  63.                 current_line_width += char_width;
  64.                 gui_move_text_cursor(cursor_pos_x, cursor_pos_y);
  65.             }
  66.             else
  67.             {
  68.                 gui_print_text((UI_string_type) es);
  69.                 break;
  70.             }
  71.         }
  72.     }
  73.     gui_pop_clip();
  74. }
  75. #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  76. /*****************************************************************************
  77.  * FUNCTION
  78.  *  gui_show_fixed_icontext_menuitem
  79.  * DESCRIPTION
  80.  *  
  81.  * PARAMETERS
  82.  *  item                    [?]         
  83.  *  common_item_data        [?]         
  84.  *  x                       [IN]        
  85.  *  y                       [IN]        
  86.  * RETURNS
  87.  *  void
  88.  *****************************************************************************/
  89. void gui_show_fixed_icontext_menuitem(void *item, void *common_item_data, S32 x, S32 y)
  90. {
  91.     /*----------------------------------------------------------------*/
  92.     /* Local Variables                                                */
  93.     /*----------------------------------------------------------------*/
  94.     S32 x1, y1, x2, y2;
  95.     /* relative x offset of text inside menu item. 
  96.        (which might be different from m->text_x in Arabic or scrolling) */
  97.     S32 text_x = 0;
  98.     /* relative y offset of text inside menu item. */
  99.     S32 text_y = 0;
  100. #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  101.     S32 hint_height = 0;
  102. #endif 
  103. #if (defined __MMI_UI_HINTS_IN_MENUITEM__ || defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__)
  104.     MMI_BOOL show_hint_in_menuitem = MMI_FALSE;
  105. #endif 
  106.     S32 ani_w, ani_h;
  107.     color text_color;
  108.     UI_filled_area *f = NULL;
  109.     fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) common_item_data;
  110.     fixed_icontext_menuitem_type *mi = (fixed_icontext_menuitem_type*) item;
  111.     U32 flags;
  112.     UI_string_type _text;
  113.     PU8 _icon;
  114.     U8 animation_flag = 0;
  115.     S32 sw = 0, sh = 0, max_text_width = 0;
  116.     S32 is_text_full_width = 0;   
  117.     /*----------------------------------------------------------------*/
  118.     /* Code Body                                                      */
  119.     /*----------------------------------------------------------------*/
  120.     flags = mi->flags;
  121.     flags |= m->flags;
  122.     _text = mi->item_text;
  123.     _icon = mi->item_icon;
  124.     x1 = x;
  125.     y1 = y;
  126.     x2 = x1 + m->width - 1;
  127.     y2 = y1 + m->height - 1;
  128. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  129.     if ((m->ext_flags & UI_MENUITEM_SHOW_ALL_HINTS) ||
  130.         ((flags & UI_MENUITEM_STATE_FOCUSSED) && (m->ext_flags & UI_MENUITEM_SHOW_HIGHLIGHTED_HINT)))
  131.     {
  132.         if (gui_get_current_pop_up_description_string())
  133.         {
  134.             show_hint_in_menuitem = MMI_TRUE;
  135.         }
  136.     }
  137. #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 
  138. #if (defined __MMI_UI_HINTS_IN_MENUITEM__ || defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__)
  139.     if (show_hint_in_menuitem
  140. #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
  141.         || (m->ext_flags & UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT)
  142. #endif 
  143.         )
  144.     {
  145.         gui_show_two_line_icontext_menuitem(item, common_item_data, x, y);
  146.         return;
  147.     }
  148. #endif /* (defined __MMI_UI_HINTS_IN_MENUITEM__ || defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__) */ 
  149.     if (flags & UI_MENUITEM_INLINE_EDIT_OBJECT)
  150.     {
  151.         if (flags & UI_MENUITEM_STATE_FOCUSSED)
  152.         {
  153.             /* Remove the display of background filler when the default text effect is enabled */
  154.         #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  155.             if (!(mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT))
  156.         #endif 
  157.             {
  158.                 if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
  159.                 {
  160.                     gui_draw_filled_area(x1 + 2, y1, x2, y2, m->focussed_filler);
  161.                 }
  162.             }
  163.             /* display the focussed inline item with different coordinates when the default
  164.                text effect is enabled. */
  165.         #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  166.             if ((mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT))
  167.             {
  168.                 if (r2lMMIFlag)
  169.                 {
  170.                     gui_display_pop_up_description(x + 2, y + 1, m->width - m->text_x, ((m->height - 1) - 1));
  171.                 }
  172.                 else
  173.                 {
  174.                     gui_display_pop_up_description(x + m->text_x, y + 1, m->width - m->text_x, ((m->height - 1) - 1));
  175.                 }
  176.             }
  177.             else
  178.         #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */ 
  179.             {
  180.                 gui_display_pop_up_description(x + 2, y, m->width - 2, m->height);
  181.             }
  182.         }
  183.         else
  184.         {
  185.             /* START TARUN PMT 20041016 : For Font size variation */
  186.             gui_set_font(m->text_font);
  187.             /* END TARUN PMT 20041016 */
  188.             /* display the unfocussed inline item with different coordinates when the default
  189.                text effect is enabled. */
  190.         #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  191.             if ((mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT))
  192.             {
  193.                 if (r2lMMIFlag)
  194.                 {
  195.                     wgui_show_inline_edit_menuitem(x + 2, y + 1, m->width - m->text_x, ((m->height - 1) - 1));
  196.                 }
  197.                 else
  198.                 {
  199.                     wgui_show_inline_edit_menuitem(x + m->text_x, y + 1, m->width - m->text_x, ((m->height - 1) - 1));
  200.                 }
  201.             }
  202.             else
  203.         #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */ 
  204.             {
  205.                 wgui_show_inline_edit_menuitem(x + 2, y, m->width - 2, m->height);
  206.             }
  207.         }
  208.         return;
  209.     }
  210.     if (flags & UI_MENUITEM_STATE_FOCUSSED)
  211.     {
  212.     #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
  213.         g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_FOCUSED_ICONTEXT_ITEM;
  214.     #endif
  215.         GUI_current_fixed_icontext_menuitem_x = x;
  216.         GUI_current_fixed_icontext_menuitem_y = y;
  217.     }
  218.     if (!(flags & UI_MENUITEM_DISABLE_TEXT_DISPLAY))
  219.     {
  220.         /* Autocalculate the text position based on font   */
  221.         gui_set_font(m->text_font);
  222.         gui_measure_string(_text, &sw, &sh);
  223.         if (flags & UI_MENUITEM_CENTER_TEXT_X)
  224.         {
  225.             m->text_x = (m->width >> 1) - (sw >> 1);
  226.         }
  227.         if (flags & UI_MENUITEM_CENTER_TEXT_Y)
  228.         {
  229.             m->text_y = (m->height >> 1) - (sh >> 1);
  230.         }
  231.     }
  232.     /* Autocalculate the icon position                 */
  233. #ifndef __MMI_KP_STYLE_MAIN_MENU_MATRIX__   //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19
  234.     if (_icon != UI_NULL_IMAGE)
  235. #endif  //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19
  236.     {
  237.         S32 icon_width, icon_height;
  238.         gui_measure_image(_icon, &icon_width, &icon_height);
  239. //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 start
  240. #ifdef __MMI_KP_STYLE_MAIN_MENU_MATRIX__
  241. if(GetActiveScreenId() == MAIN_MENU_SCREENID)
  242. {
  243. //jerson modify begin 20070625
  244. #if defined(__MMI_MAINLCD_176X220__)
  245. icon_width = 58;
  246. icon_height =45; 
  247. #elif defined(__MMI_MAINLCD_240X320__)
  248. icon_width = 80;
  249. icon_height =66;  
  250. #endif
  251. //jerson modify end 20070625
  252. }
  253. #endif
  254. //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 end
  255.         if (flags & UI_MENUITEM_CENTER_ICON_X)
  256.         {
  257.             m->icon_x = (m->width >> 1) - (icon_width >> 1);
  258.         }
  259.         if (flags & UI_MENUITEM_CENTER_ICON_Y)
  260.         {
  261.             m->icon_y = (m->height >> 1) - (icon_height >> 1);
  262.         }
  263.     }
  264.     /* Compute text_x and text_y */
  265. #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  266.     if (MMI_current_menu_type == LIST_MENU)
  267.     {
  268.         text_x = m->text_x + TEXT_ICON_GAP; /* To show gap from grid */
  269.     }
  270.     else
  271. #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  272.     {
  273.         text_x = m->text_x;
  274.     }
  275.     text_y = m->text_y;
  276.     /* For inline edit captions to appear from left when there is no icon   */
  277.     if ((flags & UI_MENUITEM_DISABLE_ICON) && (_icon == UI_NULL_IMAGE))
  278.     {
  279.         is_text_full_width = 1;
  280.         text_x = 2;
  281.     }
  282.     if (r2lMMIFlag)
  283.     {
  284.         text_x = m->width - 1 - text_x;
  285.     }
  286. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  287.     if (MMI_current_menu_type == LIST_MATRIX_MENU)
  288.     {
  289.         is_text_full_width = 1;
  290.     }
  291. #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  292. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  293.     /* To hide the text and icon of the menuitem up to the last frame for flash feel effect */
  294.     if (gblock_list_effect == 0)
  295.     {
  296.         if (gui_get_current_list_effect() == MMI_UI_LIST_HIGHLIGHT_EFFECT_FLASH_FEELING &&
  297.             MMI_current_menu_type == LIST_MENU)
  298.         {
  299.             if (flash_feel_last_frame == 0)
  300.             {
  301.                 if (flags & UI_MENUITEM_STATE_FOCUSSED)
  302.                 {
  303.                     _icon = UI_NULL_IMAGE;
  304.                     flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY;
  305.                 }
  306.             }
  307.         }
  308.     }
  309. #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  310.     /* Setup text scroll and background filler */
  311.     if (flags & UI_MENUITEM_STATE_FOCUSSED)
  312.     {
  313.         text_x += m->scroll_x;
  314.     }
  315.     if ((flags & UI_MENUITEM_STATE_FOCUSSED) && (flags & UI_MENUITEM_FOCUSSED_ANIMATE))
  316.     {
  317.         animation_flag = 1;
  318.     }
  319.     if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(flags & UI_MENUITEM_DISABLE_HIGHLIGHT))
  320.     {
  321.         if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
  322.         {
  323.             f = m->focussed_filler;
  324.         }
  325.         text_color = m->focussed_text_color;
  326.     }
  327.     else if (flags & UI_MENUITEM_STATE_DISABLED)
  328.     {
  329.         if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND) && !(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
  330.         {
  331.             f = m->disabled_filler;
  332.         }
  333.         text_color = m->focussed_text_color;
  334.     }
  335.     else if (flags & UI_MENUITEM_STATE_SELECTED)
  336.     {
  337.         f = m->selected_filler;
  338.         text_color = m->selected_text_color;
  339.         if (flags & UI_MENUITEM_SELECTED_ANIMATE)
  340.         {
  341.             animation_flag = 1;
  342.         }
  343.     }
  344.     else
  345.     {
  346.         if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND) && !(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
  347.         {
  348.             f = m->normal_filler;
  349.         }
  350.     #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  351.         // if condition is not correct. It fails when any other flag is ON 
  352.         // along with UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT.
  353.         if (mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT)
  354.         {
  355.             f = m->selected_filler;
  356.         }
  357.     #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */ 
  358.         text_color = m->normal_text_color;
  359.     }
  360.     gui_push_clip();
  361.     if (MMI_current_menu_type == MATRIX_MENU)
  362.     {
  363.         if (animation_flag)
  364.         {
  365.             gui_measure_image(MMI_mm_animation, &ani_w, &ani_h);
  366.             if (ani_w > m->width)
  367.             {
  368.                 m->icon_x -= ((ani_w - m->width) >> 1); /* 030705 Calvin added */
  369.                 //if ( ( x1+m->icon_x - ((ani_w-m->width)>>1) ) > MMI_fixed_matrix_menu.x )
  370.                 //  m->icon_x -= ((ani_w-m->width)>>1);
  371.                 //if ( x1+m->icon_x+ani_w > MMI_fixed_matrix_menu.x+MMI_fixed_matrix_menu.width )
  372.                 //  m->icon_x -= ((ani_w-m->width)>>1);
  373.                 if (x1 + m->icon_x < MMI_fixed_matrix_menu.x)
  374.                 {
  375.                     m->icon_x = MMI_fixed_matrix_menu.x - x1;
  376.                 }
  377.                 if (x1 + m->icon_x + ani_w > MMI_fixed_matrix_menu.x + MMI_fixed_matrix_menu.width)
  378.                 {
  379.                     m->icon_x = MMI_fixed_matrix_menu.x + MMI_fixed_matrix_menu.width - x1 - ani_w;
  380.                 }
  381.             }
  382.             if (ani_h > m->height)
  383.             {
  384.                 m->icon_y -= ((ani_h - m->height) >> 1);    /* 030705 Calvin added */
  385.                 //if ( ( y1+m->icon_y - ((ani_h-m->height)>>1) ) > MMI_fixed_matrix_menu.y )
  386.                 //  m->icon_y -= ((ani_h-m->height)>>1);
  387.                 //if ( y1+m->icon_y+ani_h > MMI_fixed_matrix_menu.y+MMI_fixed_matrix_menu.height )
  388.                 //  m->icon_y -= ((ani_h-m->height)>>1);
  389.                 if (y1 + m->icon_y < MMI_fixed_matrix_menu.y)
  390.                 {
  391.                     m->icon_y = MMI_fixed_matrix_menu.y - y1;
  392.                 }
  393.                 if (y1 + m->icon_y + ani_h > MMI_fixed_matrix_menu.y + MMI_fixed_matrix_menu.height)
  394.                 {
  395.                     m->icon_y = MMI_fixed_matrix_menu.y + MMI_fixed_matrix_menu.height - y1 - ani_h;
  396.                 }
  397.             }
  398.             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);
  399.         }
  400.         else
  401.         {
  402.             gui_measure_image(_icon, &ani_w, &ani_h);
  403. //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 start
  404. #ifdef __MMI_KP_STYLE_MAIN_MENU_MATRIX__
  405. if(GetActiveScreenId() == MAIN_MENU_SCREENID)
  406. {
  407. //jerson modify begin 20070625
  408. #if defined(__MMI_MAINLCD_176X220__)
  409. ani_w = 58;
  410. ani_h =45; 
  411. #elif defined(__MMI_MAINLCD_240X320__)
  412. ani_w = 80;
  413. ani_h =66;  
  414. #endif
  415. //jerson modify end 20070625
  416. }
  417. #endif
  418. //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 end
  419.             gui_set_clip(x1, y1, x1 + m->width + ani_w - 1, y1 + m->height + ani_h - 1);
  420.         }
  421.     }
  422.     else
  423.     {
  424.         if (MMI_current_menu_type == MATRIX_MENU_EMS)
  425.         {
  426.             gui_set_clip(x1 - 1, y1 - 1, x2 + 1, y2 + 1);
  427.         }
  428.         else
  429.         {
  430.             gui_set_clip(x1, y1, x2, y2);
  431.         #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  432.             hint_height = 0;
  433.             if (_icon != UI_NULL_IMAGE && line_draw && MMI_current_menu_type == LIST_MENU)
  434.             {
  435.                 if (r2lMMIFlag)
  436.                 {
  437.                     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 */
  438.                 }
  439.                 else
  440.                 {
  441.                     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 */
  442.                 }
  443.             }
  444.         #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  445.         }
  446.     }
  447.     if (m->flags & UI_MENUITEM_DISABLE_HIGHLIGHT_DISPLAY)
  448.     {
  449.         f = NULL;
  450.     }
  451.     if (MMI_current_menu_type != MATRIX_MENU && f != NULL && MMI_current_menu_type != MATRIX_MENU_EMS)
  452.     {
  453.     #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  454.         if (MMI_current_menu_type == LIST_MATRIX_MENU)
  455.         {
  456.         #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  457.             set_start_position_and_item_parameters_for_list_highlighter_effect(item, common_item_data, x1, y1);
  458.         #endif 
  459.             if (r2lMMIFlag)
  460.             {
  461.                 gui_draw_filled_area(x1, y1 + text_y, x1 + text_x, y2, f);
  462.             }
  463.             else
  464.             {
  465.                 gui_draw_filled_area(x1 + text_x, y1 + text_y, x2, y2, f);
  466.             }
  467.         }
  468.         else
  469.     #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  470.         {
  471.         #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  472.             // if condition is not correct. It fails when any other flag is ON 
  473.             // along with UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT.
  474.             if (mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT)
  475.             {
  476.                 /* gui_draw_filled_area(x1 + m->text_x - 1, y1 + 2, x2, y2-1, f); */
  477.                 if (r2lMMIFlag)
  478.                 {
  479.                     gui_draw_filled_area(x1 + 1, y1 + 1, x2 - m->text_x + 1, y2 - 1, f);
  480.                 }
  481.                 else
  482.                 {
  483.                     gui_draw_filled_area(x1 + m->text_x, y1 + 1, x2, y2 - 1, f);
  484.                 }
  485.             }
  486.             else
  487.         #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */ 
  488.             {
  489.             #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
  490.                #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  491.                    if (is_draw_next_frame_list_highlight_effect_value())
  492.                #endif
  493.    {
  494.                        g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_HIGHLIGHT_ICONTEXT_ITEM;
  495.    }
  496.             #endif
  497.             #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  498.                 set_start_position_and_item_parameters_for_list_highlighter_effect(item, common_item_data, x1, y1);
  499.                 #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  500.                      if (line_draw)
  501.  {
  502.                         gui_draw_list_filled_area(x1 + 1, y1 + 1, x2, y2, f);
  503.  }
  504.                      else
  505.                 #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  506.      gui_draw_list_filled_area(x1 + 1, y1, x2, y2, f);
  507.             #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  508.                  #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  509.                       if (line_draw && GUI_current_fixed_icontext_menuitem_scroll)
  510.   {
  511.                           gui_draw_filled_area(x1 + 1, y1 + 1, x2, y2, f);
  512.   } 
  513.                       else
  514.   {
  515.                           gui_draw_filled_area(x1 + 1, y1, x2, y2, f);
  516.   }
  517.                  #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
  518.   gui_draw_filled_area(x1, y1, x2, y2, &f1);
  519.                       gui_draw_filled_area(x1 + 1, y1+1, x2-1, y2-1, f);
  520.              #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  521.             }
  522.         }
  523.     #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  524.         if (line_draw && MMI_current_menu_type == LIST_MENU)
  525.         {
  526.             if (!r2lMMIFlag)
  527.             {
  528.                 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 */
  529.                 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 */
  530.             }
  531.         }
  532.         if (_icon != UI_NULL_IMAGE && line_draw && MMI_current_menu_type == LIST_MENU)
  533.         {
  534.             if (r2lMMIFlag)
  535.             {
  536.                 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 */
  537.             }
  538.             else
  539.             {
  540.                 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 */
  541.             }
  542.         }
  543.     #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  544.     }
  545. #ifndef __MMI_KP_STYLE_MAIN_MENU_MATRIX__   //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19
  546.     if (_icon != UI_NULL_IMAGE && !((m->ext_flags & UI_MENUITEM_EXT_SHOW_IN_MARQUEE) && animation_flag))
  547. #endif  //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19
  548.     {
  549.         if (mi->item_icon_handle != GDI_ERROR_HANDLE)
  550.         {
  551.             gdi_image_stop_animation(mi->item_icon_handle);
  552.             mi->item_icon_handle = GDI_ERROR_HANDLE;
  553.         }
  554.         if (animation_flag)
  555.         {
  556.         #if(UI_MAIN_MENU_ANIMATION_TYPE == UI_MAIN_MENU_ANIMATION_TYPE1)
  557.             /* to store animation handle. */
  558.             gdi_image_draw_animation(x1 + m->icon_x, y1 + m->icon_y, _icon, &mi->item_icon_handle);
  559.             /* mi->item_icon_handle=gui_show_transparent_animated_image(x1+m->icon_x,y1+m->icon_y,_icon,m->icon_transparent_color); */
  560.         #elif(UI_MAIN_MENU_ANIMATION_TYPE==UI_MAIN_MENU_ANIMATION_TYPE2)
  561.             //                      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);
  562.             //                      gdi_image_draw_animation_frames(x1+m->icon_x,y1+m->icon_y,mi->item_icon,(gdi_handle *)&mi->item_icon_handle,1);
  563.             if (MMI_current_menu_type == MATRIX_MENU)
  564.             {
  565.                 gdi_image_draw_animation(
  566.                     x1 + m->icon_x,
  567.                     y1 + m->icon_y,
  568.                     MMI_mm_animation,
  569.                     (gdi_handle*) & mi->item_icon_handle);
  570.             }
  571.             else if (MMI_current_menu_type == MATRIX_MENU_EMS)
  572.             {
  573.                 /* extern gdi_color GDI_COLOR_BLACK; */
  574.                 gdi_image_draw_animation(
  575.                     x1 + m->icon_x,
  576.                     y1 + m->icon_y,
  577.                     mi->item_icon,
  578.                     (gdi_handle*) & mi->item_icon_handle);
  579.                 gdi_draw_rect(x1 - 1, y1 - 1, x2 + 1, y2 + 1, GDI_COLOR_BLACK);
  580.             }
  581.             else
  582.             {
  583.                 gdi_image_draw_animation(
  584.                     x1 + m->icon_x,
  585.                     y1 + m->icon_y,
  586.                     mi->item_icon,
  587.                     (gdi_handle*) & mi->item_icon_handle);
  588.             }
  589.         #endif /* UI_MAIN_MENU_ANIMATION_TYPE */
  590.         }
  591.         else if (m->flags & UI_MENUITEM_STATE_ANIMATE)
  592.         {
  593.             gui_show_transparent_animated_image_frame(
  594.                 x1 + m->icon_x,
  595.                 y1 + m->icon_y,
  596.                 _icon,
  597.                 m->icon_transparent_color,
  598.                 1);
  599.             m->flags &= ~UI_MENUITEM_STATE_ANIMATE;
  600.         }
  601.         else if (MMI_current_menu_type == LIST_MENU)
  602.         {
  603.             S32 x_clip = 0, y_clip = 0;
  604.             gui_push_clip();
  605.             if (m->icon_x > 0)
  606.             {
  607.                 x_clip = m->icon_x;
  608.             }
  609.             if (m->icon_y > 0)
  610.             {
  611.                 y_clip = m->icon_y;
  612.             }
  613.             if (!r2lMMIFlag)
  614.             {
  615.                 gui_set_clip(x1 + x_clip, y1 + y_clip, x1 + m->text_x - 2, y1 + m->height - 2);
  616.                 gdi_image_draw_animation_single_frame(x1 + m->icon_x, y1 + m->icon_y, (U8*) _icon, 0);
  617.             }
  618.             else
  619.             {
  620.                 gui_set_clip(x2 - m->text_x + 2, y1 + y_clip, x2 - x_clip, y1 + m->height - 2);
  621.                 gdi_image_draw_animation_single_frame(x2 - m->text_x + 2, y1 + m->icon_y, (U8*) _icon, 0);
  622.             }
  623.             gui_pop_clip();
  624.         }
  625.         else if(flags & UI_MENUITEM_STATE_FOCUSSED)
  626. {
  627. gui_draw_filled_area(x1, y1, x2, y2, &f1);
  628. gui_draw_filled_area(x1 + 1, y1+1, x2-1, y2-1, f);
  629. gui_show_transparent_animated_image_frame(x1+m->icon_x,y1+m->icon_y,_icon,m->icon_transparent_color,0);
  630. }
  631. else
  632.         {
  633.             /* gui_show_transparent_animated_image_frame(x1+m->icon_x,y1+m->icon_y,_icon,m->icon_transparent_color,0); */
  634.             gdi_image_draw_animation_single_frame(x1 + m->icon_x, y1 + m->icon_y, (U8*) _icon, 0);
  635.         }
  636.     }
  637.     if (!(flags & UI_MENUITEM_DISABLE_TEXT_DISPLAY))
  638.     {
  639.         gui_push_text_clip();
  640.         if (!(flags & UI_MENUITEM_DISABLE_TEXT_CLIP))
  641.         {
  642.             if (is_text_full_width)
  643.             {
  644.                 /* FIXME. text_x might not be 0 */
  645.                 gui_set_text_clip(x1, y1, x2, y2);
  646.                 max_text_width = m->width;
  647.             }
  648.             else
  649.             {
  650.                 if (m->icon_x > m->text_x)
  651.                 {
  652.                     gui_set_text_clip(x1, y1, x1 + m->icon_x - 1, y2);
  653.                     max_text_width = m->icon_x - m->text_x;
  654.                 }
  655.                 else
  656.                 {
  657.                     if (!r2lMMIFlag)
  658.                     {
  659.                     #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  660.                         gui_set_text_clip(x1 + m->text_x + TEXT_ICON_GAP, y1, x2 - 2, y2);
  661.                     #else /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
  662.                         if (f && (f->flags & UI_FILLED_AREA_BORDER))
  663.                         {
  664.                             /* Leave space for border of background filler */
  665.                             gui_set_text_clip(x1 + m->text_x, y1, x2 - 2, y2);
  666.                         }
  667.                         else
  668.                         {
  669.                             gui_set_text_clip(x1 + m->text_x, y1, x2, y2);
  670.                         }
  671.                     #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
  672.                     }
  673.                     else
  674.                     {
  675.                     #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  676.                         gui_set_text_clip(x2 - m->width + 1 + TEXT_ICON_GAP, y1, x2 - m->text_x - TEXT_ICON_GAP, y2);
  677.                     #else /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
  678.                         if (f && (f->flags & UI_FILLED_AREA_BORDER))
  679.                         {
  680.                             /* Leave space for border of background filler */
  681.                             gui_set_text_clip(x1 + 2, y1, x2 - m->text_x, y2);
  682.                         }
  683.                         else
  684.                         {
  685.                             gui_set_text_clip(x1, y1, x2 - m->text_x, y2);
  686.                         }
  687.                     #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
  688.                     }
  689.                     max_text_width = x2 - (x1 + m->text_x) + 1;
  690.                 }
  691.             }
  692.         }
  693.         else
  694.         {
  695.             max_text_width = m->width - m->text_x;
  696.         }
  697.         /* move the cursor by 3 pixels when the default text effect is enabled and the
  698.            menu item is to be shown inside rectangle. */
  699.     #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  700.         if (mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT)
  701.         {
  702.             if (!r2lMMIFlag)
  703.             {
  704.                 gui_move_text_cursor(x1 + text_x + 3, y1 + text_y);
  705.             }
  706.             else
  707.             {
  708.                 gui_move_text_cursor(x1 + text_x - 3, y1 + text_y);
  709.             }
  710.         }
  711.         else
  712.     #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */ 
  713.         {
  714.             gui_move_text_cursor(x1 + text_x, y1 + text_y);
  715.         }
  716.         gui_set_line_height(sh);
  717.         gui_set_text_color(text_color);
  718.     #if(UI_USE_WORD_SCROLLING_TEXT)
  719.         if ((flags & UI_MENUITEM_STATE_FOCUSSED) && GUI_current_fixed_icontext_menuitem_scroll)
  720.         {
  721.             GUI_current_fixed_icontext_menuitem_scroll_text_end = GUI_current_fixed_icontext_menuitem_scroll_text;
  722.             if (gui_print_truncated_text2
  723.                 (x1 + text_x, y1 + text_y, max_text_width, &GUI_current_fixed_icontext_menuitem_scroll_text_end))
  724.             {
  725.                 GUI_current_fixed_icontext_menuitem_scroll_text_end = _text;
  726.             }
  727.         }
  728.         else
  729.         {
  730.             gui_print_truncated_text2(x1 + text_x, y1 + text_y, max_text_width, &_text);
  731.         }
  732.     #else /* (UI_USE_WORD_SCROLLING_TEXT) */ 
  733.         if ((flags & UI_MENUITEM_STATE_FOCUSSED) && (flags & UI_MENUITEM_MARQUEE_SCROLL) &&
  734.             GUI_current_fixed_icontext_menuitem_scroll)
  735.         {
  736.         #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
  737.             g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_HIGHLIGHT_ICONTEXT_MARQUEE_SCROLL;
  738.         #endif
  739.             /* fix long text in inline-select display overlap issue */
  740.             if (!(mi->ext_flags & UI_MENUITEM_EXT_DISABLE_FOCUSSED_TEXT_DISPLAY))
  741.             {
  742.                 gui_print_text(_text);
  743.             }
  744.             if (!r2lMMIFlag)
  745.             {
  746.                 gui_move_text_cursor(x1 + text_x + m->text_width + UI_text_menuitem_scroll_gap, y1 + text_y);
  747.             }
  748.             else
  749.             {
  750.                 gui_move_text_cursor(x1 + text_x - (m->text_width + UI_text_menuitem_scroll_gap), y1 + text_y);
  751.             }
  752.             gui_set_line_height(sh);
  753.             gui_print_text(_text);
  754.         }
  755.     #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  756.         else if (MMI_current_menu_type == LIST_MATRIX_MENU)
  757.         {
  758.             print_wrap_string(_text, x1 + text_x, y1 + text_y, 1, max_text_width);
  759.         }
  760.     #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  761.         else
  762.         {
  763.         #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  764.             /* 
  765.              * Text is getting displayed behind the left button in case of Inline Selection
  766.              * when the menu item is focussed. So remove the display of text when the item
  767.              * is focussed and UI_MENUITEM_EXT_DISABLE_FOCUSSED_TEXT_DISPLAY flag is ON
  768.              * for that item. 
  769.              */
  770.             if (!
  771.                 ((flags & UI_MENUITEM_STATE_FOCUSSED) &&
  772.                  (mi->ext_flags & UI_MENUITEM_EXT_DISABLE_FOCUSSED_TEXT_DISPLAY)))
  773.         #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */ 
  774.             {
  775.                 gui_print_text(_text);
  776.             }
  777.         }
  778.     #endif /* (UI_USE_WORD_SCROLLING_TEXT) */ 
  779.         gui_pop_text_clip();
  780.     }
  781.     if (flags & UI_MENUITEM_DOTTED_UNDERLINE)
  782.     {
  783.         static const U8 dotted_line_bitvalues[] = {1, 1, 1, 1, 0, 0, 0};
  784.         S32 r = max_text_width % 7; /* pattern width */
  785.         if (r == 0)
  786.         {
  787.             r = 7;
  788.         }
  789.         gdi_draw_line_style(
  790.             m->text_x,
  791.             y2,
  792.             m->text_x + max_text_width - 1 - r,
  793.             y2,
  794.             gdi_act_color_from_rgb(255, 112, 125, 240),
  795.             sizeof(dotted_line_bitvalues),
  796.             dotted_line_bitvalues);
  797.     }
  798.     gui_pop_clip();
  799. #if(UI_ENABLE_POP_UP_DESCRIPTIONS)
  800.     if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(m->ext_flags & UI_MENUITEM_EXT_SHOW_IN_MARQUEE))
  801.     {
  802.     #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  803.         /* pass the modified parameters in the function so that there is proper gapping
  804.            between the menu items. */
  805.         if (mi->ext_flags & UI_MENUITEM_EXT_SHOW_IN_ROUNDED_RECT)
  806.         {
  807.             gui_display_pop_up_description(x, y + 1, m->width, ((m->height - 1) - 1));
  808.         }
  809.         else
  810.     #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */ 
  811.         {
  812.             gui_display_pop_up_description(x, y, m->width, m->height);
  813.         }
  814.     }
  815. #endif /* (UI_ENABLE_POP_UP_DESCRIPTIONS) */ 
  816. #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
  817.     g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_HIGHLIGHT_NONE;
  818. #endif
  819. }
  820. #ifdef __MMI_TOUCH_SCREEN__
  821. /*****************************************************************************
  822.  * FUNCTION
  823.  *  gui_fixed_icontext_menuitem_translate_pen_event
  824.  * DESCRIPTION
  825.  *  
  826.  * PARAMETERS
  827.  *  item                    [?]         
  828.  *  common_item_data        [?]         
  829.  *  item_x                  [IN]        
  830.  *  item_y                  [IN]        
  831.  *  pen_event               [IN]        
  832.  *  x                       [IN]        
  833.  *  y                       [IN]        
  834.  *  menuitem_event          [?]         
  835.  *  menuitem_param          [?]         
  836.  * RETURNS
  837.  *  
  838.  *****************************************************************************/
  839. BOOL gui_fixed_icontext_menuitem_translate_pen_event(
  840.         void *item,
  841.         void *common_item_data,
  842.         S32 item_x,
  843.         S32 item_y,
  844.         mmi_pen_event_type_enum pen_event,
  845.         S16 x,
  846.         S16 y,
  847.         gui_list_pen_enum *menuitem_event,
  848.         gui_pen_event_param_struct *menuitem_param)
  849. {
  850.     /*----------------------------------------------------------------*/
  851.     /* Local Variables                                                */
  852.     /*----------------------------------------------------------------*/
  853.     gui_wait_longpress_enum w;
  854.     fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) common_item_data;
  855.     fixed_icontext_menuitem_type *mi = (fixed_icontext_menuitem_type*) item;
  856.     U32 flags = 0;
  857.     /*----------------------------------------------------------------*/
  858.     /* Code Body                                                      */
  859.     /*----------------------------------------------------------------*/
  860.     if (mi)
  861.     {
  862.         flags |= mi->flags;
  863.     }
  864.     if (m)
  865.     {
  866.         flags |= m->flags;
  867.     }
  868.     *menuitem_event = GUI_LIST_PEN_NONE;
  869. #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
  870.     /* FIXME: do not check pen up/down here */
  871.     if( ( pen_event == MMI_PEN_EVENT_UP || pen_event == MMI_PEN_EVENT_DOWN ) && gui_get_two_line_menuitem_height())
  872.     {
  873.     mmi_two_line_translate_pen_event(x, y, pen_event, menuitem_event);
  874.         
  875.         if (*menuitem_event == GUI_LIST_PEN_TWO_LINE_NEXT || *menuitem_event == GUI_LIST_PEN_TWO_LINE_PREVIOUS)
  876.         {
  877.             if (pen_event == MMI_PEN_EVENT_DOWN)
  878.             {
  879.                 *menuitem_event = GUI_LIST_PEN_NONE;
  880.             }
  881.             return MMI_TRUE;
  882.         }
  883.     }
  884. #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */
  885.     GUI_PEN_EVENT_PARAM_SET_VOID(menuitem_param);
  886.     if (flags & UI_MENUITEM_PEN_USE_LONGPRESS)
  887.     {
  888.         w = gui_pen_wait_longpress(pen_event, x, y);
  889.         if (w == GUI_WAIT_LONGPRESS_READY)
  890.         {
  891.             *menuitem_event = GUI_LIST_PEN_ITEM_SELECTED;
  892.         }
  893.         return MMI_TRUE;
  894.     }
  895.     else
  896.     {
  897.         return MMI_FALSE;
  898.     }
  899. }
  900. #endif /* __MMI_TOUCH_SCREEN__ */ 
  901. /*****************************************************************************
  902.  * FUNCTION
  903.  *  gui_hide_fixed_icontext_menuitem
  904.  * DESCRIPTION
  905.  *  Hides a fixed icontext menuitem
  906.  * PARAMETERS
  907.  *  item                    [IN]        Is a specific fixed icontext menuitem object
  908.  *  common_item_data        [IN]        Is the fixed icontext menuitem object (common_data)
  909.  *  x                       [IN]        Is the position at which the menuitem was displayed
  910.  *  y                       [IN]        Is the position at which the menuitem was displayed
  911.  * RETURNS
  912.  *  void
  913.  *****************************************************************************/
  914. void gui_hide_fixed_icontext_menuitem(void *item, void *common_item_data, S32 x, S32 y)
  915. {
  916.     /*----------------------------------------------------------------*/
  917.     /* Local Variables                                                */
  918.     /*----------------------------------------------------------------*/
  919.     S32 x1, y1, x2, y2, iwidth, iheight, ix1, iy1, ix2, iy2;
  920.     UI_filled_area *f;
  921.     fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) common_item_data;
  922.     fixed_icontext_menuitem_type *mi = (fixed_icontext_menuitem_type*) item;
  923.     U32 flags;
  924.     PU8 _icon;
  925.     /*----------------------------------------------------------------*/
  926.     /* Code Body                                                      */
  927.     /*----------------------------------------------------------------*/
  928.     flags = mi->flags;
  929.     flags |= m->flags;
  930.     _icon = mi->item_icon;
  931.     /* Autocalculate the icon position              */
  932.     if (_icon != UI_NULL_IMAGE)
  933.     {
  934.         S32 icon_width, icon_height;
  935.         gui_measure_image(_icon, &icon_width, &icon_height);
  936.         if (flags & UI_MENUITEM_CENTER_ICON_X)
  937.         {
  938.             m->icon_x = (m->width >> 1) - (icon_width >> 1);
  939.         }
  940.         if (flags & UI_MENUITEM_CENTER_ICON_Y)
  941.         {
  942.             m->icon_y = (m->height >> 1) - (icon_height >> 1);
  943.         }
  944.     }
  945.     x1 = x;
  946.     y1 = y;
  947.     x2 = x1 + m->width - 1;
  948.     y2 = y1 + m->height - 1;
  949.     if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(flags & UI_MENUITEM_DISABLE_HIGHLIGHT))
  950.     {
  951.         f = m->focussed_filler;
  952.     }
  953.     else if (flags & UI_MENUITEM_STATE_DISABLED)
  954.     {
  955.         f = m->disabled_filler;
  956.     }
  957.     else if (flags & UI_MENUITEM_STATE_SELECTED)
  958.     {
  959.         f = m->selected_filler;
  960.     }
  961.     else
  962.     {
  963.         f = m->normal_filler;
  964.     }
  965.     gui_set_clip(x1, y1, x2, y2);
  966.     gui_measure_image(_icon, &iwidth, &iheight);
  967.     ix1 = m->icon_x + x1;
  968.     iy1 = m->icon_y + y1;
  969.     ix2 = ix1 + iwidth - 1;
  970.     iy2 = iy1 + iheight - 1;
  971.     gui_push_clip();
  972.     gui_set_clip(ix1, iy1, ix2, iy2);
  973.     gui_draw_filled_area(x1, y1, x2, y2, f);
  974.     gui_pop_clip();
  975. }
  976. /*****************************************************************************
  977.  * FUNCTION
  978.  *  gui_measure_fixed_icontext_menuitem
  979.  * DESCRIPTION
  980.  *  Measures a fixed icontext menuitem
  981.  * PARAMETERS
  982.  *  item                    [?]         
  983.  *  common_item_data        [IN]        Is the fixed icontext menuitem object (common_data)
  984.  *  width                   [OUT]       
  985.  *  height                  [OUT]       
  986.  * RETURNS
  987.  *  void
  988.  *****************************************************************************/
  989. void gui_measure_fixed_icontext_menuitem(void *item, void *common_item_data, S32 *width, S32 *height)
  990. {
  991.     /*----------------------------------------------------------------*/
  992.     /* Local Variables                                                */
  993.     /*----------------------------------------------------------------*/
  994.     fixed_icontext_menuitem *t = (fixed_icontext_menuitem*) common_item_data;
  995.     /*----------------------------------------------------------------*/
  996.     /* Code Body                                                      */
  997.     /*----------------------------------------------------------------*/
  998.     UI_UNUSED_PARAMETER(item);
  999.     *width = t->width;
  1000.     *height = t->height;
  1001. #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
  1002.     // TODO: configure UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT in other place
  1003.     if (current_fixed_list_menuitem_display_index == -1 && gui_get_two_line_menuitem_height())
  1004.     {
  1005.         *height = *height << 1;
  1006.         t->ext_flags |= UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT;
  1007.         return;
  1008.     }
  1009.     else
  1010.     {
  1011.         t->ext_flags &= ~UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT;
  1012.     }
  1013. #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */ 
  1014. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  1015.     if (t->ext_flags & UI_MENUITEM_SHOW_HIGHLIGHTED_HINT && current_fixed_list_menuitem_display_index == -1 &&
  1016.         gui_get_current_pop_up_description_string())
  1017.     {
  1018.         *height = (*height) << 1;
  1019.     }
  1020.     else if (t->ext_flags & UI_MENUITEM_SHOW_ALL_HINTS && gui_get_current_pop_up_description_string())
  1021.     {
  1022.         *height = (*height) << 1;
  1023.     }
  1024. #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 
  1025. }
  1026. /*****************************************************************************
  1027.  * FUNCTION
  1028.  *  gui_highlight_fixed_icontext_menuitem
  1029.  * DESCRIPTION
  1030.  *  Highlights a fixed icontext menuitem (not visually)
  1031.  * PARAMETERS
  1032.  *  item                    [IN]        Is a specific fixed icontext menuitem object
  1033.  *  common_item_data        [IN]        
  1034.  * RETURNS
  1035.  *  void
  1036.  *****************************************************************************/
  1037. void gui_highlight_fixed_icontext_menuitem(void *item, void *common_item_data)
  1038. {
  1039.     /*----------------------------------------------------------------*/
  1040.     /* Local Variables                                                */
  1041.     /*----------------------------------------------------------------*/
  1042.     fixed_icontext_menuitem_type *t = (fixed_icontext_menuitem_type*) item;
  1043.     fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) common_item_data;
  1044.     U32 flags;
  1045.     /*----------------------------------------------------------------*/
  1046.     /* Code Body                                                      */
  1047.     /*----------------------------------------------------------------*/
  1048.     flags = m->flags;
  1049.     flags |= t->flags;
  1050.     GUI_current_fixed_icontext_menuitem_common_data = m;
  1051.     GUI_current_fixed_icontext_menuitem_data = t;
  1052. #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
  1053.     gui_set_current_two_line_menuitem_data();
  1054. #endif 
  1055.     gui_fixed_icontext_menuitem_stop_scroll();
  1056. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  1057.     gui_resize_fixed_icontext_menuitem(m, m->width, m->height);
  1058.     if (MMI_current_menu_type == LIST_MATRIX_MENU)
  1059.     {
  1060.         m->scroll_width = m->width - m->text_x;
  1061.     }
  1062. #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 
  1063.     gui_fixed_icontext_menuitem_start_scroll();
  1064.     if (t->flags & UI_MENUITEM_DISABLE_HIGHLIGHT)
  1065.     {
  1066.         return;
  1067.     }
  1068.     t->flags |= UI_MENUITEM_STATE_FOCUSSED;
  1069.     t->flags |= UI_MENUITEM_STATE_ANIMATE;
  1070. }
  1071. /*****************************************************************************
  1072.  * FUNCTION
  1073.  *  gui_remove_highlight_fixed_icontext_menuitem
  1074.  * DESCRIPTION
  1075.  *  Removes the highlight of a fixed icontext menuitem (not visually)
  1076.  * PARAMETERS
  1077.  *  item                    [IN]        Is a specific fixed icontext menuitem object
  1078.  *  common_item_data        [IN]        
  1079.  * RETURNS
  1080.  *  void
  1081.  *****************************************************************************/
  1082. #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
  1083. static scrolling_text gui_two_line_scroll_text;
  1084. #endif 
  1085. void gui_remove_highlight_fixed_icontext_menuitem(void *item, void *common_item_data)
  1086. {
  1087.     /*----------------------------------------------------------------*/
  1088.     /* Local Variables                                                */
  1089.     /*----------------------------------------------------------------*/
  1090.     fixed_icontext_menuitem_type *t = (fixed_icontext_menuitem_type*) item;
  1091.     /*----------------------------------------------------------------*/
  1092.     /* Code Body                                                      */
  1093.     /*----------------------------------------------------------------*/
  1094. #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
  1095.     gui_scrolling_text_stop(&gui_two_line_scroll_text);
  1096. #endif 
  1097.     UI_UNUSED_PARAMETER(common_item_data);
  1098.     t->flags &= ~UI_MENUITEM_STATE_FOCUSSED;
  1099. #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
  1100.     gui_reset_current_two_line_menuitem_data();
  1101. #endif 
  1102.     t->flags &= ~UI_MENUITEM_STATE_ANIMATE;
  1103.     if (t->item_icon_handle != GDI_ERROR_HANDLE)
  1104.     {
  1105.         gdi_image_stop_animation(t->item_icon_handle);
  1106.         t->item_icon_handle = GDI_ERROR_HANDLE;
  1107.     }
  1108. }
  1109. /* GUI: fixed icon text list menuitem functions             */
  1110. UI_fixed_icontext_list_menuitem_theme *current_fixed_icontext_list_menuitem_theme = NULL;
  1111. /*****************************************************************************
  1112.  * FUNCTION
  1113.  *  gui_set_fixed_icontext_list_menuitem_current_theme
  1114.  * DESCRIPTION
  1115.  *  Applies the current theme to a fixed icontext list menuitem
  1116.  * PARAMETERS
  1117.  *  m       [IN]        Is the fixed icontext list menuitem object   (common data)
  1118.  * RETURNS
  1119.  *  void
  1120.  *****************************************************************************/
  1121. #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  1122. UI_filled_area fixed_icontext_list_menuitem_transparent_filled_area;
  1123. #endif 
  1124. void gui_set_fixed_icontext_list_menuitem_current_theme(fixed_icontext_list_menuitem *m)
  1125. {
  1126.     /*----------------------------------------------------------------*/
  1127.     /* Local Variables                                                */
  1128.     /*----------------------------------------------------------------*/
  1129.     S32 i;
  1130.     /*----------------------------------------------------------------*/
  1131.     /* Code Body                                                      */
  1132.     /*----------------------------------------------------------------*/
  1133.     m->disabled_filler = current_fixed_icontext_list_menuitem_theme->disabled_filler;
  1134.     m->flags |= current_fixed_icontext_list_menuitem_theme->flags;
  1135.     m->focussed_filler = current_fixed_icontext_list_menuitem_theme->focussed_filler;
  1136. #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  1137.     if (!m->focussed_filler->flags & UI_FILLED_AREA_TYPE_BITMAP)
  1138.     {
  1139.         fixed_icontext_list_menuitem_transparent_filled_area = *(m->focussed_filler);
  1140.         m->focussed_filler = &fixed_icontext_list_menuitem_transparent_filled_area;
  1141.         fixed_icontext_list_menuitem_transparent_filled_area.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
  1142.         fixed_icontext_list_menuitem_transparent_filled_area.c.alpha = HIGHLIGHTER_COLOR_OPACITY_VALUE;
  1143.     }
  1144. #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */ 
  1145.     m->normal_filler = current_fixed_icontext_list_menuitem_theme->normal_filler;
  1146.     m->selected_filler = current_fixed_icontext_list_menuitem_theme->selected_filler;
  1147.     for (i = 0; i < m->n_text_columns; i++)
  1148.     {
  1149.         m->normal_text_colors[i] = current_fixed_icontext_list_menuitem_theme->normal_text_colors[i];
  1150.         m->focussed_text_colors[i] = current_fixed_icontext_list_menuitem_theme->focussed_text_colors[i];
  1151.         m->selected_text_colors[i] = current_fixed_icontext_list_menuitem_theme->selected_text_colors[i];
  1152.         m->disabled_text_colors[i] = current_fixed_icontext_list_menuitem_theme->disabled_text_colors[i];
  1153.         m->text_fonts[i] = current_fixed_icontext_list_menuitem_theme->text_fonts[i];
  1154.     }
  1155. }
  1156. /*****************************************************************************
  1157.  * FUNCTION
  1158.  *  gui_set_fixed_icontext_list_menuitem_theme
  1159.  * DESCRIPTION
  1160.  *  Applies the given theme to a fixed icontext list menuitem
  1161.  * PARAMETERS
  1162.  *  m       [IN]        Is the fixed icontext list menuitem object   (common data)
  1163.  *  t       [IN]        Is the theme
  1164.  * RETURNS
  1165.  *  void
  1166.  *****************************************************************************/
  1167. void gui_set_fixed_icontext_list_menuitem_theme(
  1168.         fixed_icontext_list_menuitem *m,
  1169.         UI_fixed_icontext_list_menuitem_theme *t)
  1170. {
  1171.     /*----------------------------------------------------------------*/
  1172.     /* Local Variables                                                */
  1173.     /*----------------------------------------------------------------*/
  1174.     S32 i;
  1175.     /*----------------------------------------------------------------*/
  1176.     /* Code Body                                                      */
  1177.     /*----------------------------------------------------------------*/
  1178.     m->disabled_filler = t->disabled_filler;
  1179.     m->flags |= t->flags;
  1180.     m->focussed_filler = t->focussed_filler;
  1181. #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  1182.     if (!m->focussed_filler->flags & UI_FILLED_AREA_TYPE_BITMAP)
  1183.     {
  1184.         fixed_icontext_list_menuitem_transparent_filled_area = *(m->focussed_filler);
  1185.         m->focussed_filler = &fixed_icontext_list_menuitem_transparent_filled_area;
  1186.         fixed_icontext_list_menuitem_transparent_filled_area.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
  1187.         fixed_icontext_list_menuitem_transparent_filled_area.c.alpha = HIGHLIGHTER_COLOR_OPACITY_VALUE;
  1188.     }
  1189. #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */ 
  1190.     m->normal_filler = t->normal_filler;
  1191.     m->selected_filler = t->selected_filler;
  1192.     for (i = 0; i < m->n_text_columns; i++)
  1193.     {
  1194.         m->normal_text_colors[i] = t->normal_text_colors[i];
  1195.         m->focussed_text_colors[i] = t->focussed_text_colors[i];
  1196.         m->selected_text_colors[i] = t->selected_text_colors[i];
  1197.         m->disabled_text_colors[i] = t->disabled_text_colors[i];
  1198.         m->text_fonts[i] = t->text_fonts[i];
  1199.     }
  1200. }
  1201. /*****************************************************************************
  1202.  * FUNCTION
  1203.  *  gui_create_fixed_icontext_list_menuitem
  1204.  * DESCRIPTION
  1205.  *  Creates a fixed icontext list menuitem
  1206.  * PARAMETERS
  1207.  *  m                   [IN]        Is the fixed icontext list menuitem object (common data)
  1208.  *  width               [IN]        Width is the width of the fixed icontext list menuitem
  1209.  *  height              [IN]        Height is the height of the fixed icontext list menuitem
  1210.  *  n_text_columns      [IN]        Is the number of text columns
  1211.  *  n_icon_columns      [IN]        Is the number of icon columns
  1212.  * RETURNS
  1213.  *  void
  1214.  *****************************************************************************/
  1215. void gui_create_fixed_icontext_list_menuitem(
  1216.         fixed_icontext_list_menuitem *m,
  1217.         S32 width,
  1218.         S32 height,
  1219.         S32 n_text_columns,
  1220.         S32 n_icon_columns)
  1221. {
  1222.     /*----------------------------------------------------------------*/
  1223.     /* Local Variables                                                */
  1224.     /*----------------------------------------------------------------*/
  1225.     /*----------------------------------------------------------------*/
  1226.     /* Code Body                                                      */
  1227.     /*----------------------------------------------------------------*/
  1228.     m->width = width;
  1229.     m->height = height;
  1230.     m->flags = 0;
  1231.     m->ext_flags = 0;
  1232.     m->icon_transparent_color = gui_transparent_color(0, 0, 0);
  1233.     if (n_icon_columns > FIXED_ICONTEXT_LIST_MAX_ICON_COLUMNS)
  1234.     {
  1235.         n_icon_columns = FIXED_ICONTEXT_LIST_MAX_ICON_COLUMNS;
  1236.     }
  1237.     if (n_text_columns > FIXED_ICONTEXT_LIST_MAX_TEXT_COLUMNS)
  1238.     {
  1239.         n_text_columns = FIXED_ICONTEXT_LIST_MAX_TEXT_COLUMNS;
  1240.     }
  1241.     m->n_icon_columns = n_icon_columns;
  1242.     m->n_text_columns = n_text_columns;
  1243.     gui_set_fixed_icontext_list_menuitem_current_theme(m);
  1244.     m->scroll_x = 0;
  1245.     m->scroll_width = width;
  1246.     m->post_display_function = NULL;
  1247.     m->parent_list = NULL;
  1248.     m->parent_matrix = NULL;    
  1249. }
  1250. /*****************************************************************************
  1251.  * FUNCTION
  1252.  *  gui_fixed_icontext_list_menuitem_set_post_display
  1253.  * DESCRIPTION
  1254.  *  
  1255.  * PARAMETERS
  1256.  *  m                           [?]         
  1257.  *  post_display_function       [IN]        
  1258.  * RETURNS
  1259.  *  void
  1260.  *****************************************************************************/
  1261. void gui_fixed_icontext_list_menuitem_set_post_display(
  1262.         fixed_icontext_list_menuitem *m,
  1263.         void (*post_display_function) (void *item, void *common_item_data, S32 x, S32 y))
  1264. {
  1265.     /*----------------------------------------------------------------*/
  1266.     /* Local Variables                                                */
  1267.     /*----------------------------------------------------------------*/
  1268.     /*----------------------------------------------------------------*/
  1269.     /* Code Body                                                      */
  1270.     /*----------------------------------------------------------------*/
  1271.     m->post_display_function = post_display_function;
  1272. }
  1273. /* Text scrolling related functions within the menu item */
  1274. fixed_icontext_list_menuitem *GUI_current_fixed_icontext_list_menuitem_common_data = NULL;
  1275. fixed_icontext_list_menuitem_type *GUI_current_fixed_icontext_list_menuitem_data = NULL;
  1276. U8 GUI_current_fixed_icontext_list_menuitem_scroll = 0;
  1277. U8 GUI_current_fixed_icontext_list_menuitem_scroll_direction;
  1278. S32 GUI_current_fixed_icontext_list_menuitem_x;
  1279. S32 GUI_current_fixed_icontext_list_menuitem_y;
  1280. S32 GUI_current_fixed_icontext_list_menuitem_scroll_counter = 0;
  1281. /* Current text column for marqueeing. Auto selected with UI_MENUITEM_AUTO_CHOOSE_MARQUEE. */
  1282. S32 GUI_current_fixed_icontext_list_menuitem_column = 0;
  1283. UI_string_type GUI_current_fixed_icontext_list_menuitem_scroll_text = NULL;
  1284. UI_string_type GUI_current_fixed_icontext_list_menuitem_scroll_text_end = NULL;
  1285. /*****************************************************************************
  1286.  * FUNCTION
  1287.  *  gui_fixed_icontext_list_menuitem_scroll_handler
  1288.  * DESCRIPTION
  1289.  *  
  1290.  * PARAMETERS
  1291.  *  void
  1292.  * RETURNS
  1293.  *  void
  1294.  *****************************************************************************/
  1295. void gui_fixed_icontext_list_menuitem_scroll_handler(void)
  1296. {
  1297.     /*----------------------------------------------------------------*/
  1298.     /* Local Variables                                                */
  1299.     /*----------------------------------------------------------------*/
  1300.     U32 flags = GUI_current_fixed_icontext_list_menuitem_common_data->flags;
  1301.     /*----------------------------------------------------------------*/
  1302.     /* Code Body                                                      */
  1303.     /*----------------------------------------------------------------*/
  1304.     flags |= GUI_current_fixed_icontext_list_menuitem_data->flags;
  1305. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1306.     gui_reset_current_list_effect();
  1307. #endif 
  1308.     if (GUI_current_fixed_icontext_list_menuitem_scroll_counter)
  1309.     {
  1310.         GUI_current_fixed_icontext_list_menuitem_scroll_counter--;
  1311.     }
  1312.     else
  1313.     {
  1314.     #if(UI_USE_WORD_SCROLLING_TEXT)
  1315.         GUI_current_fixed_icontext_list_menuitem_scroll_text = GUI_current_fixed_icontext_list_menuitem_scroll_text_end;
  1316.     #else /* (UI_USE_WORD_SCROLLING_TEXT) */ 
  1317.         if (flags & UI_MENUITEM_MARQUEE_SCROLL)
  1318.         {
  1319.             if (!r2lMMIFlag)
  1320.             {
  1321.                 GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x -= UI_text_menuitem_scroll_size;
  1322.                 if (GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x <=
  1323.                     (-(GUI_current_fixed_icontext_list_menuitem_common_data->text_width + UI_text_menuitem_scroll_gap)))
  1324.                 {
  1325.                     GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x = 0;
  1326.                 }
  1327.             }
  1328.             else
  1329.             {
  1330.                 GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x += UI_text_menuitem_scroll_size;
  1331.                 if (GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x >=
  1332.                     (GUI_current_fixed_icontext_list_menuitem_common_data->text_width + UI_text_menuitem_scroll_gap))
  1333.                 {
  1334.                     GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x = 0;
  1335.                 }
  1336.             }
  1337.         }
  1338.         else
  1339.         {
  1340.             if (GUI_current_fixed_icontext_list_menuitem_scroll_direction == 0)
  1341.             {
  1342.                 GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x -= UI_text_menuitem_scroll_size;
  1343.                 if ((GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x +
  1344.                      GUI_current_fixed_icontext_list_menuitem_common_data->text_width) <=
  1345.                     (GUI_current_fixed_icontext_list_menuitem_common_data->scroll_width))
  1346.                 {
  1347.                     GUI_current_fixed_icontext_list_menuitem_scroll_direction = 1;
  1348.                     GUI_current_fixed_icontext_list_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
  1349.                 }
  1350.             }
  1351.             else if (GUI_current_fixed_icontext_list_menuitem_scroll_direction == 1)
  1352.             {
  1353.                 GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x += UI_text_menuitem_scroll_size;
  1354.                 if (GUI_current_fixed_icontext_list_menuitem_common_data->scroll_x >= 0)
  1355.                 {
  1356.                     GUI_current_fixed_icontext_list_menuitem_scroll_direction = 0;
  1357.                     GUI_current_fixed_icontext_list_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
  1358.                 }
  1359.             }
  1360.         }
  1361.     #endif /* (UI_USE_WORD_SCROLLING_TEXT) */ 
  1362.         GUI_current_fixed_icontext_list_menuitem_common_data->ext_flags |= UI_MENUITEM_EXT_SHOW_IN_MARQUEE;
  1363.     #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  1364.         if (!gui_is_current_transparency_with_multi_layer())
  1365.         {
  1366.             gui_fixed_icontext_list_disable_transparent_effect(GUI_current_fixed_icontext_list_menuitem_common_data);   /* To hide text below scrolling text */
  1367.         }
  1368.     #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */ 
  1369.         gui_show_fixed_icontext_list_menuitem(
  1370.             (void*)GUI_current_fixed_icontext_list_menuitem_data,
  1371.             (void*)GUI_current_fixed_icontext_list_menuitem_common_data,
  1372.             GUI_current_fixed_icontext_list_menuitem_x,
  1373.             GUI_current_fixed_icontext_list_menuitem_y);
  1374.     #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  1375.         gui_fixed_icontext_list_enable_transparent_effect(GUI_current_fixed_icontext_list_menuitem_common_data);        /* To enable transparency */
  1376.     #endif 
  1377.         GUI_current_fixed_icontext_list_menuitem_common_data->ext_flags &= ~UI_MENUITEM_EXT_SHOW_IN_MARQUEE;
  1378.         gui_BLT_double_buffer(
  1379.             GUI_current_fixed_icontext_list_menuitem_x,
  1380.             GUI_current_fixed_icontext_list_menuitem_y,
  1381.             GUI_current_fixed_icontext_list_menuitem_x + GUI_current_fixed_icontext_list_menuitem_common_data->width - 1,
  1382.             GUI_current_fixed_icontext_list_menuitem_y + GUI_current_fixed_icontext_list_menuitem_common_data->height - 1);
  1383.     }
  1384.     gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_icontext_list_menuitem_scroll_handler);
  1385. }
  1386. /*****************************************************************************
  1387.  * FUNCTION
  1388.  *  gui_fixed_icontext_list_menuitem_reset_scroll_text_column
  1389.  * DESCRIPTION
  1390.  *  
  1391.  * PARAMETERS
  1392.  *  void
  1393.  * RETURNS
  1394.  *  void
  1395.  *****************************************************************************/
  1396. void gui_fixed_icontext_list_menuitem_reset_scroll_text_column(void)
  1397. {
  1398.     /*----------------------------------------------------------------*/
  1399.     /* Local Variables                                                */
  1400.     /*----------------------------------------------------------------*/
  1401.     /*----------------------------------------------------------------*/
  1402.     /* Code Body                                                      */
  1403.     /*----------------------------------------------------------------*/
  1404.     /* This cannot be done in gui_fixed_icontext_list_menuitem_stop_scroll() 
  1405.        because we need to keep text scroll column unchanged when highlight is switched */
  1406.     GUI_current_fixed_icontext_list_menuitem_column = 0;
  1407. }
  1408. /*****************************************************************************
  1409.  * FUNCTION
  1410.  *  gui_fixed_icontext_list_menuitem_start_scroll
  1411.  * DESCRIPTION
  1412.  *  
  1413.  * PARAMETERS
  1414.  *  void
  1415.  * RETURNS
  1416.  *  void
  1417.  *****************************************************************************/
  1418. void gui_fixed_icontext_list_menuitem_start_scroll(void)
  1419. {
  1420.     /*----------------------------------------------------------------*/
  1421.     /* Local Variables                                                */
  1422.     /*----------------------------------------------------------------*/
  1423.     fixed_icontext_list_menuitem_type *t =
  1424.         (fixed_icontext_list_menuitem_type*) GUI_current_fixed_icontext_list_menuitem_data;
  1425.     fixed_icontext_list_menuitem *m =
  1426.         (fixed_icontext_list_menuitem*) GUI_current_fixed_icontext_list_menuitem_common_data;
  1427.     S32 w;
  1428.     U32 flags;
  1429.     BOOL do_scroll = MMI_FALSE;
  1430.     /*----------------------------------------------------------------*/
  1431.     /* Code Body                                                      */
  1432.     /*----------------------------------------------------------------*/
  1433.     flags = m->flags;
  1434.     flags |= t->flags;
  1435.     gui_add_cleanup_hook(gui_fixed_icontext_list_menuitem_reset_scroll_text_column);
  1436.     if (flags & UI_MENUITEM_AUTO_CHOOSE_MARQUEE)
  1437.     {
  1438.         S32 i;
  1439.         for (i = 0; i < m->n_text_columns; i++)
  1440.         {
  1441.             gui_set_font(m->text_fonts[i]);
  1442.             w = gui_get_string_width(t->item_texts[i]);
  1443.             m->text_width = w;
  1444.             m->scroll_x = 0;
  1445.             if (w >= m->text_coordinates[i].width - 1)
  1446.             {
  1447.                 GUI_current_fixed_icontext_list_menuitem_column = i;
  1448.                 m->scroll_width = m->text_coordinates[i].width;
  1449.                 do_scroll = MMI_TRUE;
  1450.                 break;
  1451.             }
  1452.         }
  1453.     }
  1454.     else
  1455.     {
  1456.         if (GUI_current_fixed_icontext_list_menuitem_column >= m->n_text_columns)
  1457.         {
  1458.             MMI_DBG_ASSERT(0);
  1459.             GUI_current_fixed_icontext_list_menuitem_column = 0;
  1460.         }
  1461.         gui_set_font(m->text_fonts[GUI_current_fixed_icontext_list_menuitem_column]);
  1462.         w = gui_get_string_width(t->item_texts[GUI_current_fixed_icontext_list_menuitem_column]);
  1463.         m->text_width = w;
  1464.         m->scroll_x = 0;
  1465.         if (w >= m->scroll_width - 1)
  1466.         {
  1467.             do_scroll = MMI_TRUE;
  1468.         }
  1469.     }
  1470.     if (do_scroll)
  1471.     {
  1472.     #if(UI_USE_WORD_SCROLLING_TEXT)
  1473.         GUI_current_fixed_icontext_list_menuitem_scroll_text =
  1474.             t->item_texts[GUI_current_fixed_icontext_list_menuitem_column];
  1475.         GUI_current_fixed_icontext_list_menuitem_scroll = 1;
  1476.         GUI_current_fixed_icontext_list_menuitem_scroll_direction = 0;
  1477.         GUI_current_fixed_icontext_list_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
  1478.     #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1479.         if (gui_get_current_list_effect() && gblock_list_effect != 1)
  1480.         {
  1481.             gui_register_callback_menuitem_scroll(gui_fixed_icontext_list_menuitem_scroll_handler);
  1482.         }
  1483.         else
  1484.     #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  1485.         {
  1486.             gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_icontext_list_menuitem_scroll_handler);
  1487.         }
  1488.     #else /* (UI_USE_WORD_SCROLLING_TEXT) */ 
  1489.         if ((flags & UI_MENUITEM_MARQUEE_SCROLL) || (flags & UI_MENUITEM_TWO_DIRECTION_SCROLL))
  1490.         {
  1491.             GUI_current_fixed_icontext_list_menuitem_scroll = 1;
  1492.             GUI_current_fixed_icontext_list_menuitem_scroll_direction = 0;
  1493.             GUI_current_fixed_icontext_list_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
  1494.         #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1495.             if (gui_get_current_list_effect() && gblock_list_effect != 1)
  1496.             {
  1497.                 gui_register_callback_menuitem_scroll(gui_fixed_icontext_list_menuitem_scroll_handler);
  1498.             }
  1499.             else
  1500.         #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  1501.             {
  1502.                 gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_icontext_list_menuitem_scroll_handler);
  1503.             }
  1504.         }
  1505.     #endif /* (UI_USE_WORD_SCROLLING_TEXT) */ 
  1506.     }
  1507.     else
  1508. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1509.     {
  1510.         gui_register_callback_menuitem_scroll(gui_dummy_scroll_handler_for_list_effects);
  1511.         GUI_current_fixed_icontext_list_menuitem_scroll = 0;
  1512.     }
  1513. #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  1514.     {
  1515.         GUI_current_fixed_icontext_list_menuitem_scroll = 0;
  1516.     }
  1517. #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  1518. }
  1519. /*****************************************************************************
  1520.  * FUNCTION
  1521.  *  gui_fixed_icontext_list_menuitem_stop_scroll
  1522.  * DESCRIPTION
  1523.  *  
  1524.  * PARAMETERS
  1525.  *  void
  1526.  * RETURNS
  1527.  *  void
  1528.  *****************************************************************************/
  1529. void gui_fixed_icontext_list_menuitem_stop_scroll(void)
  1530. {
  1531.     /*----------------------------------------------------------------*/
  1532.     /* Local Variables                                                */
  1533.     /*----------------------------------------------------------------*/
  1534.     /*----------------------------------------------------------------*/
  1535.     /* Code Body                                                      */
  1536.     /*----------------------------------------------------------------*/
  1537.     if (GUI_current_fixed_icontext_list_menuitem_scroll)
  1538.     {
  1539.         gui_cancel_timer(gui_fixed_icontext_list_menuitem_scroll_handler);
  1540.         GUI_current_fixed_icontext_list_menuitem_scroll = 0;
  1541.     }
  1542. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1543.     gui_register_callback_menuitem_scroll(gui_dummy_scroll_handler_for_list_effects);
  1544.     gui_restore_current_list_effect();
  1545. #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  1546. }
  1547. /*****************************************************************************
  1548.  * FUNCTION
  1549.  *  gui_fixed_icontext_list_menuitem_set_text_coordinates
  1550.  * DESCRIPTION
  1551.  *  Sets the co-ordinates for a text column
  1552.  * PARAMETERS
  1553.  *  m               [IN]        Is the fixed icontext list menuitem object (common data)
  1554.  *  text_column     [IN]        Is the column number of the text column (zero based)
  1555.  *  x               [IN]        Is the position of this text column within the menuitem
  1556.  *  y               [IN]        Is the position of this text column within the menuitem
  1557.  *  width           [IN]        Are the dimensions of the this text column
  1558.  *  height          [IN]        Are the dimensions of the this text column
  1559.  * RETURNS
  1560.  *  void
  1561.  *****************************************************************************/
  1562. void gui_fixed_icontext_list_menuitem_set_text_coordinates(
  1563.         fixed_icontext_list_menuitem *m,
  1564.         S32 text_column,
  1565.         S32 x,
  1566.         S32 y,
  1567.         S32 width,
  1568.         S32 height)
  1569. {
  1570.     /*----------------------------------------------------------------*/
  1571.     /* Local Variables                                                */
  1572.     /*----------------------------------------------------------------*/
  1573.     /*----------------------------------------------------------------*/
  1574.     /* Code Body                                                      */
  1575.     /*----------------------------------------------------------------*/
  1576.     if (text_column >= m->n_text_columns)
  1577.     {
  1578.         return;
  1579.     }
  1580.     m->text_coordinates[text_column].x = x;
  1581.     m->text_coordinates[text_column].y = y;
  1582.     m->text_coordinates[text_column].width = width;
  1583.     m->text_coordinates[text_column].height = height;
  1584.     if (text_column == GUI_current_fixed_icontext_list_menuitem_column)
  1585.     {
  1586.         m->scroll_width = width;
  1587.     }
  1588. }
  1589. /*****************************************************************************
  1590.  * FUNCTION
  1591.  *  gui_fixed_icontext_list_menuitem_set_icon_coordinates
  1592.  * DESCRIPTION
  1593.  *  Sets the co-ordinates for a icon column
  1594.  * PARAMETERS
  1595.  *  m               [IN]        Is the fixed icontext list menuitem object (common data)
  1596.  *  icon_column     [IN]        Is the column number of the icon column (zero based)
  1597.  *  x               [IN]        Is the position of this icon column within the menuitem
  1598.  *  y               [IN]        Is the position of this icon column within the menuitem
  1599.  *  width           [IN]        Are the dimensions of the this icon column
  1600.  *  height          [IN]        Are the dimensions of the this icon column
  1601.  * RETURNS
  1602.  *  void
  1603.  *****************************************************************************/
  1604. void gui_fixed_icontext_list_menuitem_set_icon_coordinates(
  1605.         fixed_icontext_list_menuitem *m,
  1606.         S32 icon_column,
  1607.         S32 x,
  1608.         S32 y,
  1609.         S32 width,
  1610.         S32 height)
  1611. {
  1612.     /*----------------------------------------------------------------*/
  1613.     /* Local Variables                                                */
  1614.     /*----------------------------------------------------------------*/
  1615.     /*----------------------------------------------------------------*/
  1616.     /* Code Body                                                      */
  1617.     /*----------------------------------------------------------------*/
  1618.     if (icon_column >= m->n_icon_columns)
  1619.     {
  1620.         return;
  1621.     }
  1622.     m->icon_coordinates[icon_column].x = x;
  1623.     m->icon_coordinates[icon_column].y = y;
  1624.     m->icon_coordinates[icon_column].width = width;
  1625.     m->icon_coordinates[icon_column].height = height;
  1626. }
  1627. /*****************************************************************************
  1628.  * FUNCTION
  1629.  *  gui_resize_fixed_icontext_list_menuitem
  1630.  * DESCRIPTION
  1631.  *  Changes the size of a fixed icontext list menuitem
  1632.  * PARAMETERS
  1633.  *  m           [IN]        Is the fixed icontext list menuitem object   (common data)
  1634.  *  width       [IN]        Is the new width
  1635.  *  height      [IN]        Is the new height
  1636.  * RETURNS
  1637.  *  void
  1638.  *****************************************************************************/
  1639. void gui_resize_fixed_icontext_list_menuitem(fixed_icontext_list_menuitem *m, S32 width, S32 height)
  1640. {
  1641.     /*----------------------------------------------------------------*/
  1642.     /* Local Variables                                                */
  1643.     /*----------------------------------------------------------------*/
  1644.     /*----------------------------------------------------------------*/
  1645.     /* Code Body                                                      */
  1646.     /*----------------------------------------------------------------*/
  1647.     m->width = width;
  1648.     m->height = height;
  1649. }
  1650. /*****************************************************************************
  1651.  * FUNCTION
  1652.  *  gui_show_fixed_icontext_list_menuitem
  1653.  * DESCRIPTION
  1654.  *  Displays the fixed icontext list menuitem
  1655.  * PARAMETERS
  1656.  *  item                    [IN]        Is a specific fixed icontext list menuitem object
  1657.  *  common_item_data        [IN]        Is the fixed icontext list menuitem object (common_data)
  1658.  *  x                       [IN]        Is the position at which the menuitem is displayed
  1659.  *  y                       [IN]        Is the position at which the menuitem is displayed
  1660.  * RETURNS
  1661.  *  void
  1662.  *****************************************************************************/
  1663. void gui_show_fixed_icontext_list_menuitem(void *item, void *common_item_data, S32 x, S32 y)
  1664. {
  1665.     /*----------------------------------------------------------------*/
  1666.     /* Local Variables                                                */
  1667.     /*----------------------------------------------------------------*/
  1668.     S32 x1, y1, x2, y2;
  1669.     S32 ix1, iy1, ix2, iy2;
  1670.     color text_color;
  1671.     UI_filled_area *f = NULL;
  1672.     fixed_icontext_list_menuitem *m = (fixed_icontext_list_menuitem*) common_item_data;
  1673.     fixed_icontext_list_menuitem_type *mi = (fixed_icontext_list_menuitem_type*) item;
  1674.     U32 flags;
  1675.     UI_string_type _text;
  1676.     PU8 _icon;
  1677.     U8 animation_flag = 0;
  1678.     U8 focussed_flag = 0;
  1679.     U8 disabled_flag = 0;
  1680.     U8 selected_flag = 0;
  1681.     S32 i;
  1682.     color c;
  1683.     S32 sw, sh;
  1684.     /*----------------------------------------------------------------*/
  1685.     /* Code Body                                                      */
  1686.     /*----------------------------------------------------------------*/
  1687.     flags = mi->flags;
  1688.     flags |= m->flags;
  1689.     c = gui_color(0, 0, 0);
  1690.     if (flags & UI_MENUITEM_STATE_FOCUSSED)
  1691.     {
  1692.         GUI_current_fixed_icontext_list_menuitem_x = x;
  1693.         GUI_current_fixed_icontext_list_menuitem_y = y;
  1694.     }
  1695.     x1 = x;
  1696.     y1 = y;
  1697.     y2 = y1 + m->height - 1;
  1698.     x2 = x1 + m->width - 1;
  1699.     if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(flags & UI_MENUITEM_DISABLE_HIGHLIGHT))
  1700.     {
  1701.         f = m->focussed_filler;
  1702.         focussed_flag = 1;
  1703.         if (flags & UI_MENUITEM_FOCUSSED_ANIMATE)
  1704.         {
  1705.             animation_flag = 1;
  1706.         }
  1707.     }
  1708.     else if (flags & UI_MENUITEM_STATE_DISABLED)
  1709.     {
  1710.         if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND))
  1711.         {
  1712.             f = m->disabled_filler;
  1713.         }
  1714.         disabled_flag = 1;
  1715.     }
  1716.     else if (flags & UI_MENUITEM_STATE_SELECTED)
  1717.     {
  1718.         f = m->selected_filler;
  1719. f->flags |= UI_FILLED_AREA_BORDER|UI_FILLED_AREA_ROUNDED_BORDER;
  1720.         if (flags & UI_MENUITEM_SELECTED_ANIMATE)
  1721.         {
  1722.             animation_flag = 1;
  1723.         }
  1724.         selected_flag = 1;
  1725.     }
  1726.     else
  1727.     {
  1728.         if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND))
  1729.         {
  1730.             f = m->normal_filler;
  1731.         }
  1732.     }
  1733.     gui_push_clip();
  1734.     gui_set_clip(x1, y1, x2, y2);
  1735.     if (f != NULL && (!(flags & UI_MENUITEM_HIGHLIGHT_SWITCH_ICON)))
  1736.     {
  1737.     #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
  1738.     #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1739.         if (is_draw_next_frame_list_highlight_effect_value())
  1740.     #endif
  1741.         {
  1742.             g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_HIGHLIGHT_ICONTEXT_LIST;
  1743.         }
  1744.     #endif
  1745.     #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1746.         set_start_position_and_item_parameters_for_list_highlighter_effect(item, common_item_data, x1, y1);
  1747.     #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  1748.         if (line_draw)
  1749.         {
  1750.             gui_draw_list_filled_area(x1, y1 + 1, x2 - 1, y2, f);
  1751.         }
  1752.         else
  1753.     #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  1754.         {
  1755.             gui_draw_list_filled_area(x1, y1, x2, y2, f);
  1756.         }
  1757.     #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  1758.     #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  1759.         if ((line_draw && GUI_current_fixed_icontext_menuitem_scroll))
  1760.         {
  1761.             gui_draw_filled_area(x1, y1 + 1, x2 - 1, y2, f);
  1762.         }
  1763.         else
  1764.     #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  1765.         {
  1766. gui_draw_filled_area(x1, y1, x2, y2, &f1);
  1767.             gui_draw_filled_area(x1+1, y1+1, x2-1, y2-1, f);
  1768.         }
  1769.     #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  1770.     #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  1771.         if (line_draw)
  1772.         {
  1773.             gui_draw_vertical_line(
  1774.                 MMI_fixed_list_menu.y + 1,
  1775.                 MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 2,
  1776.                 MMI_fixed_list_menu.x,
  1777.                 current_MMI_theme->list_background_filler->border_color);
  1778.         }
  1779.     #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  1780.     }
  1781. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1782.     /* To hide the text and icon of the menuitem up to the last frame for flash feel effect */
  1783.     if (gblock_list_effect == 0)
  1784.     {
  1785.         if (gui_get_current_list_effect() == MMI_UI_LIST_HIGHLIGHT_EFFECT_FLASH_FEELING &&
  1786.             MMI_current_menu_type == LIST_MENU)
  1787.         {
  1788.             if (flash_feel_last_frame == 0)
  1789.             {
  1790.                 if (flags & UI_MENUITEM_STATE_FOCUSSED)
  1791.                 {
  1792.                     flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY;
  1793.                 }
  1794.             }
  1795.         }
  1796.     }
  1797. #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  1798.     for (i = 0; i < m->n_icon_columns; i++)
  1799.     {
  1800.         /* For bi-degree main menu */
  1801.         /* selected item, should draw selected image */
  1802.         if (flags & UI_MENUITEM_HIGHLIGHT_SWITCH_ICON)
  1803.         {
  1804.             if (flags & UI_MENUITEM_STATE_FOCUSSED)
  1805.             {
  1806.                 i++;
  1807.             }
  1808.             /* normal item, should clear previous drawn image */
  1809.             else
  1810.             {
  1811.             #ifdef __GDI_MEMORY_PROFILE_2__
  1812.                 gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);
  1813.             #endif 
  1814.                 continue;
  1815.             }
  1816.         }
  1817.         if (mi->item_icon_handles[i] != GDI_ERROR_HANDLE)
  1818.         {
  1819.             gdi_image_stop_animation(mi->item_icon_handles[i]);
  1820.             mi->item_icon_handles[i] = GDI_ERROR_HANDLE;
  1821.         }
  1822.         _icon = mi->item_icons[i];
  1823.         /* _icon_handle=mi->item_icon_handles[i]; */
  1824.     #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1825.         /* To hide the icon of the menuitem up to the last frame for flash feel effect */
  1826.         if (gblock_list_effect == 0)
  1827.         {
  1828.             if (gui_get_current_list_effect() == MMI_UI_LIST_HIGHLIGHT_EFFECT_FLASH_FEELING &&
  1829.                 MMI_current_menu_type == LIST_MENU)
  1830.             {
  1831.                 if (flash_feel_last_frame == 0)
  1832.                 {
  1833.                     if (flags & UI_MENUITEM_STATE_FOCUSSED)
  1834.                     {
  1835.                         _icon = UI_NULL_IMAGE;
  1836.                     }
  1837.                 }
  1838.             }
  1839.         }
  1840.     #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  1841.         /* Autocalculate the icon position              */
  1842.         if (_icon != UI_NULL_IMAGE)
  1843.         {
  1844.             S32 icon_width, icon_height;
  1845.             gui_measure_image(_icon, &icon_width, &icon_height);
  1846.             if (flags & UI_MENUITEM_CENTER_ICON_X)
  1847.             {
  1848.                 m->icon_coordinates[i].x = (m->width >> 1) - (icon_width >> 1);
  1849.             }
  1850.             if (!(m->flags & MENU_MUTLIROW_ICON_LIST))
  1851.             {
  1852.                 if (flags & UI_MENUITEM_CENTER_ICON_Y)
  1853.                 {
  1854.                     m->icon_coordinates[i].y = (m->height >> 1) - (icon_height >> 1);
  1855.                 }
  1856.             }
  1857.         }
  1858.         if (r2lMMIFlag)
  1859.         {
  1860.             ix1 = x2 - m->icon_coordinates[i].x - m->icon_coordinates[i].width + 1;
  1861.         }
  1862.         else
  1863.         {
  1864.             ix1 = m->icon_coordinates[i].x + x1;
  1865.         }
  1866.     #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  1867.         if (line_draw && m->icon_coordinates[i].width)
  1868.         {
  1869.             gui_reset_clip();
  1870.             if (!r2lMMIFlag)
  1871.             {
  1872.                 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 */
  1873.             }
  1874.             else
  1875.             {
  1876.                 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 */
  1877.             }
  1878.         }
  1879.     #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  1880.         iy1 = m->icon_coordinates[i].y + y1;
  1881.         ix2 = ix1 + m->icon_coordinates[i].width - 1;
  1882.         iy2 = iy1 + m->icon_coordinates[i].height - 1;
  1883.         if (ix2 > x2)
  1884.         {
  1885.             ix2 = x2;
  1886.         }
  1887.         if (iy2 > y2)
  1888.         {
  1889.             iy2 = y2;
  1890.         }
  1891.         gui_set_clip(ix1, iy1, ix2, iy2);
  1892.         if (_icon != UI_NULL_IMAGE)
  1893.         {
  1894.             if (animation_flag)
  1895.             {
  1896.             #if(UI_MAIN_MENU_ANIMATION_TYPE == UI_MAIN_MENU_ANIMATION_TYPE1)
  1897.                 gdi_image_draw_animation(ix1, iy1, _icon, &(mi->item_icon_handles[i]) /* &animation_handle */ );
  1898.                 /* mi->item_icon_handles[i]=gui_show_transparent_animated_image(ix1,iy1,_icon,m->icon_transparent_color); */
  1899.             #elif(UI_MAIN_MENU_ANIMATION_TYPE==UI_MAIN_MENU_ANIMATION_TYPE2)
  1900.                 gdi_image_draw_animation(ix1, iy1, _icon, &(mi->item_icon_handles[i]) /* &animation_handle */ );
  1901.                 /* mi->item_icon_handles[i]=gui_show_transparent_animated_image_frames(ix1,iy1,_icon,m->icon_transparent_color,1,0); */
  1902.             #endif 
  1903.                 m->flags |= UI_MENUITEM_STATE_ANIMATE;
  1904.             }
  1905.             else if (m->flags & UI_MENUITEM_STATE_ANIMATE)
  1906.             {
  1907.                 gui_show_transparent_animated_image_frame(ix1, iy1, _icon, m->icon_transparent_color, 0);
  1908.                 m->flags &= ~UI_MENUITEM_STATE_ANIMATE;
  1909.             }
  1910.             else
  1911.             {
  1912.                 gui_show_transparent_animated_image_frame(ix1, iy1, _icon, m->icon_transparent_color, 0);
  1913.             }
  1914.         }
  1915.         /* For bi-degree main menu */
  1916.         if (flags & UI_MENUITEM_HIGHLIGHT_SWITCH_ICON)
  1917.         {
  1918.             break;
  1919.         }
  1920.     }
  1921.     gui_push_text_clip();
  1922.     gui_set_text_clip(x1, y1, x2, y2);  /* 20051028 Calvin added: reset text clip */
  1923.     if (!(flags & UI_MENUITEM_DISABLE_TEXT_DISPLAY))
  1924.     {
  1925.         for (i = 0; i < m->n_text_columns; i++)
  1926.         {
  1927.             _text = mi->item_texts[i];
  1928.             gui_set_font(m->text_fonts[i]);
  1929.             gui_measure_string(_text, &sw, &sh);
  1930.             if (flags & UI_MENUITEM_CENTER_TEXT_X)
  1931.             {
  1932.                 m->text_coordinates[i].x = (m->width >> 1) - (sw >> 1);
  1933.                 ix1 = m->text_coordinates[i].x + x1;
  1934.                 ix2 = ix1 + m->text_coordinates[i].width - 1;
  1935.             }
  1936.             if (!(m->flags & MENU_MUTLIROW_ICON_LIST))
  1937.             {
  1938.                 if (flags & UI_MENUITEM_CENTER_TEXT_Y)
  1939.                 {
  1940.                     m->text_coordinates[i].y = (m->height >> 1) - (sh >> 1);
  1941.                     iy1 = m->text_coordinates[i].y + y1;
  1942.                     iy2 = iy1 + m->text_coordinates[i].height - 1;
  1943.                 }
  1944.             }
  1945.             if (r2lMMIFlag)
  1946.             {
  1947.                 ix1 = x2 - m->text_coordinates[i].x - m->text_coordinates[i].width + 1;
  1948.             }
  1949.             else
  1950.             {
  1951.                 ix1 = m->text_coordinates[i].x + x1;
  1952.             }
  1953.             iy1 = m->text_coordinates[i].y + y1;
  1954.             ix2 = ix1 + m->text_coordinates[i].width - 1;
  1955.             iy2 = iy1 + m->text_coordinates[i].height - 1;
  1956.             if (ix2 > x2)
  1957.             {
  1958.                 ix2 = x2;
  1959.             }
  1960.             if (iy2 > y2)
  1961.             {
  1962.                 iy2 = y2;
  1963.             }
  1964.             if ((i == 0) && (flags & UI_MENUITEM_FILL_COL1))
  1965.             {
  1966.                 int j;
  1967.                 gui_set_clip((ix1 - x1), y1, ix2, y2);
  1968.                 for (j = 0; j < FIXED_ICONTEXT_LIST_MAX_TEXT_COLUMNS; j++)
  1969.                 {
  1970.                     m->focussed_text_colors[j] = c;
  1971.                 }
  1972.                 gui_draw_filled_area((ix1 - x1), y1, ix2, y2, &colorangewgui_pop_up_dialog_background);
  1973.             }
  1974.             if ((i == 1) && (flags & UI_MENUITEM_FILL_COL2))
  1975.             {
  1976.                 int j;
  1977.                 gui_set_clip((ix1 - x1), y1, ix2, y2);
  1978.                 for (j = 0; j < FIXED_ICONTEXT_LIST_MAX_TEXT_COLUMNS; j++)
  1979.                 {
  1980.                     m->focussed_text_colors[j] = c;
  1981.                 }
  1982.                 gui_draw_filled_area((ix1 - x1), y1, ix2, y2, &colorangewgui_pop_up_dialog_background);
  1983.             }
  1984.             if (_text != NULL)
  1985.             {
  1986.                 if (_text[0] != '')
  1987.                 {
  1988.                     if (disabled_flag)
  1989.                     {
  1990.                         text_color = m->disabled_text_colors[i];
  1991.                     }
  1992.                     else if (focussed_flag)
  1993.                     {
  1994.                         text_color = m->focussed_text_colors[i];
  1995.                     }
  1996.                     else if (selected_flag)
  1997.                     {
  1998.                         text_color = m->selected_text_colors[i];
  1999.                     }
  2000.                     else
  2001.                     {
  2002.                         text_color = m->normal_text_colors[i];
  2003.                     }
  2004.                     if (!(flags & UI_MENUITEM_DISABLE_TEXT_CLIP))
  2005.                     {
  2006.                         gui_set_text_clip(ix1, iy1, ix2, iy2);
  2007.                     }
  2008.                     gui_set_text_color(text_color);
  2009.                     /* Added specifically to right justify second column in case of two column display with numbers */
  2010.                     if ((i == 1) && (flags & UI_MENUITEM_RIGHT_JUSTIFY_COL2))
  2011.                     {
  2012.                         if (r2lMMIFlag)
  2013.                         {
  2014.                             gui_move_text_cursor(ix1 + sw, iy1);
  2015.                         }
  2016.                         else
  2017.                         {
  2018.                             gui_move_text_cursor(ix2 - sw, iy1);
  2019.                         }
  2020.                         gui_set_line_height(sh);
  2021.                         gui_print_text(_text);
  2022.                     }
  2023.                     else
  2024.                     {
  2025.                         if ((flags & UI_MENUITEM_STATE_FOCUSSED) &&
  2026.                             ((i == GUI_current_fixed_icontext_list_menuitem_column) ||
  2027.                              (m->flags & MENU_MUTLIROW_ICON_LIST)))
  2028.                             /* Second Column Text Scroll Change For Multi Row List */
  2029.                         {
  2030.                             if (sw > m->text_coordinates[i].width)
  2031.                             {
  2032.                                 if (r2lMMIFlag)
  2033.                                 {
  2034.                                     gui_move_text_cursor(ix2 + m->scroll_x, iy1);
  2035.                                 }
  2036.                                 else
  2037.                                 {
  2038.                                     gui_move_text_cursor(ix1 + m->scroll_x, iy1);
  2039.                                 }
  2040.                             }
  2041.                             else
  2042.                             {
  2043.                                 if (r2lMMIFlag)
  2044.                                 {
  2045.                                     gui_move_text_cursor(ix2, iy1);
  2046.                                 }
  2047.                                 else
  2048.                                 {
  2049.                                     gui_move_text_cursor(ix1, iy1);
  2050.                                 }
  2051.                             }
  2052.                             gui_set_line_height(sh);
  2053.                             /* trucate too long number/name in call list. */
  2054.                             if (flags & UI_MENUITEM_TRUNCATE_CONTENT)
  2055.                             {
  2056.                                 if (r2lMMIFlag)
  2057.                                 {
  2058.                                     gui_print_truncated_text(ix2, iy1, m->text_coordinates[0].width, _text);
  2059.                                 }
  2060.                                 else
  2061.                                 {
  2062.                                     gui_print_truncated_text(ix1, iy1, m->text_coordinates[0].width, _text);
  2063.                                 }
  2064.                             }
  2065.                             else
  2066.                             {
  2067.                             #if(UI_USE_WORD_SCROLLING_TEXT)
  2068.                                 if (GUI_current_fixed_icontext_list_menuitem_scroll)
  2069.                                 {
  2070.                                     GUI_current_fixed_icontext_list_menuitem_scroll_text_end =
  2071.                                         GUI_current_fixed_icontext_list_menuitem_scroll_text;
  2072.                                     if (gui_print_truncated_text2
  2073.                                         (ix1 + m->scroll_x, iy1, ix2 - ix1 + 1,
  2074.                                          &GUI_current_fixed_icontext_list_menuitem_scroll_text_end))
  2075.                                     {
  2076.                                         GUI_current_fixed_icontext_menuitem_scroll_text_end = _text;
  2077.                                     }
  2078.                                 }
  2079.                                 else
  2080.                                 {
  2081.                                     gui_print_truncated_text2(ix1 + m->scroll_x, iy1, ix2 - ix1 + 1, &_text);
  2082.                                 }
  2083.                             #else /* (UI_USE_WORD_SCROLLING_TEXT) */ 
  2084.                                 gui_print_text(_text);
  2085.                                 if ((flags & UI_MENUITEM_MARQUEE_SCROLL) &&
  2086.                                     GUI_current_fixed_icontext_list_menuitem_scroll)
  2087.                                 {
  2088.                                     if (sw > m->text_coordinates[i].width)
  2089.                                     {
  2090.                                         if (r2lMMIFlag)
  2091.                                         {
  2092.                                             gui_move_text_cursor(
  2093.                                                 ix2 + m->scroll_x - (m->text_width + UI_text_menuitem_scroll_gap),
  2094.                                                 iy1);
  2095.                                         }
  2096.                                         else
  2097.                                         {
  2098.                                             gui_move_text_cursor(
  2099.                                                 ix1 + m->scroll_x + m->text_width + UI_text_menuitem_scroll_gap,
  2100.                                                 iy1);
  2101.                                         }
  2102.                                         gui_set_line_height(sh);
  2103.                                         gui_print_text(_text);
  2104.                                     }
  2105.                                 }
  2106.                             #endif /* (UI_USE_WORD_SCROLLING_TEXT) */ 
  2107.                             #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  2108.                                 if (line_draw)
  2109.                                 {
  2110.                                     gui_reset_clip();
  2111.                                     if (!r2lMMIFlag)
  2112.                                     {
  2113.                                         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 */
  2114.                                     }
  2115.                                     if (r2lMMIFlag && (m->n_text_columns > 1) && m->text_coordinates[i].width)
  2116.                                     {
  2117.                                         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 */
  2118.                                     }
  2119.                                 }
  2120.                             #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  2121.                             }
  2122.                         }
  2123.                         else
  2124.                         {
  2125.                             gui_set_line_height(sh);
  2126.                             if (flags & UI_MENUITEM_TRUNCATE_CONTENT)
  2127.                             {
  2128.                                 if (r2lMMIFlag)
  2129.                                 {
  2130.                                     gui_print_truncated_text(ix2, iy1, m->text_coordinates[0].width, _text);
  2131.                                 }
  2132.                                 else
  2133.                                 {
  2134.                                     gui_print_truncated_text(ix1, iy1, m->text_coordinates[0].width, _text);
  2135.                                 }
  2136.                             }
  2137.                             else
  2138.                             {
  2139.                                 if (r2lMMIFlag)
  2140.                                 {
  2141.                                     gui_move_text_cursor(ix2, iy1);
  2142.                                 }
  2143.                                 else
  2144.                                 {
  2145.                                     gui_move_text_cursor(ix1, iy1);
  2146.                                 }
  2147.                                 gui_print_text(_text);
  2148.                             }
  2149.                         }
  2150.                     }
  2151.                 }
  2152.             }
  2153.         #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  2154.             if (line_draw)
  2155.             {
  2156.                 gui_reset_clip();
  2157.                 if (!r2lMMIFlag)
  2158.                 {
  2159.                     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 */
  2160.                 }
  2161.                 if (r2lMMIFlag && (m->n_text_columns > 1) && m->text_coordinates[i].width)
  2162.                 {
  2163.                     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 */
  2164.                 }
  2165.             }
  2166.         #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  2167.         }
  2168.     }
  2169.     if (m->post_display_function)
  2170.     {
  2171.         m->post_display_function(item, common_item_data, x, y);
  2172.     }
  2173.     gui_pop_text_clip();
  2174.     gui_pop_clip();
  2175. #if(UI_ENABLE_POP_UP_DESCRIPTIONS)
  2176.     if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(m->ext_flags & UI_MENUITEM_EXT_SHOW_IN_MARQUEE))
  2177.     {
  2178.         gui_display_pop_up_description(x, y, m->width, m->height);
  2179.     }
  2180. #endif /* (UI_ENABLE_POP_UP_DESCRIPTIONS) */ 
  2181. }
  2182. /*****************************************************************************
  2183.  * FUNCTION
  2184.  *  gui_measure_fixed_icontext_list_menuitem
  2185.  * DESCRIPTION
  2186.  *  Measures a fixed icontext list menuitem
  2187.  * PARAMETERS
  2188.  *  item                    [?]         
  2189.  *  m                       [?]         
  2190.  *  width                   [OUT]       
  2191.  *  height                  [OUT]       
  2192.  *  common_item_data(?)     [IN]        Is the fixed icontext list menuitem object (common_data)
  2193.  * RETURNS
  2194.  *  void
  2195.  *****************************************************************************/
  2196. void gui_measure_fixed_icontext_list_menuitem(void *item, void *m, S32 *width, S32 *height)
  2197. {
  2198.     /*----------------------------------------------------------------*/
  2199.     /* Local Variables                                                */
  2200.     /*----------------------------------------------------------------*/
  2201.     fixed_icontext_list_menuitem *t = (fixed_icontext_list_menuitem*) m;
  2202.     /*----------------------------------------------------------------*/
  2203.     /* Code Body                                                      */
  2204.     /*----------------------------------------------------------------*/
  2205.     UI_UNUSED_PARAMETER(item);
  2206.     *width = t->width;
  2207.     *height = t->height;
  2208. }
  2209. /*****************************************************************************
  2210.  * FUNCTION
  2211.  *  gui_highlight_fixed_icontext_list_menuitem
  2212.  * DESCRIPTION
  2213.  *  Highlights a fixed icontext list menuitem (not visually)
  2214.  * PARAMETERS
  2215.  *  item                    [IN]        Is a specific fixed icontext list menuitem object
  2216.  *  common_item_data        [IN]        
  2217.  * RETURNS
  2218.  *  void
  2219.  *****************************************************************************/
  2220. void gui_highlight_fixed_icontext_list_menuitem(void *item, void *common_item_data)
  2221. {
  2222.     /*----------------------------------------------------------------*/
  2223.     /* Local Variables                                                */
  2224.     /*----------------------------------------------------------------*/
  2225.     fixed_icontext_list_menuitem_type *t = (fixed_icontext_list_menuitem_type*) item;
  2226.     fixed_icontext_list_menuitem *m = (fixed_icontext_list_menuitem*) common_item_data;
  2227.     U32 flags;
  2228.     /*----------------------------------------------------------------*/
  2229.     /* Code Body                                                      */
  2230.     /*----------------------------------------------------------------*/
  2231.     flags = m->flags;
  2232.     flags |= t->flags;
  2233.     GUI_current_fixed_icontext_list_menuitem_common_data = m;
  2234.     GUI_current_fixed_icontext_list_menuitem_data = t;
  2235.     gui_fixed_icontext_list_menuitem_stop_scroll();
  2236.     gui_fixed_icontext_list_menuitem_start_scroll();
  2237.     if (t->flags & UI_MENUITEM_DISABLE_HIGHLIGHT)
  2238.     {
  2239.         return;
  2240.     }
  2241.     t->flags |= UI_MENUITEM_STATE_FOCUSSED;
  2242. }